Refactor CPVT_Word caret calculations [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
Jun 23, 2026, 4:27:26 PM (2 days ago) Jun 23
to Seung Hyun Jin, Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Seung Hyun Jin

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fpdfdoc/cpvt_word.h
Line 42, Patchset 1 (Latest): float GetCaretX() const { return location_.x + width_; }
Lei Zhang . unresolved

AscentY() and DescentY() are very similar, but they do not have the "Get" prefix. Omit that for consistency?

Open in Gerrit

Related details

Attention is currently required from:
  • Seung Hyun Jin
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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
Gerrit-Change-Number: 150530
Gerrit-PatchSet: 1
Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Seung Hyun Jin <seungh...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 20:27:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Jun 23, 2026, 4:44:56 PM (2 days ago) Jun 23
to Seung Hyun Jin, Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Seung Hyun Jin

Lei Zhang added 1 comment

File fpdfsdk/pwl/cpwl_edit_impl.cpp
Line 1230, Patchset 1 (Latest): ptFoot.x = ptHead.x;
Lei Zhang . unresolved

Also mention reducing GetCaretX() calls by reusing the results in the CL description.

Open in Gerrit

Related details

Attention is currently required from:
  • Seung Hyun Jin
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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
Gerrit-Change-Number: 150530
Gerrit-PatchSet: 1
Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Seung Hyun Jin <seungh...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 20:44:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Seung Hyun Jin (Gerrit)

unread,
Jun 23, 2026, 4:56:55 PM (2 days ago) Jun 23
to Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Seung Hyun Jin added 2 comments

File core/fpdfdoc/cpvt_word.h
Line 42, Patchset 1: float GetCaretX() const { return location_.x + width_; }
Lei Zhang . resolved

AscentY() and DescentY() are very similar, but they do not have the "Get" prefix. Omit that for consistency?

Seung Hyun Jin

Done

File fpdfsdk/pwl/cpwl_edit_impl.cpp
Line 1230, Patchset 1: ptFoot.x = ptHead.x;
Lei Zhang . resolved

Also mention reducing GetCaretX() calls by reusing the results in the CL description.

Seung Hyun Jin

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement is not 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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
Gerrit-Change-Number: 150530
Gerrit-PatchSet: 3
Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Jun 2026 20:56:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Jun 23, 2026, 4:59:58 PM (2 days ago) Jun 23
to Seung Hyun Jin, Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Seung Hyun Jin

Lei Zhang added 1 comment

File core/fpdfdoc/cpvt_word.h
Line 42, Patchset 3 (Latest): float CaretX() const { return location_.x + width_; }
Lei Zhang . unresolved

One more nit: How about putting this above AscentY(), since most people think of "x/y" coordinates. As such, the x-coordinate getters should come before the y-coordinate getters.

Open in Gerrit

Related details

Attention is currently required from:
  • Seung Hyun Jin
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
    Gerrit-Change-Number: 150530
    Gerrit-PatchSet: 3
    Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Seung Hyun Jin <seungh...@google.com>
    Gerrit-Comment-Date: Tue, 23 Jun 2026 20:59:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Seung Hyun Jin (Gerrit)

    unread,
    Jun 23, 2026, 5:12:34 PM (2 days ago) Jun 23
    to Lei Zhang, pdfium-...@googlegroups.com
    Attention needed from Lei Zhang

    Seung Hyun Jin added 1 comment

    File core/fpdfdoc/cpvt_word.h
    Line 42, Patchset 3: float CaretX() const { return location_.x + width_; }
    Lei Zhang . resolved

    One more nit: How about putting this above AscentY(), since most people think of "x/y" coordinates. As such, the x-coordinate getters should come before the y-coordinate getters.

    Seung Hyun Jin

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lei Zhang
    Submit Requirements:
      • requirement is not 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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
      Gerrit-Change-Number: 150530
      Gerrit-PatchSet: 4
      Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Attention: Lei Zhang <the...@chromium.org>
      Gerrit-Comment-Date: Tue, 23 Jun 2026 21:12:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
      unsatisfied_requirement
      open
      diffy

      Lei Zhang (Gerrit)

      unread,
      Jun 23, 2026, 5:15:56 PM (2 days ago) Jun 23
      to Seung Hyun Jin, Lei Zhang, pdfium-...@googlegroups.com
      Attention needed from Seung Hyun Jin

      Lei Zhang voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Seung Hyun Jin
      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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
        Gerrit-Change-Number: 150530
        Gerrit-PatchSet: 4
        Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
        Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
        Gerrit-Attention: Seung Hyun Jin <seungh...@google.com>
        Gerrit-Comment-Date: Tue, 23 Jun 2026 21:15:52 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Seung Hyun Jin (Gerrit)

        unread,
        Jun 23, 2026, 5:26:28 PM (2 days ago) Jun 23
        to Lei Zhang, pdfium-...@googlegroups.com

        Seung Hyun Jin 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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
        Gerrit-Change-Number: 150530
        Gerrit-PatchSet: 4
        Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
        Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
        Gerrit-Reviewer: Seung Hyun Jin <seungh...@google.com>
        Gerrit-Comment-Date: Tue, 23 Jun 2026 21:26:25 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

        unread,
        Jun 23, 2026, 6:21:23 PM (2 days ago) Jun 23
        to Seung Hyun Jin, Lei Zhang, pdfium-...@googlegroups.com

        pdfium...@luci-project-accounts.iam.gserviceaccount.com submitted the change

        Change information

        Commit message:
        Refactor CPVT_Word caret calculations

        Add `CaretX()` to simplify caret coordinate calculations. Reduce
        `CaretX()` calls by reusing the results.


        Bug: 40115028
        Change-Id: I982471e262ac57401dcfb79aca77ff0ec65d92d6
        Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/150530
        Commit-Queue: Seung Hyun Jin <seungh...@google.com>
        Reviewed-by: Lei Zhang <the...@chromium.org>
        Files:
        • M core/fpdfdoc/cpvt_word.h
        • M fpdfsdk/pwl/cpwl_edit.cpp
        • M fpdfsdk/pwl/cpwl_edit_impl.cpp
        Change size: S
        Delta: 3 files changed, 16 insertions(+), 18 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Lei Zhang
        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: I982471e262ac57401dcfb79aca77ff0ec65d92d6
        Gerrit-Change-Number: 150530
        Gerrit-PatchSet: 5
        Gerrit-Owner: Seung Hyun Jin <seungh...@google.com>
        Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
        Gerrit-Reviewer: Seung Hyun Jin <seungh...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages