From 067990ccf96ae962392a2dbacbfd8348dc4c7676 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 13 Sep 2016 06:46:40 -0700 Subject: Stop converting widestring -> c_str -> widestring in several places. Avoids a needless alloc and copy. Review-Url: https://codereview.chromium.org/2338553002 --- fpdfsdk/pdfwindow/PWL_EditCtrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fpdfsdk/pdfwindow/PWL_EditCtrl.cpp') diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp index febf69e7d0..575fd39089 100644 --- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp @@ -464,8 +464,8 @@ FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const { return fFontSize; } -void CPWL_EditCtrl::SetText(const FX_WCHAR* csText) { - m_pEdit->SetText(csText); +void CPWL_EditCtrl::SetText(const CFX_WideString& wsText) { + m_pEdit->SetText(wsText); } void CPWL_EditCtrl::CopyText() {} @@ -476,9 +476,9 @@ void CPWL_EditCtrl::CutText() {} void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow) {} -void CPWL_EditCtrl::InsertText(const FX_WCHAR* csText) { +void CPWL_EditCtrl::InsertText(const CFX_WideString& wsText) { if (!IsReadOnly()) - m_pEdit->InsertText(csText, DEFAULT_CHARSET); + m_pEdit->InsertText(wsText, DEFAULT_CHARSET); } void CPWL_EditCtrl::InsertWord(uint16_t word, int32_t nCharset) { -- cgit v1.2.3