summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_edit.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-17 09:25:05 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-17 09:25:05 -0800
commit098f454bddc57c9af00d725132a6d9ad8bdb171f (patch)
treedf08147b985014b2dbbef0bdf70c49d9f50fa4a5 /xfa/fwl/core/ifwl_edit.cpp
parentd5670482c19cff27997c3c94aa2efa142ae36259 (diff)
downloadpdfium-098f454bddc57c9af00d725132a6d9ad8bdb171f.tar.xz
Move the IFWL_Edit Events out of ifwl_edit.h
This Cl moves the edit events to actual class files and renames to drop the Edt from the names. Review-Url: https://codereview.chromium.org/2515463002
Diffstat (limited to 'xfa/fwl/core/ifwl_edit.cpp')
-rw-r--r--xfa/fwl/core/ifwl_edit.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/xfa/fwl/core/ifwl_edit.cpp b/xfa/fwl/core/ifwl_edit.cpp
index d046a624a8..c3b0be0240 100644
--- a/xfa/fwl/core/ifwl_edit.cpp
+++ b/xfa/fwl/core/ifwl_edit.cpp
@@ -17,6 +17,10 @@
#include "xfa/fde/fde_render.h"
#include "xfa/fde/ifde_txtedtpage.h"
#include "xfa/fgas/font/fgas_gefont.h"
+#include "xfa/fwl/core/cfwl_evtcheckword.h"
+#include "xfa/fwl/core/cfwl_evttextchanged.h"
+#include "xfa/fwl/core/cfwl_evttextfull.h"
+#include "xfa/fwl/core/cfwl_evtvalidate.h"
#include "xfa/fwl/core/cfwl_msgkey.h"
#include "xfa/fwl/core/cfwl_msgmouse.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
@@ -196,7 +200,7 @@ void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
pGraphics->ConcatMatrix(const_cast<CFX_Matrix*>(pMatrix));
CFX_Color crLine(0xFFFF0000);
- CFWL_EvtEdtCheckWord checkWordEvent;
+ CFWL_EvtCheckWord checkWordEvent;
checkWordEvent.m_pSrcTarget = this;
CFX_ByteString sLatinWord;
@@ -220,6 +224,7 @@ void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
checkWordEvent.bsWord = sLatinWord;
checkWordEvent.bCheckWord = true;
DispatchEvent(&checkWordEvent);
+
if (!sLatinWord.IsEmpty() && !checkWordEvent.bCheckWord) {
AddSpellCheckObj(pathSpell, nStart, sLatinWord.GetLength(), fOffSetX,
fOffSetY);
@@ -450,7 +455,7 @@ void IFWL_Edit::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
CFX_RectF rtTemp;
GetClientRect(rtTemp);
- CFWL_EvtEdtTextChanged event;
+ CFWL_EvtTextChanged event;
event.m_pSrcTarget = this;
event.nChangeType = ChangeInfo.nChangeType;
event.wsInsert = ChangeInfo.wsInsert;
@@ -500,7 +505,7 @@ bool IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit, CFX_WideString& wsText) {
if (!pDst)
pDst = this;
- CFWL_EvtEdtValidate event;
+ CFWL_EvtValidate event;
event.pDstWidget = pDst;
event.m_pSrcTarget = this;
event.wsInsert = wsText;
@@ -1273,16 +1278,12 @@ void IFWL_Edit::ClearRecord() {
}
void IFWL_Edit::ProcessInsertError(int32_t iError) {
- switch (iError) {
- case -2: {
- CFWL_EvtEdtTextFull textFullEvent;
- textFullEvent.m_pSrcTarget = this;
- DispatchEvent(&textFullEvent);
- break;
- }
- default:
- break;
- }
+ if (iError != -2)
+ return;
+
+ CFWL_EvtTextFull textFullEvent;
+ textFullEvent.m_pSrcTarget = this;
+ DispatchEvent(&textFullEvent);
}
void IFWL_Edit::OnProcessMessage(CFWL_Message* pMessage) {