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

Unified Diff: fpdfsdk/src/formfiller/FFL_ComboBox.cpp

Issue 1467653002: Replace |CPWL_ComboBox::operator CPWL_Edit()| with explicit method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month 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/include/pdfwindow/PWL_ComboBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_ComboBox.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index ddaa51921454d2a67ff5a0bf4816da38a5c872ea..858cc6285a7fe64550a0453d52223de13c72d7f5 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -137,8 +137,8 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
switch (type) {
case CPDF_AAction::KeyStroke:
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.bFieldFull = pEdit->IsTextFull();
int nSelStart = 0;
int nSelEnd = 0;
@@ -157,8 +157,8 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
break;
case CPDF_AAction::Validate:
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.sValue = pEdit->GetText();
}
}
@@ -179,8 +179,8 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView,
switch (type) {
case CPDF_AAction::KeyStroke:
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSel(fa.sChange.c_str());
}
@@ -210,10 +210,10 @@ void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView != NULL);
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
m_State.nIndex = pComboBox->GetSelect();
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) {
+ if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
pEdit->GetSel(m_State.nStart, m_State.nEnd);
m_State.sValue = pEdit->GetText();
}
@@ -224,11 +224,11 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView != NULL);
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE)) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, TRUE))) {
if (m_State.nIndex >= 0)
pComboBox->SetSelect(m_State.nIndex);
else {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) {
+ if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
pEdit->SetText(m_State.sValue.c_str());
pEdit->SetSel(m_State.nStart, m_State.nEnd);
}
« no previous file with comments | « fpdfsdk/include/pdfwindow/PWL_ComboBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698