summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtengine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-14 11:09:20 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-14 15:35:39 +0000
commit24b6af6c87f0d7f49f5213ae019616b9b07e2e8f (patch)
treefaea13c7ac4a4ca63a186793519aa116b91792f2 /xfa/fde/cfde_txtedtengine.cpp
parent54a8390782c734f6c919f126ea5b93d5a3dcdc00 (diff)
downloadpdfium-24b6af6c87f0d7f49f5213ae019616b9b07e2e8f.tar.xz
Cleanup more fde defines
This CL cleans up more defines and shuffles some fde code around to better locations. Change-Id: I6af0e991d9fa489ca45d1d0f9d041657beef3b7e Reviewed-on: https://pdfium-review.googlesource.com/10613 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtengine.cpp')
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp55
1 files changed, 16 insertions, 39 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index aaf0d21712..4701d452aa 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -25,6 +25,22 @@ namespace {
const uint32_t kPageWidthMax = 0xffff;
const uint32_t kUnicodeParagraphSeparator = 0x2029;
+enum FDE_TXTEDT_MODIFY_RET {
+ FDE_TXTEDT_MODIFY_RET_F_Locked = -5,
+ FDE_TXTEDT_MODIFY_RET_F_Invalidate = -4,
+ FDE_TXTEDT_MODIFY_RET_F_Boundary = -3,
+ FDE_TXTEDT_MODIFY_RET_F_Full = -2,
+ FDE_TXTEDT_MODIFY_RET_S_Normal = 0,
+ FDE_TXTEDT_MODIFY_RET_S_Part = 2,
+};
+
+enum FDE_TXTEDIT_LINEEND {
+ FDE_TXTEDIT_LINEEND_Auto,
+ FDE_TXTEDIT_LINEEND_CRLF,
+ FDE_TXTEDIT_LINEEND_CR,
+ FDE_TXTEDIT_LINEEND_LF,
+};
+
} // namespace
FDE_TXTEDTPARAMS::FDE_TXTEDTPARAMS()
@@ -252,26 +268,12 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
UpdateCaretIndex(ptCaret);
break;
}
- case MC_WordBackward:
- break;
- case MC_WordForward:
- break;
case MC_LineStart:
MoveLineStart();
break;
case MC_LineEnd:
MoveLineEnd();
break;
- case MC_ParagStart:
- MoveParagStart();
- break;
- case MC_ParagEnd:
- MoveParagEnd();
- break;
- case MC_PageDown:
- break;
- case MC_PageUp:
- break;
case MC_Home:
MoveHome();
break;
@@ -1281,31 +1283,6 @@ bool CFDE_TxtEdtEngine::MoveLineEnd() {
return true;
}
-bool CFDE_TxtEdtEngine::MoveParagStart() {
- FDE_TXTEDTPARAGPOS ParagPos;
- TextPos2ParagPos(m_bBefore ? m_nCaret : m_nCaret - 1, ParagPos);
- UpdateCaretRect(m_ParagPtrArray[ParagPos.nParagIndex]->GetStartIndex(), true);
- return true;
-}
-
-bool CFDE_TxtEdtEngine::MoveParagEnd() {
- int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
- FDE_TXTEDTPARAGPOS ParagPos;
- TextPos2ParagPos(nIndex, ParagPos);
- CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex].get();
- nIndex = pParag->GetStartIndex() + pParag->GetTextLength() - 1;
- wchar_t wChar = m_pTxtBuf->GetCharByIndex(nIndex);
- if (wChar == L'\n' && nIndex > 0) {
- nIndex--;
- wChar = m_pTxtBuf->GetCharByIndex(nIndex);
- if (wChar != L'\r') {
- nIndex++;
- }
- }
- UpdateCaretRect(nIndex, true);
- return true;
-}
-
bool CFDE_TxtEdtEngine::MoveHome() {
UpdateCaretRect(0, true);
return true;