Index: fpdfsdk/fxedit/fxet_edit.cpp |
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp |
index 7d207a83caaee26fc8eb5ac3cf3001cd8f659efe..50d1722e97bcc20c289a8e324ef36fc0796d7777 100644 |
--- a/fpdfsdk/fxedit/fxet_edit.cpp |
+++ b/fpdfsdk/fxedit/fxet_edit.cpp |
@@ -706,7 +706,7 @@ void CFXEU_Clear::Undo() { |
if (m_pEdit) { |
m_pEdit->SelectNone(); |
m_pEdit->SetCaret(m_wrSel.BeginPos); |
- m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, FALSE, TRUE); |
+ m_pEdit->InsertText(m_swText, DEFAULT_CHARSET, FALSE, TRUE); |
m_pEdit->SetSel(m_wrSel.BeginPos, m_wrSel.EndPos); |
} |
} |
@@ -728,7 +728,7 @@ void CFXEU_InsertText::Redo() { |
if (m_pEdit && IsLast()) { |
m_pEdit->SelectNone(); |
m_pEdit->SetCaret(m_wpOld); |
- m_pEdit->InsertText(m_swText.c_str(), m_nCharset, FALSE, TRUE); |
+ m_pEdit->InsertText(m_swText, m_nCharset, FALSE, TRUE); |
} |
} |
@@ -1670,9 +1670,9 @@ CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange& wr1, |
return wrRet; |
} |
-void CFX_Edit::SetText(const FX_WCHAR* text) { |
+void CFX_Edit::SetText(const CFX_WideString& sText) { |
dsinclair
2016/09/08 13:00:11
May as well leave this as |text| to match the rest
Tom Sepez
2016/09/08 18:01:11
Fixed the others, too.
|
Empty(); |
- DoInsertText(CPVT_WordPlace(0, 0, -1), text, DEFAULT_CHARSET); |
+ DoInsertText(CPVT_WordPlace(0, 0, -1), sText, DEFAULT_CHARSET); |
Paint(); |
} |
@@ -1696,7 +1696,7 @@ FX_BOOL CFX_Edit::Clear() { |
return Clear(TRUE, TRUE); |
} |
-FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset) { |
+FX_BOOL CFX_Edit::InsertText(const CFX_WideString& text, int32_t charset) { |
return InsertText(text, charset, TRUE, TRUE); |
} |
@@ -2685,7 +2685,7 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) { |
return TRUE; |
} |
-FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, |
+FX_BOOL CFX_Edit::InsertText(const CFX_WideString& text, |
int32_t charset, |
FX_BOOL bAddUndo, |
FX_BOOL bPaint) { |
@@ -2883,13 +2883,11 @@ FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const { |
} |
CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, |
- const FX_WCHAR* text, |
+ const CFX_WideString& sText, |
dsinclair
2016/09/08 13:00:11
ditto
Tom Sepez
2016/09/08 18:01:12
Others match this.
|
int32_t charset) { |
CPVT_WordPlace wp = place; |
if (m_pVT->IsValid()) { |
- CFX_WideString sText = text; |
- |
for (int32_t i = 0, sz = sText.GetLength(); i < sz; i++) { |
uint16_t word = sText[i]; |
switch (word) { |