summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtengine.cpp
diff options
context:
space:
mode:
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;