Rename CPDF_TextObject variables [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
Mar 16, 2026, 12:54:55 PM (yesterday) Mar 16
to Lei Zhang, Andy Phan, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Lei Zhang . resolved

Another rename CL.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
Gerrit-Change-Number: 144890
Gerrit-PatchSet: 2
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Mar 2026 16:54:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Mar 16, 2026, 1:04:34 PM (yesterday) Mar 16
to Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Andy Phan voted and added 2 comments

Votes added by Andy Phan

Code-Review+1

2 comments

File core/fpdfapi/page/cpdf_textobject.cpp
Line 85, Patchset 2 (Latest): for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
Andy Phan . unresolved

Rename this, too? Also line 113.

Line 191, Patchset 2 (Latest): size_t nChars = 0;
Andy Phan . unresolved

Want to rename this one too?

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
Gerrit-Change-Number: 144890
Gerrit-PatchSet: 2
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Mar 2026 17:04:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Mar 16, 2026, 1:12:45 PM (yesterday) Mar 16
to Lei Zhang, Andy Phan, pdfium-...@googlegroups.com

Lei Zhang added 2 comments

File core/fpdfapi/page/cpdf_textobject.cpp
Line 85, Patchset 2: for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
Andy Phan . resolved

Rename this, too? Also line 113.

Lei Zhang

Done

Line 191, Patchset 2: size_t nChars = 0;
Andy Phan . resolved

Want to rename this one too?

Lei Zhang

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
    Gerrit-Change-Number: 144890
    Gerrit-PatchSet: 3
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Comment-Date: Mon, 16 Mar 2026 17:12:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andy Phan <andy...@chromium.org>
    satisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    2:56 PM (6 hours ago) 2:56 PM
    to Lei Zhang, Pdfium LUCI CQ, Andy Phan, pdfium-...@googlegroups.com

    Lei Zhang voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
    Gerrit-Change-Number: 144890
    Gerrit-PatchSet: 4
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Mar 2026 18:56:50 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Pdfium LUCI CQ (Gerrit)

    unread,
    3:14 PM (6 hours ago) 3:14 PM
    to Lei Zhang, Andy Phan, pdfium-...@googlegroups.com

    Pdfium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    2 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: core/fpdfapi/page/cpdf_textobject.cpp
    Insertions: 11, Deletions: 11.

    @@ -47,7 +47,7 @@

    Item info;
    info.char_code_ = char_codes_[index];
    - info.origin_ = CFX_PointF(index > 0 ? char_positions_[index - 1] : 0, 0);
    + info.origin_ = CFX_PointF(char_positions_[index], 0);

    RetainPtr<CPDF_Font> font = GetFont();
    const CPDF_CIDFont* cid_font = font->AsCIDFont();
    @@ -82,7 +82,8 @@
    RetainPtr<CPDF_Font> font = GetFont();
    bool is_in_latin_word = false;
    int word_count = 0;
    - for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
    + const size_t char_count = CountChars();
    + for (size_t i = 0; i < char_count; ++i) {
    uint32_t char_code = GetCharCode(i);

    WideString unicode_str = font->UnicodeFromCharCode(char_code);
    @@ -110,7 +111,8 @@
    WideString result_str;
    int word_count = 0;
    bool is_in_latin_word = false;
    - for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
    + const size_t char_count = CountChars();
    + for (size_t i = 0; i < char_count; ++i) {
    uint32_t char_code = GetCharCode(i);

    WideString unicode_str = font->UnicodeFromCharCode(char_code);
    @@ -188,14 +190,14 @@
    char_kernings_.clear();
    char_positions_.clear();
    RetainPtr<CPDF_Font> font = GetFont();
    - size_t nChars = 0;
    + size_t char_count = 0;
    for (const auto& str : strings) {
    - nChars += font->CountChar(str.AsStringView());
    + char_count += font->CountChar(str.AsStringView());
    }
    - CHECK(nChars);
    - char_codes_.resize(nChars);
    - char_kernings_.resize(nChars);
    - char_positions_.resize(nChars - 1);
    + CHECK(char_count);
    + char_codes_.resize(char_count);
    + char_kernings_.resize(char_count);
    + char_positions_.resize(char_count);
    size_t index = 0;
    for (size_t i = 0; i < segments_count; ++i) {
    ByteStringView segment = strings[i].AsStringView();
    @@ -267,9 +269,7 @@

    for (size_t i = 0; i < char_codes_.size(); ++i) {
    const uint32_t char_code = char_codes_[i];
    - if (i > 0) {
    - char_positions_[i - 1] = current_position;
    - }
    + char_positions_[i] = current_position;

    FX_RECT char_rect = font->GetCharBBox(char_code);
    float char_width;
    ```

    Change information

    Commit message:
    Rename CPDF_TextObject variables

    - Stop using Hungarian notation.
    - Consistently write foobar as foo_bar. e.g. font_size
    - Use fewer abbreviations.
    Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
    Reviewed-by: Andy Phan <andy...@chromium.org>
    Commit-Queue: Lei Zhang <the...@chromium.org>
    Files:
    • M core/fpdfapi/page/cpdf_textobject.cpp
    • M core/fpdfapi/page/cpdf_textobject.h
    Change size: M
    Delta: 2 files changed, 99 insertions(+), 93 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Andy Phan
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: Idd36881b98106b97fc9bb2450e19b829906abc99
    Gerrit-Change-Number: 144890
    Gerrit-PatchSet: 5
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages