Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: fpdfsdk/pdfwindow/PWL_Edit.cpp

Issue 2338553002: Stop converting widestring -> c_str -> widestring in several places. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Edit.h ('k') | fpdfsdk/pdfwindow/PWL_EditCtrl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_Edit.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index 1aa7b5eb5a6de841e721c0a786cdf55d3aec5f3c..c85993b9cbf482a5dd999110875ff07b1f3dd498 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -38,12 +38,10 @@ CFX_ByteString CPWL_Edit::GetClassName() const {
void CPWL_Edit::OnDestroy() {}
-void CPWL_Edit::SetText(const FX_WCHAR* csText) {
+void CPWL_Edit::SetText(const CFX_WideString& csText) {
CFX_WideString swText = csText;
-
if (HasFlag(PES_RICH)) {
CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText);
-
if (CXML_Element* pXML =
CXML_Element::Parse(sValue.c_str(), sValue.GetLength())) {
int32_t nCount = pXML->CountChildren();
@@ -74,7 +72,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) {
}
}
- m_pEdit->SetText(swText.c_str());
+ m_pEdit->SetText(swText);
}
void CPWL_Edit::RePosChildWnd() {
@@ -571,9 +569,9 @@ void CPWL_Edit::SetLimitChar(int32_t nLimitChar) {
m_pEdit->SetLimitChar(nLimitChar);
}
-void CPWL_Edit::ReplaceSel(const FX_WCHAR* csText) {
+void CPWL_Edit::ReplaceSel(const CFX_WideString& wsText) {
m_pEdit->Clear();
- m_pEdit->InsertText(csText, DEFAULT_CHARSET);
+ m_pEdit->InsertText(wsText, DEFAULT_CHARSET);
}
CFX_FloatRect CPWL_Edit::GetFocusRect() const {
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Edit.h ('k') | fpdfsdk/pdfwindow/PWL_EditCtrl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698