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

Unified Diff: fpdfsdk/pdfwindow/PWL_ComboBox.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_ComboBox.h ('k') | fpdfsdk/pdfwindow/PWL_Edit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_ComboBox.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index ebeb6751a0d78bee99f57c82c51ed0306fdd9adb..c02b268d141d24b01e6023eecf633381d5c1e5f7 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -221,12 +221,12 @@ CFX_WideString CPWL_ComboBox::GetText() const {
return CFX_WideString();
}
-void CPWL_ComboBox::SetText(const FX_WCHAR* text) {
+void CPWL_ComboBox::SetText(const CFX_WideString& text) {
if (m_pEdit)
m_pEdit->SetText(text);
}
-void CPWL_ComboBox::AddString(const FX_WCHAR* str) {
+void CPWL_ComboBox::AddString(const CFX_WideString& str) {
if (m_pList)
m_pList->AddString(str);
}
@@ -239,30 +239,26 @@ void CPWL_ComboBox::SetSelect(int32_t nItemIndex) {
if (m_pList)
m_pList->Select(nItemIndex);
- m_pEdit->SetText(m_pList->GetText().c_str());
-
+ m_pEdit->SetText(m_pList->GetText());
m_nSelectItem = nItemIndex;
}
void CPWL_ComboBox::SetEditSel(int32_t nStartChar, int32_t nEndChar) {
- if (m_pEdit) {
+ if (m_pEdit)
m_pEdit->SetSel(nStartChar, nEndChar);
- }
}
void CPWL_ComboBox::GetEditSel(int32_t& nStartChar, int32_t& nEndChar) const {
nStartChar = -1;
nEndChar = -1;
- if (m_pEdit) {
+ if (m_pEdit)
m_pEdit->GetSel(nStartChar, nEndChar);
- }
}
void CPWL_ComboBox::Clear() {
- if (m_pEdit) {
+ if (m_pEdit)
m_pEdit->Clear();
- }
}
void CPWL_ComboBox::CreateChildWnd(const PWL_CREATEPARAM& cp) {
@@ -619,11 +615,9 @@ FX_BOOL CPWL_ComboBox::IsPopup() const {
}
void CPWL_ComboBox::SetSelectText() {
- CFX_WideString swText = m_pList->GetText();
m_pEdit->SelectAll();
- m_pEdit->ReplaceSel(m_pList->GetText().c_str());
+ m_pEdit->ReplaceSel(m_pList->GetText());
m_pEdit->SelectAll();
-
m_nSelectItem = m_pList->GetCurSel();
}
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_ComboBox.h ('k') | fpdfsdk/pdfwindow/PWL_Edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698