summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-27 12:44:20 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-27 20:00:37 +0000
commit5c500acc3380d96db0ab5e2e6c2bc448644992de (patch)
tree6d901f2a357095e00965165f94a0e1769f62d326 /fpdfsdk/cpdfsdk_widget.cpp
parentd59442b054072dabfcd5c9cb766e7b60c13a1e69 (diff)
downloadpdfium-5c500acc3380d96db0ab5e2e6c2bc448644992de.tar.xz
Return arrays where appropriate in fxfa.
Also, remove some default method arguments along the way. Change-Id: Ifbd157499881ed6a3777f3903dd7f0193753cf59 Reviewed-on: https://pdfium-review.googlesource.com/3219 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index d3000c6c06..2ffd170d8a 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -301,7 +301,7 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) {
for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++) {
int nIndex = pFormField->GetSelectedIndex(i);
- if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems())
+ if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false))
pWidgetAcc->SetItemState(nIndex, true, false, false, true);
}
break;
@@ -311,7 +311,7 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) {
for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++) {
int nIndex = pFormField->GetSelectedIndex(i);
- if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems())
+ if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false))
pWidgetAcc->SetItemState(nIndex, true, false, false, true);
}
pWidgetAcc->SetValue(pFormField->GetValue(), XFA_VALUEPICTURE_Edit);
@@ -430,9 +430,10 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView,
pFormField->ClearOptions(true);
if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) {
- for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(); i < sz; i++) {
+ for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz;
+ i++) {
CFX_WideString swText;
- pWidgetAcc->GetChoiceListItem(swText, i);
+ pWidgetAcc->GetChoiceListItem(swText, i, false);
pFormField->InsertOption(swText, i, true);
}
@@ -444,9 +445,10 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView,
pFormField->ClearOptions(false);
if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) {
- for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(); i < sz; i++) {
+ for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz;
+ i++) {
CFX_WideString swText;
- pWidgetAcc->GetChoiceListItem(swText, i);
+ pWidgetAcc->GetChoiceListItem(swText, i, false);
pFormField->InsertOption(swText, i, false);
}
@@ -642,7 +644,7 @@ bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const {
#ifdef PDF_ENABLE_XFA
if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) {
- if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems())
+ if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false))
return pWidgetAcc->GetItemState(nIndex);
return false;