summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-16 17:26:23 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-17 18:28:34 +0000
commit9342b33ec0e2b43c0ee0b94bb70f2e981c263877 (patch)
tree519e4585c8897224b4e778230876988790fbeb2a
parentb5df8a5abc6ed986b7fb9c43103d188d32deb4e7 (diff)
downloadpdfium-9342b33ec0e2b43c0ee0b94bb70f2e981c263877.tar.xz
Remove redundant members in CFDE_TxtEdtEngine
This CL removes a bunch of redundant members from the text edit engine. The change information tracking was removed as most of it was unused or was used inconsistently. Change-Id: I92460594e46accff0b78e1183c8574fc83ce728a Reviewed-on: https://pdfium-review.googlesource.com/11275 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--xfa/fde/cfde_textout.cpp1
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp91
-rw-r--r--xfa/fde/cfde_txtedtengine.h42
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp7
-rw-r--r--xfa/fde/cfde_txtedttextset.cpp2
-rw-r--r--xfa/fgas/layout/cfx_txtbreak.cpp4
-rw-r--r--xfa/fgas/layout/cfx_txtbreak.h1
-rw-r--r--xfa/fwl/cfwl_edit.cpp6
-rw-r--r--xfa/fwl/cfwl_edit.h2
9 files changed, 48 insertions, 108 deletions
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 7a246a8efe..9bbeadee58 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -549,7 +549,6 @@ FX_TXTRUN CFDE_TextOut::ToTextRun(const FDE_TTOPIECE* pPiece) {
tr.fFontSize = m_fFontSize;
tr.dwStyles = m_dwTxtBkStyles;
tr.dwCharStyles = pPiece->dwCharStyles;
- tr.wLineBreakChar = L'\n';
tr.pRect = &pPiece->rtPiece;
return tr;
}
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 31cbfc0773..9877d87fb4 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -21,7 +21,6 @@
namespace {
const uint32_t kPageWidthMax = 0xffff;
-const uint32_t kUnicodeParagraphSeparator = 0x2029;
enum FDE_TXTEDT_MODIFY_RET {
FDE_TXTEDT_MODIFY_RET_F_Locked = -5,
@@ -49,24 +48,21 @@ class InsertOperation : public IFDE_TxtEdtDoRecord {
~InsertOperation() override {}
void Undo() const override {
+ CFX_WideString prev = m_pEngine->GetText(0, -1);
+
if (m_pEngine->IsSelect())
m_pEngine->ClearSelection();
m_pEngine->Inner_DeleteRange(m_nCaret, m_wsInsert.GetLength());
- m_pEngine->UpdateChangeInfoDelete(FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
- m_wsInsert);
- m_pEngine->GetParams()->pEventSink->OnTextChanged(
- *m_pEngine->GetChangeInfo());
+ m_pEngine->GetParams()->pEventSink->OnTextChanged(prev);
m_pEngine->SetCaretPos(m_nCaret, true);
}
void Redo() const override {
+ CFX_WideString prev = m_pEngine->GetText(0, -1);
m_pEngine->Inner_Insert(m_nCaret, m_wsInsert.c_str(),
m_wsInsert.GetLength());
- m_pEngine->UpdateChangeInfoInsert(FDE_TXTEDT_TEXTCHANGE_TYPE_Insert,
- m_wsInsert);
- m_pEngine->GetParams()->pEventSink->OnTextChanged(
- *m_pEngine->GetChangeInfo());
+ m_pEngine->GetParams()->pEventSink->OnTextChanged(prev);
m_pEngine->SetCaretPos(m_nCaret, false);
}
@@ -94,6 +90,7 @@ class DeleteOperation : public IFDE_TxtEdtDoRecord {
~DeleteOperation() override {}
void Undo() const override {
+ CFX_WideString prev = m_pEngine->GetText(0, -1);
if (m_pEngine->IsSelect())
m_pEngine->ClearSelection();
@@ -101,22 +98,17 @@ class DeleteOperation : public IFDE_TxtEdtDoRecord {
if (m_bSel)
m_pEngine->AddSelRange(m_nIndex, m_wsRange.GetLength());
- m_pEngine->UpdateChangeInfoInsert(FDE_TXTEDT_TEXTCHANGE_TYPE_Insert,
- m_wsRange);
- m_pEngine->GetParams()->pEventSink->OnTextChanged(
- *m_pEngine->GetChangeInfo());
+ m_pEngine->GetParams()->pEventSink->OnTextChanged(prev);
m_pEngine->SetCaretPos(m_nCaret, true);
}
void Redo() const override {
+ CFX_WideString prev = m_pEngine->GetText(0, -1);
m_pEngine->Inner_DeleteRange(m_nIndex, m_wsRange.GetLength());
if (m_bSel)
m_pEngine->RemoveSelRange(m_nIndex, m_wsRange.GetLength());
- m_pEngine->UpdateChangeInfoDelete(FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
- m_wsRange);
- m_pEngine->GetParams()->pEventSink->OnTextChanged(
- *m_pEngine->GetChangeInfo());
+ m_pEngine->GetParams()->pEventSink->OnTextChanged(prev);
m_pEngine->SetCaretPos(m_nIndex, true);
}
@@ -141,19 +133,10 @@ FDE_TXTEDTPARAMS::FDE_TXTEDTPARAMS()
dwFontColor(0xff000000),
fLineSpace(10.0f),
fTabWidth(36),
- wDefChar(0xFEFF),
- wLineBreakChar('\n'),
- nLineEnd(0),
- nHorzScale(100),
- fCharSpace(0),
pEventSink(nullptr) {}
FDE_TXTEDTPARAMS::~FDE_TXTEDTPARAMS() {}
-FDE_TXTEDT_TEXTCHANGE_INFO::FDE_TXTEDT_TEXTCHANGE_INFO() {}
-
-FDE_TXTEDT_TEXTCHANGE_INFO::~FDE_TXTEDT_TEXTCHANGE_INFO() {}
-
CFDE_TxtEdtEngine::CFDE_TxtEdtEngine()
: m_pTxtBuf(pdfium::MakeUnique<CFDE_TxtEdtBuf>()),
m_nPageLineCount(20),
@@ -161,16 +144,13 @@ CFDE_TxtEdtEngine::CFDE_TxtEdtEngine()
m_nAnchorPos(-1),
m_fCaretPosReserve(0.0),
m_nCaret(0),
- m_bBefore(true),
m_nCaretPage(0),
- m_bLock(false),
m_nLimit(0),
m_wcAliasChar(L'*'),
m_nFirstLineEnd(FDE_TXTEDIT_LINEEND_Auto),
- m_bAutoLineEnd(true),
- m_wLineEnd(kUnicodeParagraphSeparator) {
- m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto);
-}
+ m_bBefore(true),
+ m_bLock(false),
+ m_bAutoLineEnd(true) {}
CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() {
RemoveAllParags();
@@ -184,8 +164,7 @@ void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) {
m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>();
m_Param = params;
- m_wLineEnd = params.wLineBreakChar;
- m_bAutoLineEnd = m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto;
+ m_bAutoLineEnd = true;
UpdateTxtBreak();
}
@@ -210,7 +189,7 @@ void CFDE_TxtEdtEngine::SetText(const CFX_WideString& wsText) {
}
m_pTxtBuf->SetText(wsTemp);
}
- m_pTxtBuf->Insert(nLength, &m_wLineEnd, 1);
+ m_pTxtBuf->Insert(nLength, L"\n", 1);
RebuildParagraphs();
}
@@ -238,8 +217,10 @@ void CFDE_TxtEdtEngine::ClearText() {
return;
}
+ CFX_WideString prev = GetText(0, -1);
+
DeleteRange_DoRecord(0, len, false);
- m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
+ m_Param.pEventSink->OnTextChanged(prev);
SetCaretPos(0, true);
}
@@ -393,10 +374,9 @@ int32_t CFDE_TxtEdtEngine::Insert(const CFX_WideString& str) {
m_Param.pEventSink->OnAddDoRecord(pdfium::MakeUnique<InsertOperation>(
this, m_nCaret, CFX_WideString(lpBuffer, nLength)));
- m_ChangeInfo.wsPrevText = GetText(0, -1);
+ CFX_WideString prev = GetText(0, -1);
Inner_Insert(m_nCaret, lpBuffer, nLength);
- m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert;
- m_ChangeInfo.wsInsert = CFX_WideString(lpBuffer, nLength);
+
int32_t nStart = m_nCaret;
nStart += nLength;
wchar_t wChar = m_pTxtBuf->GetCharByIndex(nStart - 1);
@@ -406,7 +386,7 @@ int32_t CFDE_TxtEdtEngine::Insert(const CFX_WideString& str) {
bBefore = false;
}
SetCaretPos(nStart, bBefore);
- m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
+ m_Param.pEventSink->OnTextChanged(prev);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
@@ -450,12 +430,11 @@ void CFDE_TxtEdtEngine::Delete(bool bBackspace) {
m_Param.pEventSink->OnAddDoRecord(pdfium::MakeUnique<DeleteOperation>(
this, nStart, m_nCaret, wsRange, false));
- UpdateChangeInfoDelete(FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
- GetText(nStart, nCount));
+ CFX_WideString prev = GetText(0, -1);
Inner_DeleteRange(nStart, nCount);
SetCaretPos(nStart + ((!bBackspace && nStart > 0) ? -1 : 0),
(bBackspace || nStart == 0));
- m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
+ m_Param.pEventSink->OnTextChanged(prev);
}
void CFDE_TxtEdtEngine::RemoveSelRange(int32_t nStart, int32_t nCount) {
@@ -670,7 +649,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart,
int32_t nParagIndex = ParagPos.nParagIndex;
for (int32_t i = 0; i < nLength; i++, lpPos++) {
wCurChar = *lpPos;
- if (wCurChar == m_wLineEnd) {
+ if (wCurChar == L'\n') {
if (bFirst) {
pParag->SetTextLength(nLeavePart + (i - nTextStart + 1));
pParag->SetLineCount(-1);
@@ -780,8 +759,6 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart,
m_Param.pEventSink->OnAddDoRecord(pdfium::MakeUnique<DeleteOperation>(
this, nStart, m_nCaret, wsRange, bSel));
- UpdateChangeInfoDelete(FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
- GetText(nStart, nCount));
Inner_DeleteRange(nStart, nCount);
}
@@ -804,7 +781,7 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() {
do {
wChar = pIter->GetChar();
nIndex = pIter->GetAt();
- if (wChar == m_wLineEnd) {
+ if (wChar == L'\n') {
auto pParag = pdfium::MakeUnique<CFDE_TxtEdtParag>(this);
pParag->SetStartIndex(nParagStart);
pParag->SetTextLength(nIndex - nParagStart + 1);
@@ -885,11 +862,11 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() {
m_pTextBreak->SetFont(m_Param.pFont);
m_pTextBreak->SetFontSize(m_Param.fFontSize);
m_pTextBreak->SetTabWidth(m_Param.fTabWidth);
- m_pTextBreak->SetDefaultChar(m_Param.wDefChar);
- m_pTextBreak->SetParagraphBreakChar(m_Param.wLineBreakChar);
+ m_pTextBreak->SetDefaultChar(0xFEFF);
+ m_pTextBreak->SetParagraphBreakChar(L'\n');
m_pTextBreak->SetLineBreakTolerance(m_Param.fFontSize * 0.2f);
- m_pTextBreak->SetHorizontalScale(m_Param.nHorzScale);
- m_pTextBreak->SetCharSpace(m_Param.fCharSpace);
+ m_pTextBreak->SetHorizontalScale(100);
+ m_pTextBreak->SetCharSpace(0);
}
bool CFDE_TxtEdtEngine::ReplaceParagEnd(wchar_t*& lpText,
@@ -899,7 +876,7 @@ bool CFDE_TxtEdtEngine::ReplaceParagEnd(wchar_t*& lpText,
wchar_t wc = lpText[i];
switch (wc) {
case L'\r': {
- lpText[i] = m_wLineEnd;
+ lpText[i] = L'\n';
bPreIsCR = true;
} break;
case L'\n': {
@@ -917,7 +894,7 @@ bool CFDE_TxtEdtEngine::ReplaceParagEnd(wchar_t*& lpText,
m_bAutoLineEnd = false;
}
} else {
- lpText[i] = m_wLineEnd;
+ lpText[i] = L'\n';
if (m_bAutoLineEnd) {
m_nFirstLineEnd = FDE_TXTEDIT_LINEEND_LF;
m_bAutoLineEnd = false;
@@ -943,7 +920,7 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) const {
int32_t nLength = wsText.GetLength();
wchar_t* lpPos = const_cast<wchar_t*>(wsText.c_str());
for (int32_t i = 0; i < nLength; i++, lpPos++) {
- if (*lpPos == m_wLineEnd) {
+ if (*lpPos == L'\n') {
*lpPos = wc;
PosArr.push_back(i);
}
@@ -974,7 +951,7 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) const {
int32_t nLength = wsText.GetLength();
wchar_t* lpBuf = const_cast<wchar_t*>(wsText.c_str());
for (int32_t i = 0; i < nLength; i++, lpBuf++) {
- if (*lpBuf == m_wLineEnd)
+ if (*lpBuf == L'\n')
*lpBuf = wc;
}
}
@@ -1269,6 +1246,8 @@ void CFDE_TxtEdtEngine::DeleteSelect() {
if (nCountRange <= 0)
return;
+ CFX_WideString prev = GetText(0, -1);
+
int32_t nSelStart = 0;
while (nCountRange > 0) {
int32_t nSelCount = GetSelRange(--nCountRange, &nSelStart);
@@ -1276,7 +1255,7 @@ void CFDE_TxtEdtEngine::DeleteSelect() {
DeleteRange_DoRecord(nSelStart, nSelCount, true);
}
ClearSelection();
- m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
+ m_Param.pEventSink->OnTextChanged(prev);
m_Param.pEventSink->OnSelChanged();
SetCaretPos(nSelStart, true);
}
diff --git a/xfa/fde/cfde_txtedtengine.h b/xfa/fde/cfde_txtedtengine.h
index 9d472ce65a..b22c36f5ec 100644
--- a/xfa/fde/cfde_txtedtengine.h
+++ b/xfa/fde/cfde_txtedtengine.h
@@ -55,37 +55,20 @@ struct FDE_TXTEDTPARAMS {
float fPlateWidth;
float fPlateHeight;
+
int32_t nLineCount;
uint32_t dwLayoutStyles;
uint32_t dwAlignment;
uint32_t dwMode;
+
CFX_RetainPtr<CFGAS_GEFont> pFont;
float fFontSize;
FX_ARGB dwFontColor;
+
float fLineSpace;
float fTabWidth;
- wchar_t wDefChar;
- wchar_t wLineBreakChar;
- int32_t nLineEnd;
- int32_t nHorzScale;
- float fCharSpace;
- CFWL_Edit* pEventSink;
-};
-enum FDE_TXTEDT_TEXTCHANGE_TYPE {
- FDE_TXTEDT_TEXTCHANGE_TYPE_Insert = 0,
- FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
- FDE_TXTEDT_TEXTCHANGE_TYPE_Replace,
-};
-
-struct FDE_TXTEDT_TEXTCHANGE_INFO {
- FDE_TXTEDT_TEXTCHANGE_INFO();
- ~FDE_TXTEDT_TEXTCHANGE_INFO();
-
- int32_t nChangeType;
- CFX_WideString wsInsert;
- CFX_WideString wsDelete;
- CFX_WideString wsPrevText;
+ CFWL_Edit* pEventSink;
};
class CFDE_TxtEdtEngine {
@@ -149,17 +132,6 @@ class CFDE_TxtEdtEngine {
void Inner_DeleteRange(int32_t nStart, int32_t nCount);
void Inner_Insert(int32_t nStart, const wchar_t* lpText, int32_t nLength);
const FDE_TXTEDTPARAMS* GetParams() const { return &m_Param; }
- FDE_TXTEDT_TEXTCHANGE_INFO* GetChangeInfo() { return &m_ChangeInfo; }
-
- void UpdateChangeInfoInsert(int32_t type, const CFX_WideString& insertValue) {
- m_ChangeInfo.nChangeType = type;
- m_ChangeInfo.wsInsert = insertValue;
- }
-
- void UpdateChangeInfoDelete(int32_t type, const CFX_WideString& deleteValue) {
- m_ChangeInfo.nChangeType = type;
- m_ChangeInfo.wsDelete = deleteValue;
- }
private:
struct FDE_TXTEDTSELRANGE {
@@ -229,16 +201,14 @@ class CFDE_TxtEdtEngine {
int32_t m_nAnchorPos;
float m_fCaretPosReserve;
int32_t m_nCaret;
- bool m_bBefore;
int32_t m_nCaretPage;
CFX_RectF m_rtCaret;
- bool m_bLock;
int32_t m_nLimit;
wchar_t m_wcAliasChar;
int32_t m_nFirstLineEnd;
+ bool m_bBefore;
+ bool m_bLock;
bool m_bAutoLineEnd;
- wchar_t m_wLineEnd;
- FDE_TXTEDT_TEXTCHANGE_INFO m_ChangeInfo;
};
#endif // XFA_FDE_CFDE_TXTEDTENGINE_H_
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index cbc652da76..3020882c7e 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -260,22 +260,21 @@ int32_t CFDE_TxtEdtPage::LoadPage() {
float fParaBreakWidth = 0.0f;
if (!CFX_BreakTypeNoneOrPiece(pPiece->m_dwStatus)) {
- wchar_t wRtChar = pParams->wLineBreakChar;
if (TxtEdtPiece.nCount >= 2) {
wchar_t wChar = pBuf->GetCharByIndex(
m_nPageStart + TxtEdtPiece.nStart + TxtEdtPiece.nCount - 1);
wchar_t wCharPre = pBuf->GetCharByIndex(
m_nPageStart + TxtEdtPiece.nStart + TxtEdtPiece.nCount - 2);
- if (wChar == wRtChar) {
+ if (wChar == L'\n') {
fParaBreakWidth += fDefCharWidth;
}
- if (wCharPre == wRtChar) {
+ if (wCharPre == L'\n') {
fParaBreakWidth += fDefCharWidth;
}
} else if (TxtEdtPiece.nCount >= 1) {
wchar_t wChar = pBuf->GetCharByIndex(
m_nPageStart + TxtEdtPiece.nStart + TxtEdtPiece.nCount - 1);
- if (wChar == wRtChar) {
+ if (wChar == L'\n') {
fParaBreakWidth += fDefCharWidth;
}
}
diff --git a/xfa/fde/cfde_txtedttextset.cpp b/xfa/fde/cfde_txtedttextset.cpp
index fce52d3278..0b6cf8214e 100644
--- a/xfa/fde/cfde_txtedttextset.cpp
+++ b/xfa/fde/cfde_txtedttextset.cpp
@@ -35,7 +35,6 @@ int32_t CFDE_TxtEdtTextSet::GetDisplayPos(const FDE_TEXTEDITPIECE& piece,
tr.dwStyles = dwLayoutStyle;
tr.dwCharStyles = piece.dwCharStyles;
tr.pRect = &piece.rtPiece;
- tr.wLineBreakChar = pTextParams->wLineBreakChar;
return pBreak->GetDisplayPos(&tr, pCharPos);
}
@@ -57,6 +56,5 @@ std::vector<CFX_RectF> CFDE_TxtEdtTextSet::GetCharRects(
tr.dwStyles = dwLayoutStyle;
tr.dwCharStyles = pPiece->dwCharStyles;
tr.pRect = &pPiece->rtPiece;
- tr.wLineBreakChar = pTextParams->wLineBreakChar;
return pEngine->GetTextBreak()->GetCharRects(&tr, bBBox);
}
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp
index b2c54e5c6d..8d084fb41e 100644
--- a/xfa/fgas/layout/cfx_txtbreak.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -922,7 +922,6 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
bool bSingleLine = !!(pTxtRun->dwStyles & FX_LAYOUTSTYLE_SingleLine);
bool bCombText = !!(pTxtRun->dwStyles & FX_LAYOUTSTYLE_CombText);
wchar_t wch;
- wchar_t wLineBreakChar = pTxtRun->wLineBreakChar;
int32_t iCharSize;
float fCharSize;
float fStart = bRTLPiece ? rect.right() : rect.left;
@@ -939,7 +938,7 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
fCharSize = static_cast<float>(iCharSize) / 20000.0f;
bool bRet = (!bSingleLine && IsCtrlCode(wch));
if (!(wch == L'\v' || wch == L'\f' || wch == 0x2028 || wch == 0x2029 ||
- (wLineBreakChar != 0xFEFF && wch == wLineBreakChar))) {
+ wch == L'\n')) {
bRet = false;
}
if (bRet) {
@@ -991,7 +990,6 @@ FX_TXTRUN::FX_TXTRUN()
iVerticalScale(100),
dwCharStyles(0),
pRect(nullptr),
- wLineBreakChar(L'\n'),
bSkipSpace(true) {}
FX_TXTRUN::~FX_TXTRUN() {}
diff --git a/xfa/fgas/layout/cfx_txtbreak.h b/xfa/fgas/layout/cfx_txtbreak.h
index d74ea350fe..95130c070d 100644
--- a/xfa/fgas/layout/cfx_txtbreak.h
+++ b/xfa/fgas/layout/cfx_txtbreak.h
@@ -51,7 +51,6 @@ struct FX_TXTRUN {
int32_t iVerticalScale;
uint32_t dwCharStyles;
const CFX_RectF* pRect;
- wchar_t wLineBreakChar;
bool bSkipSpace;
};
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 0045c36858..6d14ad2e3c 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -410,12 +410,12 @@ void CFWL_Edit::OnCaretChanged() {
}
}
-void CFWL_Edit::OnTextChanged(const FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo) {
+void CFWL_Edit::OnTextChanged(const CFX_WideString& prevText) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VAlignMask)
UpdateVAlignment();
CFWL_EventTextChanged event(this);
- event.wsPrevText = ChangeInfo.wsPrevText;
+ event.wsPrevText = prevText;
DispatchEvent(&event);
LayoutScrollBar();
@@ -640,7 +640,6 @@ void CFWL_Edit::UpdateEditEngine() {
void CFWL_Edit::UpdateEditParams() {
FDE_TXTEDTPARAMS params;
- params.nHorzScale = 100;
params.fPlateWidth = m_rtEngine.width;
params.fPlateHeight = m_rtEngine.height;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_CombText)
@@ -714,7 +713,6 @@ void CFWL_Edit::UpdateEditParams() {
if (params.nLineCount <= 0)
params.nLineCount = 1;
params.fTabWidth = params.fFontSize * 1;
- params.wLineBreakChar = L'\n';
params.pEventSink = this;
m_EdtEngine.SetEditParams(params);
}
diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h
index 27fd205287..9915f05c00 100644
--- a/xfa/fwl/cfwl_edit.h
+++ b/xfa/fwl/cfwl_edit.h
@@ -92,7 +92,7 @@ class CFWL_Edit : public CFWL_Widget {
void SetOuter(CFWL_Widget* pOuter);
void OnCaretChanged();
- void OnTextChanged(const FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo);
+ void OnTextChanged(const CFX_WideString& prevText);
void OnSelChanged();
bool OnPageLoad(int32_t nPageIndex);
bool OnPageUnload(int32_t nPageIndex);