summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fftextedit.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-19 10:07:20 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-19 14:16:31 +0000
commit0264e97bceaca69d0b0232ac680bd7b26e2db66a (patch)
tree85ea26e8a518469b74c3db58d5a814c102a3622c /xfa/fxfa/cxfa_fftextedit.cpp
parentb02aa61946a62639dd9d39bc00eff6f829b1e414 (diff)
downloadpdfium-0264e97bceaca69d0b0232ac680bd7b26e2db66a.tar.xz
Convert selection to use count instead of end index
This CL changes the Text Edit Engine code to use a count instead of an end index for the selection range. Using count lets us differentiate a selection at the beginning of 1 character and an empty selection. A few new tests were added to test unicode word break behaviour, some are not working yet and are commented out. Change-Id: Icce8f5003102ef0a850151ccdf16d3c2226d94bf Reviewed-on: https://pdfium-review.googlesource.com/13491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fftextedit.cpp')
-rw-r--r--xfa/fxfa/cxfa_fftextedit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp
index e27971d5df..82b6f63b59 100644
--- a/xfa/fxfa/cxfa_fftextedit.cpp
+++ b/xfa/fxfa/cxfa_fftextedit.cpp
@@ -299,8 +299,9 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget,
CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit;
eParam.m_wsNewText = pDateTime->GetEditText();
if (pDateTime->HasSelection()) {
- std::tie(eParam.m_iSelStart, eParam.m_iSelEnd) =
- pDateTime->GetSelection();
+ size_t count;
+ std::tie(eParam.m_iSelStart, count) = pDateTime->GetSelection();
+ eParam.m_iSelEnd = eParam.m_iSelStart + count;
}
} else {
eParam.m_wsNewText = pEdit->GetText();