diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-20 11:17:52 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-20 16:10:03 +0000 |
commit | d56fd77ef0b2e2a14ceb127283ac0e7cf7ca090b (patch) | |
tree | 65728013e4f43b8ce2728cbbf8038b8707e08739 /xfa/fde/cfde_texteditengine.h | |
parent | bc48185643b3983fd9620ba2f987ada1478fbdc2 (diff) | |
download | pdfium-d56fd77ef0b2e2a14ceb127283ac0e7cf7ca090b.tar.xz |
Implement CFDE_TextEditEngine::GetIndex* methods.
This CL adds unittests and implementations for the text edit engine
methods to get various indexes based on cursor position.
The |RebuildPieces| method was fixed to correctly keep track of
character position when dealing with BIDI characters.
Change-Id: Ie3c5ee5d63bfd00f6f0cdcb1c6fcfe6e05bba50e
Reviewed-on: https://pdfium-review.googlesource.com/14430
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_texteditengine.h')
-rw-r--r-- | xfa/fde/cfde_texteditengine.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fde/cfde_texteditengine.h b/xfa/fde/cfde_texteditengine.h index e26487aaf6..dbb12f3953 100644 --- a/xfa/fde/cfde_texteditengine.h +++ b/xfa/fde/cfde_texteditengine.h @@ -129,14 +129,14 @@ class CFDE_TextEditEngine { bool Undo(); void ClearOperationRecords(); - // TODO(dsinclair): Implement .... - size_t GetIndexBefore(size_t pos) { return 0; } - size_t GetIndexLeft(size_t pos) { return 0; } - size_t GetIndexRight(size_t pos) { return 0; } - size_t GetIndexUp(size_t pos) { return 0; } - size_t GetIndexDown(size_t pos) { return 0; } - size_t GetIndexAtStartOfLine(size_t pos) { return 0; } - size_t GetIndexAtEndOfLine(size_t pos) { return 0; } + // This is not const it can trigger a |Layout|. + size_t GetIndexBefore(size_t pos); + size_t GetIndexLeft(size_t pos) const; + size_t GetIndexRight(size_t pos) const; + size_t GetIndexUp(size_t pos) const; + size_t GetIndexDown(size_t pos) const; + size_t GetIndexAtStartOfLine(size_t pos) const; + size_t GetIndexAtEndOfLine(size_t pos) const; void SelectAll(); void SetSelection(size_t start_idx, size_t count); |