diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 41 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 2 |
3 files changed, 25 insertions, 22 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index 9911370dfc..eb42ba60fc 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -39,6 +39,7 @@ #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/cxfa_ffwidgethandler.h" #include "xfa/fxfa/cxfa_widgetacc.h" +#include "xfa/fxfa/parser/cxfa_node.h" #endif // PDF_ENABLE_XFA namespace { @@ -204,18 +205,18 @@ bool CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) { XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT); - CXFA_WidgetAcc* pAcc; if ((eEventType == XFA_EVENT_Click || eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { if (CXFA_FFWidget* hGroupWidget = GetGroupMixXFAWidget()) { - pAcc = hGroupWidget->GetDataAcc(); - if (pXFAWidgetHandler->HasEvent(pAcc, eEventType)) + if (pXFAWidgetHandler->HasEvent(hGroupWidget->GetNode()->GetWidgetAcc(), + eEventType)) { return true; + } } } - pAcc = hWidget->GetDataAcc(); - return pXFAWidgetHandler->HasEvent(pAcc, eEventType); + return pXFAWidgetHandler->HasEvent(hWidget->GetNode()->GetWidgetAcc(), + eEventType); } bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, @@ -256,7 +257,7 @@ bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, if ((eEventType == XFA_EVENT_Click || eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { if (CXFA_FFWidget* hGroupWidget = GetGroupMixXFAWidget()) { - CXFA_WidgetAcc* pAcc = hGroupWidget->GetDataAcc(); + CXFA_WidgetAcc* pAcc = hGroupWidget->GetNode()->GetWidgetAcc(); param.m_pTarget = pAcc; if (pXFAWidgetHandler->ProcessEvent(pAcc, ¶m) != XFA_EVENTERROR_Success) { @@ -264,7 +265,7 @@ bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, } } } - CXFA_WidgetAcc* pAcc = hWidget->GetDataAcc(); + CXFA_WidgetAcc* pAcc = hWidget->GetNode()->GetWidgetAcc(); param.m_pTarget = pAcc; int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); @@ -279,7 +280,7 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) { if (!hWidget) return; - CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc(); + CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc(); if (!pWidgetAcc) return; @@ -360,7 +361,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, switch (pFormField->GetFieldType()) { case FIELDTYPE_CHECKBOX: { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { pFormField->CheckControl( pFormField->GetControlIndex(pFormControl), pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true); @@ -370,7 +371,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, case FIELDTYPE_RADIOBUTTON: { // TODO(weili): Check whether we need to handle checkbox and radio // button differently, otherwise, merge these two cases. - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { pFormField->CheckControl( pFormField->GetControlIndex(pFormControl), pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true); @@ -378,7 +379,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, break; } case FIELDTYPE_TEXTFIELD: { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { pFormField->SetValue(pWidgetAcc->GetValue(XFA_VALUEPICTURE_Display), true); } @@ -387,7 +388,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, case FIELDTYPE_LISTBOX: { pFormField->ClearSelection(false); - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { for (int i = 0, sz = pWidgetAcc->CountSelectedItems(); i < sz; i++) { int nIndex = pWidgetAcc->GetSelectedItem(i); @@ -401,7 +402,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, case FIELDTYPE_COMBOBOX: { pFormField->ClearSelection(false); - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { for (int i = 0, sz = pWidgetAcc->CountSelectedItems(); i < sz; i++) { int nIndex = pWidgetAcc->GetSelectedItem(i); @@ -428,7 +429,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, pFormField->ClearSelection(false); pFormField->ClearOptions(true); - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz; i++) { pFormField->InsertOption( @@ -441,7 +442,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, pFormField->ClearSelection(false); pFormField->ClearOptions(false); - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz; i++) { pFormField->InsertOption( @@ -591,7 +592,7 @@ float CPDFSDK_Widget::GetFontSize() const { int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const { #ifdef PDF_ENABLE_XFA if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { if (nIndex < pWidgetAcc->CountSelectedItems()) return pWidgetAcc->GetSelectedItem(nIndex); } @@ -604,7 +605,7 @@ int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const { #ifdef PDF_ENABLE_XFA WideString CPDFSDK_Widget::GetValue(bool bDisplay) const { if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { return pWidgetAcc->GetValue(bDisplay ? XFA_VALUEPICTURE_Display : XFA_VALUEPICTURE_Edit); } @@ -634,7 +635,7 @@ int CPDFSDK_Widget::CountOptions() const { bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const { #ifdef PDF_ENABLE_XFA if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) { + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) { if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false)) return pWidgetAcc->GetItemState(nIndex); @@ -654,7 +655,7 @@ int CPDFSDK_Widget::GetTopVisibleIndex() const { bool CPDFSDK_Widget::IsChecked() const { #ifdef PDF_ENABLE_XFA if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { - if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc()) + if (CXFA_WidgetAcc* pWidgetAcc = hWidget->GetNode()->GetWidgetAcc()) return pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On; } #endif // PDF_ENABLE_XFA @@ -982,7 +983,7 @@ bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, param.m_wsNewText.Insert(data.nSelStart, data.sChange[i]); param.m_wsPrevText = data.sValue; - CXFA_WidgetAcc* pAcc = hWidget->GetDataAcc(); + CXFA_WidgetAcc* pAcc = hWidget->GetNode()->GetWidgetAcc(); param.m_pTarget = pAcc; int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index c1ef2bdb23..897e16dfbf 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -20,6 +20,7 @@ #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/cxfa_ffwidgethandler.h" #include "xfa/fxfa/fxfa_basic.h" +#include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxgraphics/cxfa_graphics.h" CPDFSDK_XFAWidgetHandler::CPDFSDK_XFAWidgetHandler( @@ -81,7 +82,8 @@ CFX_FloatRect CPDFSDK_XFAWidgetHandler::GetViewBBox(CPDFSDK_PageView* pPageView, ASSERT(pAnnot); CFX_RectF rcBBox; - XFA_Element eType = pAnnot->GetXFAWidget()->GetDataAcc()->GetUIType(); + XFA_Element eType = + pAnnot->GetXFAWidget()->GetNode()->GetWidgetAcc()->GetUIType(); if (eType == XFA_Element::Signature) rcBBox = pAnnot->GetXFAWidget()->GetBBox(XFA_WidgetStatus_Visible, true); else diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index d3832ed0dc..8cf2cf09de 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -128,7 +128,7 @@ bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget, int t1; int t2; CFX_FloatRect rcAnchor = rtAnchor.ToFloatRect(); - int nRotate = hWidget->GetDataAcc()->GetNode()->GetRotate(); + int nRotate = hWidget->GetNode()->GetRotate(); switch (nRotate) { case 90: { t1 = (int)(pageViewRect.right - rcAnchor.right); |