diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-23 11:21:48 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-23 11:21:48 -0800 |
commit | 9976672977d39fc5fe9df2b0110ed977d79609a8 (patch) | |
tree | 192a3238fa9587c77843812dc90f1884dc506689 /xfa | |
parent | d21cddaa7548584bfcebefe9a03e857fee3a846b (diff) | |
download | pdfium-9976672977d39fc5fe9df2b0110ed977d79609a8.tar.xz |
Remove uses of this->foo.
R=weili@chromium.org
Review URL: https://codereview.chromium.org/1722913002 .
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/src/fgas/src/font/fx_stdfontmgr.h | 6 | ||||
-rw-r--r-- | xfa/src/fwl/src/basewidget/fwl_caretimp.cpp | 7 | ||||
-rw-r--r-- | xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp | 2 | ||||
-rw-r--r-- | xfa/src/fwl/src/basewidget/fwl_editimp.cpp | 2 | ||||
-rw-r--r-- | xfa/src/fwl/src/basewidget/include/fwl_caretimp.h | 4 | ||||
-rw-r--r-- | xfa/src/fwl/src/lightwidget/listbox.cpp | 2 | ||||
-rw-r--r-- | xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp | 6 | ||||
-rw-r--r-- | xfa/src/fxfa/src/app/xfa_ffdocview.cpp | 10 | ||||
-rw-r--r-- | xfa/src/fxfa/src/app/xfa_fftextedit.cpp | 5 | ||||
-rw-r--r-- | xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp | 104 | ||||
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp | 14 | ||||
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_object_imp.cpp | 188 | ||||
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp | 4 |
13 files changed, 172 insertions, 182 deletions
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/src/font/fx_stdfontmgr.h index cdf07781da..42aea16a3a 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.h +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.h @@ -97,13 +97,13 @@ struct FX_FontDescriptorInfo { CFX_FontDescriptor* pFont; int32_t nPenalty; FX_BOOL operator>(const FX_FontDescriptorInfo& x) { - return this->nPenalty > x.nPenalty; + return nPenalty > x.nPenalty; }; FX_BOOL operator<(const FX_FontDescriptorInfo& x) { - return this->nPenalty < x.nPenalty; + return nPenalty < x.nPenalty; }; FX_BOOL operator==(const FX_FontDescriptorInfo& x) { - return this->nPenalty == x.nPenalty; + return nPenalty == x.nPenalty; }; }; typedef CFX_ArrayTemplate<FX_FontDescriptorInfo> CFX_FontDescriptorInfos; diff --git a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp index ddd3db38cf..62fb997a49 100644 --- a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp @@ -128,9 +128,10 @@ FX_BOOL CFWL_CaretImp::DrawCaretBK(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); return FWL_ERR_Succeeded; } -CFWL_CaretImp::CFWL_CaretTimer::CFWL_CaretTimer(CFWL_CaretImp* m_pCaret) { - this->m_pCaret = m_pCaret; -} + +CFWL_CaretImp::CFWL_CaretTimer::CFWL_CaretTimer(CFWL_CaretImp* pCaret) + : m_pCaret(pCaret) {} + int32_t CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer) { if (m_pCaret->GetStates() & FWL_STATE_CAT_HightLight) { m_pCaret->SetStates(FWL_STATE_CAT_HightLight, FALSE); diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp index 8161acd4c3..85e8416c76 100644 --- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp @@ -1324,7 +1324,7 @@ void CFWL_ComboBoxImp::DisForm_Layout() { FX_FLOAT borderWidth = 0; { borderWidth = FWL_PART_CMB_Border; } FX_FLOAT fBtn = *pFWidth; - if (!(this->GetStylesEx() & FWL_STYLEEXT_CMB_ReadOnly)) { + if (!(GetStylesEx() & FWL_STYLEEXT_CMB_ReadOnly)) { m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top + borderWidth, fBtn - borderWidth, m_rtClient.height - 2 * borderWidth); } diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp index ff3300b23b..0a5f6be6a5 100644 --- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp @@ -433,7 +433,7 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics, FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX; FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; CFX_WideString wsSpell; - this->GetText(wsSpell); + GetText(wsSpell); int32_t nContentLen = wsSpell.GetLength(); for (int i = 0; i < nContentLen; i++) { if (FX_EDIT_ISLATINWORD(wsSpell[i])) { diff --git a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h index 49a1e02613..867efe545c 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h @@ -40,10 +40,10 @@ class CFWL_CaretImp : public CFWL_WidgetImp { const CFX_Matrix* pMatrix); class CFWL_CaretTimer : public IFWL_Timer { public: - CFWL_CaretTimer(CFWL_CaretImp* m_pCaret); + explicit CFWL_CaretTimer(CFWL_CaretImp* pCaret); ~CFWL_CaretTimer() override {} int32_t Run(FWL_HTIMER hTimer) override; - CFWL_CaretImp* m_pCaret; + CFWL_CaretImp* const m_pCaret; }; CFWL_CaretTimer* m_pTimer; FWL_HTIMER m_hTimer; diff --git a/xfa/src/fwl/src/lightwidget/listbox.cpp b/xfa/src/fwl/src/lightwidget/listbox.cpp index eb212fadca..4e6f4b8a47 100644 --- a/xfa/src/fwl/src/lightwidget/listbox.cpp +++ b/xfa/src/fwl/src/lightwidget/listbox.cpp @@ -47,8 +47,6 @@ FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem) { static_cast<size_t>(nIndex) >= m_ListBoxDP.m_ItemArray.size()) { return FALSE; } - CFWL_ListItem* pDelItem = - reinterpret_cast<CFWL_ListItem*>(m_ListBoxDP.GetItem(m_pIface, nIndex)); int32_t iCount = m_ListBoxDP.CountItems(m_pIface); int32_t iSel = nIndex + 1; if (iSel >= iCount) { diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp index f99cac81f5..cbcc13e369 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp @@ -106,7 +106,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract( BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } if (other->IsZero()) { - return this->Clone(e); + return Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CFX_Int32Array smallerCoefficients; @@ -172,7 +172,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, return temp; } if (scalar == 1) { - return this->Clone(e); + return Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } int32_t size = m_coefficients.GetSize(); @@ -219,7 +219,7 @@ CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly* other, CBC_ReedSolomonGF256Poly* rsg1 = m_field->GetZero()->Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr<CBC_ReedSolomonGF256Poly> quotient(rsg1); - CBC_ReedSolomonGF256Poly* rsg2 = this->Clone(e); + CBC_ReedSolomonGF256Poly* rsg2 = Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr<CBC_ReedSolomonGF256Poly> remainder(rsg2); int32_t denominatorLeadingTerm = other->GetCoefficients(other->GetDegree()); diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp index 2ad07dbcac..1687da43dc 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp @@ -176,16 +176,16 @@ void CXFA_FFDocView::UpdateDocView() { ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, TRUE); } m_NewAddedNodes.RemoveAll(); - this->RunSubformIndexChange(); - this->RunCalculateWidgets(); - this->RunValidate(); + RunSubformIndexChange(); + RunCalculateWidgets(); + RunValidate(); ShowNullTestMsg(); if (RunLayout() && m_bLayoutEvent) { RunEventLayoutReady(); } m_bLayoutEvent = FALSE; m_CalculateAccs.RemoveAll(); - this->RunInvalidate(); + RunInvalidate(); UnlockUpdate(); } int32_t CXFA_FFDocView::CountPageViews() { @@ -622,7 +622,7 @@ void CXFA_FFDocView::RunSubformIndexChange() { } void CXFA_FFDocView::AddNewFormNode(CXFA_Node* pNode) { m_NewAddedNodes.Add(pNode); - this->InitLayout(pNode); + InitLayout(pNode); } void CXFA_FFDocView::AddIndexChangedSubform(CXFA_Node* pNode) { FXSYS_assert(pNode->GetClassID() == XFA_ELEMENT_Subform); diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp index 2e84c39e6a..f315b46911 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp @@ -181,7 +181,7 @@ FX_BOOL CXFA_FFTextEdit::CommitData() { return FALSE; } void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { - CXFA_WidgetAcc* pAcc = this->GetDataAcc(); + CXFA_WidgetAcc* pAcc = GetDataAcc(); if (pAcc && pAcc->GetUIType() == XFA_ELEMENT_NumericEdit) { IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider(); if (pAppProvider) { @@ -777,8 +777,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget, int32_t iDay) { CFX_WideString wsPicture; m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit); - CXFA_LocaleValue date(XFA_VT_DATE, - this->GetDoc()->GetXFADoc()->GetLocalMgr()); + CXFA_LocaleValue date(XFA_VT_DATE, GetDoc()->GetXFADoc()->GetLocalMgr()); CFX_Unitime dt; dt.Set(iYear, iMonth, iDay); date.SetDate(dt); diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp index 8a6aab2692..887535a2a8 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp @@ -237,7 +237,7 @@ void CXFA_WidgetAcc::ResetData() { CXFA_Value defValue(NULL); if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { defValue.GetChildValueContent(wsValue); - this->SetValue(wsValue, XFA_VALUEPICTURE_Raw); + SetValue(wsValue, XFA_VALUEPICTURE_Raw); pAcc->SetValue(wsValue, XFA_VALUEPICTURE_Raw); } else { CXFA_Node* pItems = pChild->GetChild(0, XFA_ELEMENT_Items); @@ -273,7 +273,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideStringC& wsContentType, image.SetHref(wsHref); } CFX_WideString wsFormatValue(wsData); - this->GetFormatDataValue(wsData, wsFormatValue); + GetFormatDataValue(wsData, wsFormatValue); m_pNode->SetContent(wsData, wsFormatValue, TRUE); CXFA_Node* pBind = GetDatasets(); if (!pBind) { @@ -312,7 +312,7 @@ IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() { } int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam) { - if (this->GetClassID() == XFA_ELEMENT_Draw) { + if (GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; } int32_t iRet = XFA_EVENTERROR_NotExist; @@ -354,14 +354,14 @@ int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, return XFA_EVENTERROR_NotExist; } int32_t CXFA_WidgetAcc::ProcessCalculate() { - if (this->GetClassID() == XFA_ELEMENT_Draw) { + if (GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; } - CXFA_Calculate calc = this->GetCalculate(); + CXFA_Calculate calc = GetCalculate(); if (!calc) { return XFA_EVENTERROR_NotExist; } - if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { + if (GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { return XFA_EVENTERROR_Disabled; } CXFA_EventParam EventParam; @@ -397,7 +397,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, validate.GetScriptMessageText(wsScriptMsg); int32_t eScriptTest = validate.GetScriptTest(); if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) { - if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { + if (GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { return; } if (wsScriptMsg.IsEmpty()) { @@ -410,7 +410,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, } if (pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { - this->GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); + GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } } else { if (wsScriptMsg.IsEmpty()) { @@ -452,7 +452,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK); return XFA_EVENTERROR_Sucess; } - if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { + if (GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { return XFA_EVENTERROR_NotExist; } if (wsFormatMsg.IsEmpty()) { @@ -465,7 +465,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, } if (pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { - this->GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); + GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } return XFA_EVENTERROR_Sucess; } @@ -476,11 +476,11 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, FX_BOOL bVersionFlag) { CFX_WideString wsValue; - this->GetValue(wsValue, XFA_VALUEPICTURE_Raw); + GetValue(wsValue, XFA_VALUEPICTURE_Raw); if (!wsValue.IsEmpty()) { return XFA_EVENTERROR_Sucess; } - if (this->m_bIsNull && (this->m_bPreNull == this->m_bIsNull)) { + if (m_bIsNull && (m_bPreNull == m_bIsNull)) { return XFA_EVENTERROR_Sucess; } int32_t eNullTest = validate.GetNullTest(); @@ -523,7 +523,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, return XFA_EVENTERROR_Error; } case XFA_ATTRIBUTEENUM_Warning: { - if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { + if (GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { return TRUE; } if (wsNullMsg.IsEmpty()) { @@ -535,7 +535,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, } if (pAppProvider->MsgBox(wsNullMsg, wsTitle, XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { - this->GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); + GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } return XFA_EVENTERROR_Error; } @@ -586,10 +586,10 @@ void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider, (const FX_WCHAR*)wsCaptionName); } int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { - if (this->GetClassID() == XFA_ELEMENT_Draw) { + if (GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; } - CXFA_Validate validate = this->GetValidate(); + CXFA_Validate validate = GetValidate(); if (!validate) { return XFA_EVENTERROR_NotExist; } @@ -604,10 +604,10 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Validate; eParam.m_pTarget = this; - iRet = ExecuteScript( - script, &eParam, - ((bInitDoc || bStatus) && this->GetRawValue().IsEmpty()) ? NULL - : &pRetValue); + iRet = ExecuteScript(script, &eParam, + ((bInitDoc || bStatus) && GetRawValue().IsEmpty()) + ? nullptr + : &pRetValue); } XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode(); FX_BOOL bVersionFlag = FALSE; @@ -729,7 +729,7 @@ CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { } void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { CXFA_FFWidget* pWidget = NULL; - while ((pWidget = this->GetNextWidget(pWidget)) != NULL) { + while ((pWidget = GetNextWidget(pWidget))) { if (pWidget == pExcept || !pWidget->IsLoaded() || (GetUIType() != XFA_ELEMENT_CheckButton && pWidget->IsFocused())) { continue; @@ -758,7 +758,7 @@ void CXFA_WidgetAcc::NotifyEvent(FX_DWORD dwEvent, } } void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { - CXFA_Caption caption = this->GetCaption(); + CXFA_Caption caption = GetCaption(); if (!caption || caption.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { return; } @@ -819,7 +819,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { size.x += rtUIMargin.left + rtUIMargin.width; size.y += rtUIMargin.top + rtUIMargin.height; if (szCap.x > 0 && szCap.y > 0) { - int32_t iCapPlacement = this->GetCaption().GetPlacementType(); + int32_t iCapPlacement = GetCaption().GetPlacementType(); switch (iCapPlacement) { case XFA_ATTRIBUTEENUM_Left: case XFA_ATTRIBUTEENUM_Right: @@ -839,7 +839,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { return CalculateWidgetAutoSize(size); } FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset; mgWidget.GetLeftInset(fLeftInset); @@ -849,30 +849,30 @@ FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { size.x += fLeftInset + fRightInset; size.y += fTopInset + fBottomInset; } - CXFA_Para para = this->GetPara(); + CXFA_Para para = GetPara(); if (para) { size.x += para.GetMarginLeft(); size.x += para.GetTextIndent(); } FX_FLOAT fVal = 0, fMin = 0, fMax = 0; - if (this->GetWidth(fVal)) { + if (GetWidth(fVal)) { size.x = fVal; } else { - if (this->GetMinWidth(fMin)) { + if (GetMinWidth(fMin)) { size.x = std::max(size.x, fMin); } - if (this->GetMaxWidth(fMax) && fMax > 0) { + if (GetMaxWidth(fMax) && fMax > 0) { size.x = std::min(size.x, fMax); } } fVal = 0, fMin = 0, fMax = 0; - if (this->GetHeight(fVal)) { + if (GetHeight(fVal)) { size.y = fVal; } else { - if (this->GetMinHeight(fMin)) { + if (GetMinHeight(fMin)) { size.y = std::max(size.y, fMin); } - if (this->GetMaxHeight(fMax) && fMax > 0) { + if (GetMaxHeight(fMax) && fMax > 0) { size.y = std::min(size.y, fMax); } } @@ -881,7 +881,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) { FX_FLOAT fFontSize = GetFontSize(); CFX_WideString wsText; - this->GetValue(wsText, XFA_VALUEPICTURE_Display); + GetValue(wsText, XFA_VALUEPICTURE_Display); if (wsText.IsEmpty()) { size.y += fFontSize; return; @@ -916,7 +916,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01; int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; if (bCapExit) { - iCapPlacement = this->GetCaption().GetPlacementType(); + iCapPlacement = GetCaption().GetPlacementType(); switch (iCapPlacement) { case XFA_ATTRIBUTEENUM_Left: case XFA_ATTRIBUTEENUM_Right: @@ -930,7 +930,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { CFX_RectF rtUIMargin; GetUIMargin(rtUIMargin); size.x -= rtUIMargin.left + rtUIMargin.width; - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fLeftInset, fRightInset; mgWidget.GetLeftInset(fLeftInset); @@ -961,7 +961,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { return CalculateFieldAutoSize(size); } FX_BOOL CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) { - FX_FLOAT fCheckSize = this->GetCheckButtonSize(); + FX_FLOAT fCheckSize = GetCheckButtonSize(); size.x = size.y = fCheckSize; return CalculateFieldAutoSize(size); } @@ -1062,7 +1062,7 @@ void CXFA_WidgetAcc::LoadText() { ((CXFA_TextLayoutData*)m_pLayoutData)->LoadText(this); } FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fLeftInset, fRightInset; mgWidget.GetLeftInset(fLeftInset); @@ -1070,16 +1070,16 @@ FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc) { fWidthCalc += fLeftInset + fRightInset; } FX_FLOAT fMin = 0, fMax = 0; - if (this->GetMinWidth(fMin)) { + if (GetMinWidth(fMin)) { fWidthCalc = std::max(fWidthCalc, fMin); } - if (this->GetMaxWidth(fMax) && fMax > 0) { + if (GetMaxWidth(fMax) && fMax > 0) { fWidthCalc = std::min(fWidthCalc, fMax); } return fWidthCalc; } FX_FLOAT CXFA_WidgetAcc::GetWidthWithoutMargin(FX_FLOAT fWidthCalc) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fLeftInset, fRightInset; mgWidget.GetLeftInset(fLeftInset); @@ -1089,7 +1089,7 @@ FX_FLOAT CXFA_WidgetAcc::GetWidthWithoutMargin(FX_FLOAT fWidthCalc) { return fWidthCalc; } FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fTopInset, fBottomInset; mgWidget.GetTopInset(fTopInset); @@ -1097,16 +1097,16 @@ FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc) { fHeightCalc += fTopInset + fBottomInset; } FX_FLOAT fMin = 0, fMax = 0; - if (this->GetMinHeight(fMin)) { + if (GetMinHeight(fMin)) { fHeightCalc = std::max(fHeightCalc, fMin); } - if (this->GetMaxHeight(fMax) && fMax > 0) { + if (GetMaxHeight(fMax) && fMax > 0) { fHeightCalc = std::min(fHeightCalc, fMax); } return fHeightCalc; } FX_FLOAT CXFA_WidgetAcc::GetHeightWithoutMargin(FX_FLOAT fHeightCalc) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fTopInset, fBottomInset; mgWidget.GetTopInset(fTopInset); @@ -1203,13 +1203,13 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT fTopInset = 0; FX_FLOAT fBottomInset = 0; if (iBlockIndex == 0) { - CXFA_Margin mgWidget = this->GetMargin(); + CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { mgWidget.GetTopInset(fTopInset); mgWidget.GetBottomInset(fBottomInset); } CFX_RectF rtUIMargin; - this->GetUIMargin(rtUIMargin); + GetUIMargin(rtUIMargin); fTopInset += rtUIMargin.top; fBottomInset += rtUIMargin.width; } @@ -1260,7 +1260,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, int32_t iLinesCount = 0; FX_FLOAT fHeight = m_pLayoutData->m_fWidgetHeight; CFX_WideString wsText; - this->GetValue(wsText, XFA_VALUEPICTURE_Display); + GetValue(wsText, XFA_VALUEPICTURE_Display); if (wsText.IsEmpty()) { iLinesCount = 1; } else { @@ -1294,7 +1294,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, if (fHeight > 0.1f && iBlockIndex == 0) { fStartOffset = fTopInset; fHeight -= (fTopInset + fBottomInset); - if (CXFA_Para para = this->GetPara()) { + if (CXFA_Para para = GetPara()) { fSpaceAbove = para.GetSpaceAbove(); FX_FLOAT fSpaceBelow = para.GetSpaceBelow(); fHeight -= (fSpaceAbove + fSpaceBelow); @@ -1328,7 +1328,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode(); FX_BOOL bCanSplitNoContent = FALSE; XFA_ATTRIBUTEENUM eLayoutMode; - this->GetNode() + GetNode() ->GetNodeItem(XFA_NODEITEM_Parent) ->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, TRUE); if ((eLayoutMode == XFA_ATTRIBUTEENUM_Position || @@ -1537,7 +1537,7 @@ CXFA_WidgetLayoutData* CXFA_WidgetAcc::GetWidgetLayoutData() { IFX_Font* CXFA_WidgetAcc::GetFDEFont() { CFX_WideStringC wsFontName = FX_WSTRC(L"Courier"); FX_DWORD dwFontStyle = 0; - if (CXFA_Font font = this->GetFont()) { + if (CXFA_Font font = GetFont()) { if (font.IsBold()) { dwFontStyle |= FX_FONTSTYLE_Bold; } @@ -1552,14 +1552,14 @@ IFX_Font* CXFA_WidgetAcc::GetFDEFont() { } FX_FLOAT CXFA_WidgetAcc::GetFontSize() { FX_FLOAT fFontSize = 10.0f; - if (CXFA_Font font = this->GetFont()) { + if (CXFA_Font font = GetFont()) { fFontSize = font.GetFontSize(); } return fFontSize < 0.1f ? 10.0f : fFontSize; } FX_FLOAT CXFA_WidgetAcc::GetLineHeight() { FX_FLOAT fLineHeight = 0; - if (CXFA_Para para = this->GetPara()) { + if (CXFA_Para para = GetPara()) { fLineHeight = para.GetLineHeight(); } if (fLineHeight < 1) { @@ -1568,7 +1568,7 @@ FX_FLOAT CXFA_WidgetAcc::GetLineHeight() { return fLineHeight; } FX_ARGB CXFA_WidgetAcc::GetTextColor() { - if (CXFA_Font font = this->GetFont()) { + if (CXFA_Font font = GetFont()) { return font.GetColor(); } return 0xFF000000; diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp index 4dbfcbc2a9..3f5e47d214 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp @@ -828,8 +828,8 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, !wsOverflowTarget.IsEmpty()) { if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { - CXFA_Node* pTarget = XFA_ResolveBreakTarget( - this->m_pTemplatePageSetRoot, TRUE, wsOverflowTarget); + CXFA_Node* pTarget = XFA_ResolveBreakTarget(m_pTemplatePageSetRoot, + TRUE, wsOverflowTarget); if (pTarget) { m_bCreateOverFlowPage = TRUE; switch (pTarget->GetClassID()) { @@ -861,8 +861,8 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, pOverflowNode->TryCData(XFA_ATTRIBUTE_Trailer, wsOverflowTrailer); pOverflowNode->TryCData(XFA_ATTRIBUTE_Target, wsOverflowTarget); if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { - CXFA_Node* pTarget = XFA_ResolveBreakTarget(this->m_pTemplatePageSetRoot, - TRUE, wsOverflowTarget); + CXFA_Node* pTarget = XFA_ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, + wsOverflowTarget); if (pTarget) { m_bCreateOverFlowPage = TRUE; switch (pTarget->GetClassID()) { @@ -1629,7 +1629,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { CXFA_Document* pDocument = m_pTemplatePageSetRoot->GetDocument(); IXFA_Notify* pNotify = pDocument->GetParser()->GetNotify(); IXFA_DocLayout* pDocLayout = pDocument->GetDocLayout(); - CXFA_ContainerLayoutItem* pRootLayout = this->GetRootLayoutItem(); + CXFA_ContainerLayoutItem* pRootLayout = GetRootLayoutItem(); { for (int32_t iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); iIndex++) { @@ -1817,7 +1817,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { } } void CXFA_LayoutPageMgr::LayoutPageSetContents() { - CXFA_ContainerLayoutItem* pRootLayoutItem = this->GetRootLayoutItem(); + CXFA_ContainerLayoutItem* pRootLayoutItem = GetRootLayoutItem(); for (; pRootLayoutItem; pRootLayoutItem = (CXFA_ContainerLayoutItem*)pRootLayoutItem->m_pNextSibling) { @@ -1877,7 +1877,7 @@ void CXFA_LayoutPageMgr::SyncLayoutData() { IXFA_Notify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify(); int32_t nPageIdx = -1; - CXFA_ContainerLayoutItem* pRootLayoutItem = this->GetRootLayoutItem(); + CXFA_ContainerLayoutItem* pRootLayoutItem = GetRootLayoutItem(); for (; pRootLayoutItem; pRootLayoutItem = (CXFA_ContainerLayoutItem*)pRootLayoutItem->m_pNextSibling) { diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index a4fd017c52..9662c1debf 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -120,9 +120,9 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { IFDE_XMLNode* pCloneXML = NULL; if (IsAttributeInXML()) { CFX_WideString wsName; - this->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); + GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); IFDE_XMLElement* pCloneXMLElement = IFDE_XMLElement::Create(wsName); - CFX_WideStringC wsValue = this->GetCData(XFA_ATTRIBUTE_Value); + CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { pCloneXMLElement->SetTextData(wsValue); } @@ -424,7 +424,7 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() { return NULL; } if (classID == XFA_ELEMENT_Field) { - CXFA_WidgetData* pFieldWidgetData = this->GetWidgetData(); + CXFA_WidgetData* pFieldWidgetData = GetWidgetData(); if (pFieldWidgetData && pFieldWidgetData->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { @@ -438,7 +438,7 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() { if (!wsPicture.IsEmpty()) { return pFieldWidgetData; } - CXFA_Node* pDataNode = this->GetBindData(); + CXFA_Node* pDataNode = GetBindData(); if (!pDataNode) { return NULL; } @@ -568,7 +568,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { } break; case XFA_ELEMENT_Field: { - CXFA_Node* pParentNode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); if (!pParentNode || pParentNode->GetClassID() == XFA_ELEMENT_PageArea) { return XFA_ATTRIBUTEENUM_ContentArea; } @@ -583,7 +583,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { XFA_VERSION version = m_pDocument->GetCurVersionMode(); if (eParLayout == XFA_ATTRIBUTEENUM_Tb && version < XFA_VERSION_208) { CXFA_Measurement measureH; - if (this->TryMeasure(XFA_ATTRIBUTE_H, measureH, FALSE)) { + if (TryMeasure(XFA_ATTRIBUTE_H, measureH, FALSE)) { return XFA_ATTRIBUTEENUM_ContentArea; } } @@ -752,7 +752,7 @@ void CXFA_Node::Script_TreeClass_ClassAll(FXJSE_HVALUE hValue, } else { FX_DWORD dwFlag = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_ALL; CFX_WideStringC wsName; - this->GetClassName(wsName); + GetClassName(wsName); CFX_WideString wsExpression = FX_WSTRC(L"#") + wsName + FX_WSTRC(L"[*]"); Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag); } @@ -763,7 +763,7 @@ void CXFA_Node::Script_TreeClass_Parent(FXJSE_HVALUE hValue, if (bSetting) { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { - CXFA_Node* pParent = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pParent = GetNodeItem(XFA_NODEITEM_Parent); if (pParent) { FXJSE_Value_Set( hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(pParent)); @@ -842,7 +842,7 @@ void CXFA_Node::Script_NodeClass_Clone(CFXJSE_Arguments* pArguments) { } FX_BOOL bClone = TRUE; bClone = pArguments->GetInt32(0) == 0 ? FALSE : TRUE; - CXFA_Node* pCloneNode = this->Clone(bClone); + CXFA_Node* pCloneNode = Clone(bClone); FXJSE_Value_Set( pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pCloneNode)); @@ -859,7 +859,7 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) { wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); CFX_WideString wsValue; - this->GetAttribute(wsExpression, wsValue); + GetAttribute(wsExpression, wsValue); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue)); @@ -882,7 +882,7 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) { iValue = pArguments->GetInt32(1); } const XFA_ELEMENTINFO* pElementInfo = XFA_GetElementByName(wsExpression); - CXFA_Node* pNode = this->GetProperty(iValue, pElementInfo->eName); + CXFA_Node* pNode = GetProperty(iValue, pElementInfo->eName); FXJSE_Value_Set(pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pNode)); } @@ -913,11 +913,11 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified( XFA_GetAttributeByName(wsExpression); CFX_WideString wsValue; if (pAttributeInfo) { - bHas = this->HasAttribute(pAttributeInfo->eName); + bHas = HasAttribute(pAttributeInfo->eName); } if (!bHas) { const XFA_ELEMENTINFO* pElementInfo = XFA_GetElementByName(wsExpression); - bHas = (this->GetProperty(iIndex, pElementInfo->eName) != NULL); + bHas = (GetProperty(iIndex, pElementInfo->eName) != NULL); } FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -962,19 +962,19 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { XFA_RecognizeRichText((IFDE_XMLElement*)pXMLNode))) { bIgnoreRoot = FALSE; } - CXFA_Node* pFakeRoot = this->Clone(FALSE); - CFX_WideStringC wsContentType = this->GetCData(XFA_ATTRIBUTE_ContentType); + CXFA_Node* pFakeRoot = Clone(FALSE); + CFX_WideStringC wsContentType = GetCData(XFA_ATTRIBUTE_ContentType); if (!wsContentType.IsEmpty()) { pFakeRoot->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); } IFDE_XMLNode* pFakeXMLRoot = pFakeRoot->GetXMLMappingNode(); if (!pFakeXMLRoot) { - IFDE_XMLNode* pThisXMLRoot = this->GetXMLMappingNode(); + IFDE_XMLNode* pThisXMLRoot = GetXMLMappingNode(); pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(FALSE) : NULL; } if (!pFakeXMLRoot) { CFX_WideStringC wsClassName; - this->GetClassName(wsClassName); + GetClassName(wsClassName); pFakeXMLRoot = IFDE_XMLElement::Create(wsClassName); } if (bIgnoreRoot) { @@ -997,27 +997,27 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { pFakeRoot = pParser->GetRootNode(); if (pFakeRoot) { if (bOverwrite) { - CXFA_Node* pChild = this->GetNodeItem(XFA_NODEITEM_FirstChild); + CXFA_Node* pChild = GetNodeItem(XFA_NODEITEM_FirstChild); CXFA_Node* pNewChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild); int32_t index = 0; while (pNewChild) { CXFA_Node* pItem = pNewChild->GetNodeItem(XFA_NODEITEM_NextSibling); pFakeRoot->RemoveChild(pNewChild); - this->InsertChild(index++, pNewChild); + InsertChild(index++, pNewChild); pNewChild->SetFlag(XFA_NODEFLAG_Initialized); pNewChild = pItem; } while (pChild) { CXFA_Node* pItem = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); - this->RemoveChild(pChild); + RemoveChild(pChild); pFakeRoot->InsertChild(pChild); pChild = pItem; } if (GetPacketID() == XFA_XDPPACKET_Form && GetClassID() == XFA_ELEMENT_ExData) { - IFDE_XMLNode* pTempXMLNode = this->GetXMLMappingNode(); - this->SetXMLMappingNode(pFakeXMLRoot); - this->SetFlag(XFA_NODEFLAG_OwnXMLNode, TRUE, FALSE); + IFDE_XMLNode* pTempXMLNode = GetXMLMappingNode(); + SetXMLMappingNode(pFakeXMLRoot); + SetFlag(XFA_NODEFLAG_OwnXMLNode, TRUE, FALSE); if (pTempXMLNode && pTempXMLNode->GetNodeItem(IFDE_XMLNode::Parent) == NULL) { pFakeXMLRoot = pTempXMLNode; @@ -1031,7 +1031,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { while (pChild) { CXFA_Node* pItem = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); pFakeRoot->RemoveChild(pChild); - this->InsertChild(pChild); + InsertChild(pChild); pChild->SetFlag(XFA_NODEFLAG_Initialized); pChild = pItem; } @@ -1095,7 +1095,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { return; } if (GetPacketID() == XFA_XDPPACKET_Datasets) { - IFDE_XMLNode* pElement = this->GetXMLMappingNode(); + IFDE_XMLNode* pElement = GetXMLMappingNode(); if (!pElement || pElement->GetType() != FDE_XMLNODE_Element) { FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), bsXMLHeader); return; @@ -1138,7 +1138,7 @@ void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) { wsAttributeValue = CFX_WideString::FromUTF8(bsAttributeValue, bsAttributeValue.GetLength()); wsAttribute = CFX_WideString::FromUTF8(bsAttribute, bsAttribute.GetLength()); - this->SetAttribute(wsAttribute, wsAttributeValue, TRUE); + SetAttribute(wsAttribute, wsAttributeValue, TRUE); } void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); @@ -1163,7 +1163,7 @@ void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue, ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { CFX_WideString wsNameSpace; - this->TryNamespace(wsNameSpace); + TryNamespace(wsNameSpace); FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsNameSpace)); } } @@ -1174,7 +1174,7 @@ void CXFA_Node::Script_NodeClass_Model(FXJSE_HVALUE hValue, ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { FXJSE_Value_Set(hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap( - this->GetModelNode())); + GetModelNode())); } } void CXFA_Node::Script_NodeClass_IsContainer(FXJSE_HVALUE hValue, @@ -1183,7 +1183,7 @@ void CXFA_Node::Script_NodeClass_IsContainer(FXJSE_HVALUE hValue, if (bSetting) { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { - FXJSE_Value_SetBoolean(hValue, this->IsContainerNode()); + FXJSE_Value_SetBoolean(hValue, IsContainerNode()); } } void CXFA_Node::Script_NodeClass_IsNull(FXJSE_HVALUE hValue, @@ -1192,7 +1192,7 @@ void CXFA_Node::Script_NodeClass_IsNull(FXJSE_HVALUE hValue, if (bSetting) { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { - if (this->GetClassID() == XFA_ELEMENT_Subform) { + if (GetClassID() == XFA_ELEMENT_Subform) { FXJSE_Value_SetBoolean(hValue, FALSE); return; } @@ -1207,7 +1207,7 @@ void CXFA_Node::Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue, ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { CXFA_NodeArray properts; - int32_t iSize = this->GetNodeList(properts, XFA_NODEFILTER_OneOfProperty); + int32_t iSize = GetNodeList(properts, XFA_NODEFILTER_OneOfProperty); if (iSize > 0) { FXJSE_Value_Set( hValue, @@ -1240,7 +1240,7 @@ void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) { CFX_WideString::FromUTF8(bsNameSpace, bsNameSpace.GetLength()); } CFX_WideString wsNodeNameSpace; - this->TryNamespace(wsNodeNameSpace); + TryNamespace(wsNodeNameSpace); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetBoolean(hValue, wsNodeNameSpace.Equal(wsNameSpace)); @@ -1300,21 +1300,20 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( if (!pNotify) { return; } - FX_DWORD dwPacket = this->GetPacketID(); + FX_DWORD dwPacket = GetPacketID(); if (dwPacket & XFA_XDPPACKET_Form) { FX_BOOL bNeedFindContainer = FALSE; - XFA_ELEMENT eType = this->GetClassID(); + XFA_ELEMENT eType = GetClassID(); switch (eType) { case XFA_ELEMENT_Caption: bNeedFindContainer = TRUE; pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanged, eAttribute, - eValue, this, - this->GetNodeItem(XFA_NODEITEM_Parent)); + eValue, this, GetNodeItem(XFA_NODEITEM_Parent)); break; case XFA_ELEMENT_Font: case XFA_ELEMENT_Para: { bNeedFindContainer = TRUE; - CXFA_Node* pParentNode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); if (pParentNode->GetClassID() == XFA_ELEMENT_Caption) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanged, eAttribute, eValue, pParentNode, @@ -1326,7 +1325,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( } break; case XFA_ELEMENT_Margin: { bNeedFindContainer = TRUE; - CXFA_Node* pParentNode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); XFA_ELEMENT eParentType = pParentNode->GetClassID(); if (pParentNode->IsContainerNode()) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanged, eAttribute, @@ -1345,7 +1344,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( } } break; case XFA_ELEMENT_Comb: { - CXFA_Node* pEditNode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pEditNode = GetNodeItem(XFA_NODEITEM_Parent); XFA_ELEMENT eUIType = pEditNode->GetClassID(); if (pEditNode && (eUIType == XFA_ELEMENT_DateTimeEdit || eUIType == XFA_ELEMENT_NumericEdit || @@ -1365,7 +1364,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( case XFA_ELEMENT_NumericEdit: case XFA_ELEMENT_PasswordEdit: case XFA_ELEMENT_TextEdit: { - CXFA_Node* pUINode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pUINode = GetNodeItem(XFA_NODEITEM_Parent); if (pUINode) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanged, eAttribute, eValue, pUINode, @@ -1374,7 +1373,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( } break; case XFA_ELEMENT_CheckButton: { bNeedFindContainer = TRUE; - CXFA_Node* pUINode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pUINode = GetNodeItem(XFA_NODEITEM_Parent); if (pUINode) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanged, eAttribute, eValue, pUINode, @@ -1402,7 +1401,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( case XFA_ELEMENT_Sharptext: case XFA_ELEMENT_Sharpxml: case XFA_ELEMENT_SharpxHTML: { - CXFA_Node* pTextNode = this->GetNodeItem(XFA_NODEITEM_Parent); + CXFA_Node* pTextNode = GetNodeItem(XFA_NODEITEM_Parent); if (!pTextNode) { return; } @@ -1464,8 +1463,7 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue, szValue.GetLength()); SetAttribute(eAttribute, wsValue, TRUE); - if (eAttribute == XFA_ATTRIBUTE_Use && - this->GetClassID() == XFA_ELEMENT_Desc) { + if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) { CFX_WideString wsUseVal = wsValue, wsID, wsSOM; CXFA_Node* pTemplateNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Template)); @@ -1661,7 +1659,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, CXFA_WidgetData* pContainerWidgetData = NULL; if (GetPacketID() == XFA_XDPPACKET_Datasets) { CXFA_NodeArray formNodes; - this->GetBindItems(formNodes); + GetBindItems(formNodes); CFX_WideString wsPicture; for (int32_t i = 0; i < formNodes.GetSize(); i++) { CXFA_Node* pFormNode = formNodes.GetAt(i); @@ -2552,7 +2550,7 @@ void CXFA_Node::Script_Subform_InstanceManager(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { - CFX_WideStringC wsName = this->GetCData(XFA_ATTRIBUTE_Name); + CFX_WideStringC wsName = GetCData(XFA_ATTRIBUTE_Name); CXFA_Node* pInstanceMgr = NULL; for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { @@ -2582,10 +2580,9 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsLocaleName; FXJSE_Value_ToUTF8String(hValue, bsLocaleName); - this->SetCData( - XFA_ATTRIBUTE_Locale, - CFX_WideString::FromUTF8(bsLocaleName, bsLocaleName.GetLength()), TRUE, - TRUE); + SetCData(XFA_ATTRIBUTE_Locale, + CFX_WideString::FromUTF8(bsLocaleName, bsLocaleName.GetLength()), + TRUE, TRUE); } else { CFX_WideString wsLocaleName; GetLocaleName(wsLocaleName); @@ -3286,7 +3283,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { return 0; } if (iDesired < iCount) { - CFX_WideStringC wsInstManagerName = this->GetCData(XFA_ATTRIBUTE_Name); + CFX_WideStringC wsInstManagerName = GetCData(XFA_ATTRIBUTE_Name); CFX_WideString wsInstanceName = wsInstManagerName.IsEmpty() ? wsInstManagerName : wsInstManagerName.Mid(1); @@ -3974,7 +3971,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, FX_BOOL bDeleteChildren = TRUE; if (GetPacketID() == XFA_XDPPACKET_Datasets) { for (CXFA_Node* pChildDataNode = - this->GetNodeItem(XFA_NODEITEM_FirstChild); + GetNodeItem(XFA_NODEITEM_FirstChild); pChildDataNode; pChildDataNode = pChildDataNode->GetNodeItem( XFA_NODEITEM_NextSibling)) { CXFA_NodeArray formNodes; @@ -4034,7 +4031,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, FX_BOOL bDeleteChildren = TRUE; if (GetPacketID() == XFA_XDPPACKET_Datasets) { for (CXFA_Node* pChildDataNode = - this->GetNodeItem(XFA_NODEITEM_FirstChild); + GetNodeItem(XFA_NODEITEM_FirstChild); pChildDataNode; pChildDataNode = pChildDataNode->GetNodeItem( XFA_NODEITEM_NextSibling)) { CXFA_NodeArray formNodes; @@ -4491,27 +4488,27 @@ CXFA_Node* CXFA_Node::GetModelNode() { } FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { wsNamespace.Empty(); - if (this->GetObjectType() == XFA_OBJECTTYPE_ModelNode || - this->GetClassID() == XFA_ELEMENT_Packet) { - IFDE_XMLNode* pXMLNode = this->GetXMLMappingNode(); + if (GetObjectType() == XFA_OBJECTTYPE_ModelNode || + GetClassID() == XFA_ELEMENT_Packet) { + IFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (!pXMLNode || pXMLNode->GetType() != FDE_XMLNODE_Element) { return FALSE; } ((IFDE_XMLElement*)pXMLNode)->GetNamespaceURI(wsNamespace); return TRUE; - } else if (this->GetPacketID() == XFA_XDPPACKET_Datasets) { - IFDE_XMLNode* pXMLNode = this->GetXMLMappingNode(); + } else if (GetPacketID() == XFA_XDPPACKET_Datasets) { + IFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (!pXMLNode) { return FALSE; } if (pXMLNode->GetType() != FDE_XMLNODE_Element) { return TRUE; } - if (this->GetClassID() == XFA_ELEMENT_DataValue && - this->GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData) { + if (GetClassID() == XFA_ELEMENT_DataValue && + GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData) { return XFA_FDEExtension_ResolveNamespaceQualifier( - (IFDE_XMLElement*)pXMLNode, - this->GetCData(XFA_ATTRIBUTE_QualifiedName), wsNamespace); + (IFDE_XMLElement*)pXMLNode, GetCData(XFA_ATTRIBUTE_QualifiedName), + wsNamespace); } ((IFDE_XMLElement*)pXMLNode)->GetNamespaceURI(wsNamespace); return TRUE; @@ -4561,7 +4558,7 @@ CXFA_Node* CXFA_Node::GetProperty(int32_t index, if (!pNewNode) { return NULL; } - this->InsertChild(pNewNode, NULL); + InsertChild(pNewNode, nullptr); pNewNode->SetFlag(XFA_NODEFLAG_Initialized); } return pNewNode; @@ -4746,7 +4743,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, FX_BOOL bNotify) { CFX_WideString wsName; pNode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); IFDE_XMLElement* pNewXMLElement = IFDE_XMLElement::Create(wsName); - CFX_WideStringC wsValue = this->GetCData(XFA_ATTRIBUTE_Value); + CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { pNewXMLElement->SetTextData(wsValue); } @@ -5017,17 +5014,15 @@ XFA_LPMAPMODULEDATA CXFA_Node::GetMapModuleData(FX_BOOL bCreateNew) { return m_pMapModuleData; } void CXFA_Node::SetMapModuleValue(void* pKey, void* pValue) { - XFA_LPMAPMODULEDATA pMoudle = this->GetMapModuleData(TRUE); - if (!pMoudle) { - return; - } - pMoudle->m_ValueMap.SetAt(pKey, pValue); + XFA_LPMAPMODULEDATA pModule = GetMapModuleData(TRUE); + if (pModule) + pModule->m_ValueMap.SetAt(pKey, pValue); } FX_BOOL CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) { CXFA_Node* pNode = this; while (pNode) { - XFA_LPMAPMODULEDATA pMoudle = pNode->GetMapModuleData(FALSE); - if (pMoudle && pMoudle->m_ValueMap.Lookup(pKey, pValue)) { + XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); + if (pModule && pModule->m_ValueMap.Lookup(pKey, pValue)) { return TRUE; } pNode = pNode->GetPacketID() != XFA_XDPPACKET_Datasets @@ -5054,11 +5049,11 @@ void CXFA_Node::SetMapModuleBuffer( void* pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { - XFA_LPMAPMODULEDATA pMoudle = this->GetMapModuleData(TRUE); - if (!pMoudle) { + XFA_LPMAPMODULEDATA pModule = GetMapModuleData(TRUE); + if (!pModule) return; - } - XFA_LPMAPDATABLOCK& pBuffer = pMoudle->m_BufferMap[pKey]; + + XFA_LPMAPDATABLOCK& pBuffer = pModule->m_BufferMap[pKey]; if (pBuffer == NULL) { pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + iBytes); @@ -5085,8 +5080,8 @@ FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey, XFA_LPMAPDATABLOCK pBuffer = NULL; CXFA_Node* pNode = this; while (pNode) { - XFA_LPMAPMODULEDATA pMoudle = pNode->GetMapModuleData(FALSE); - if (pMoudle && pMoudle->m_BufferMap.Lookup(pKey, pBuffer)) { + XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); + if (pModule && pModule->m_BufferMap.Lookup(pKey, pBuffer)) { break; } pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) @@ -5104,10 +5099,10 @@ FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { CXFA_Node* pNode = this; while (pNode) { void* pVal; - XFA_LPMAPMODULEDATA pMoudle = pNode->GetMapModuleData(FALSE); - if (pMoudle && - (pMoudle->m_ValueMap.Lookup(pKey, pVal) || - pMoudle->m_BufferMap.Lookup(pKey, (XFA_LPMAPDATABLOCK&)pVal))) { + XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); + if (pModule && + (pModule->m_ValueMap.Lookup(pKey, pVal) || + pModule->m_BufferMap.Lookup(pKey, (XFA_LPMAPDATABLOCK&)pVal))) { return TRUE; } pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) @@ -5117,26 +5112,26 @@ FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { return FALSE; } void CXFA_Node::RemoveMapModuleKey(void* pKey) { - XFA_LPMAPMODULEDATA pMoudle = this->GetMapModuleData(FALSE); - if (!pMoudle) { + XFA_LPMAPMODULEDATA pModule = GetMapModuleData(FALSE); + if (!pModule) return; - } + if (pKey) { XFA_LPMAPDATABLOCK pBuffer = NULL; - pMoudle->m_BufferMap.Lookup(pKey, pBuffer); + pModule->m_BufferMap.Lookup(pKey, pBuffer); if (pBuffer) { if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); } FX_Free(pBuffer); } - pMoudle->m_BufferMap.RemoveKey(pKey); - pMoudle->m_ValueMap.RemoveKey(pKey); + pModule->m_BufferMap.RemoveKey(pKey); + pModule->m_ValueMap.RemoveKey(pKey); } else { XFA_LPMAPDATABLOCK pBuffer; - FX_POSITION posBuffer = pMoudle->m_BufferMap.GetStartPosition(); + FX_POSITION posBuffer = pModule->m_BufferMap.GetStartPosition(); while (posBuffer) { - pMoudle->m_BufferMap.GetNextAssoc(posBuffer, pKey, pBuffer); + pModule->m_BufferMap.GetNextAssoc(posBuffer, pKey, pBuffer); if (pBuffer) { if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); @@ -5144,12 +5139,9 @@ void CXFA_Node::RemoveMapModuleKey(void* pKey) { FX_Free(pBuffer); } } - pMoudle->m_BufferMap.RemoveAll(); - pMoudle->m_ValueMap.RemoveAll(); - if (pMoudle) { - delete pMoudle; - pMoudle = NULL; - } + pModule->m_BufferMap.RemoveAll(); + pModule->m_ValueMap.RemoveAll(); + delete pModule; } } void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) { @@ -5158,7 +5150,7 @@ void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) { if (!pDstModuleData) { return; } - XFA_LPMAPMODULEDATA pSrcModuleData = this->GetMapModuleData(FALSE); + XFA_LPMAPMODULEDATA pSrcModuleData = GetMapModuleData(FALSE); if (!pSrcModuleData) { return; } @@ -5219,13 +5211,13 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { if (!pKey) { bNeedMove = FALSE; } - if (pDstModule->GetClassID() != this->GetClassID()) { + if (pDstModule->GetClassID() != GetClassID()) { bNeedMove = FALSE; } XFA_LPMAPMODULEDATA pSrcModuleData = NULL; XFA_LPMAPMODULEDATA pDstModuleData = NULL; if (bNeedMove) { - pSrcModuleData = this->GetMapModuleData(FALSE); + pSrcModuleData = GetMapModuleData(FALSE); if (!pSrcModuleData) { bNeedMove = FALSE; } diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp index 725bc05b95..033aea5eb9 100644 --- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp @@ -2848,8 +2848,8 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, SyncValue(wsValue, TRUE); return TRUE; } - this->m_bPreNull = this->m_bIsNull; - this->m_bIsNull = FALSE; + m_bPreNull = m_bIsNull; + m_bIsNull = FALSE; CFX_WideString wsNewText(wsValue); CFX_WideString wsPicture; GetPictureContent(wsPicture, eValueType); |