diff options
Diffstat (limited to 'xfa/fxfa')
74 files changed, 815 insertions, 829 deletions
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 9313ad7ea2..419f15bc34 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -54,11 +54,11 @@ void Base64EncodePiece(const FX_BASE64DATA& src, } int32_t Base64EncodeA(const uint8_t* pSrc, int32_t iSrcLen, FX_CHAR* pDst) { - ASSERT(pSrc != NULL); + ASSERT(pSrc); if (iSrcLen < 1) { return 0; } - if (pDst == NULL) { + if (!pDst) { int32_t iDstLen = iSrcLen / 3 * 4; if ((iSrcLen % 3) != 0) { iDstLen += 4; @@ -103,7 +103,7 @@ CXFA_SAXContext* CXFA_SAXReaderHandler::OnTagEnter( UpdateChecksum(TRUE); if (eType != CFX_SAXItem::Type::Tag && eType != CFX_SAXItem::Type::Instruction) { - return NULL; + return nullptr; } m_SAXContext.m_eNode = eType; CFX_ByteTextBuf& textBuf = m_SAXContext.m_TextBuf; @@ -242,7 +242,7 @@ FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile, CFX_SaxParseMode_NotConvert_sharp) < 0) { return FALSE; } - return m_pSAXReader->ContinueParse(NULL) > 99; + return m_pSAXReader->ContinueParse(nullptr) > 99; } void CXFA_ChecksumContext::FinishChecksum() { @@ -252,12 +252,12 @@ void CXFA_ChecksumContext::FinishChecksum() { uint8_t digest[20]; FXSYS_memset(digest, 0, 20); CRYPT_SHA1Finish(m_pByteContext, digest); - int32_t nLen = Base64EncodeA(digest, 20, NULL); + int32_t nLen = Base64EncodeA(digest, 20, nullptr); FX_CHAR* pBuffer = m_bsChecksum.GetBuffer(nLen); Base64EncodeA(digest, 20, pBuffer); m_bsChecksum.ReleaseBuffer(nLen); FX_Free(m_pByteContext); - m_pByteContext = NULL; + m_pByteContext = nullptr; } } diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp index 5f2f1b9828..22989b8b3e 100644 --- a/xfa/fxfa/app/xfa_ffapp.cpp +++ b/xfa/fxfa/app/xfa_ffapp.cpp @@ -109,34 +109,26 @@ CXFA_FFApp::~CXFA_FFApp() { } CXFA_FFDocHandler* CXFA_FFApp::GetDocHandler() { - if (!m_pDocHandler) { + if (!m_pDocHandler) m_pDocHandler = new CXFA_FFDocHandler; - } return m_pDocHandler; } CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile) { - CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); + std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pProvider)); FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); - if (!bSuccess) { - delete pDoc; - pDoc = NULL; - } - return pDoc; + return bSuccess ? pDoc.release() : nullptr; } + CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc) { - if (pPDFDoc == NULL) { - return NULL; - } - CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); + if (!pPDFDoc) + return nullptr; + + std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pProvider)); FX_BOOL bSuccess = pDoc->OpenDoc(pPDFDoc); - if (!bSuccess) { - delete pDoc; - pDoc = NULL; - } - return pDoc; + return bSuccess ? pDoc.release() : nullptr; } void CXFA_FFApp::SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index 5b1fe35c90..ffbd7ce505 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -111,7 +111,7 @@ XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName( iStart = iMid + 1; } } while (iStart <= iEnd); - return NULL; + return nullptr; } } // namespace. diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index a24971c9d4..253cbd0025 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -20,7 +20,7 @@ CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) { + : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) { m_rtCheckBox.Set(0, 0, 0, 0); } CXFA_FFCheckButton::~CXFA_FFCheckButton() {} diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.h b/xfa/fxfa/app/xfa_ffcheckbutton.h index ff99aef001..b8158acc7e 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.h +++ b/xfa/fxfa/app/xfa_ffcheckbutton.h @@ -28,7 +28,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; void SetFWLCheckState(XFA_CHECKSTATE eCheckState); diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 4987b5ba23..da778ff0ad 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -21,7 +21,7 @@ CXFA_FFListBox::CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} + : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFListBox::~CXFA_FFListBox() { if (m_pNormalWidget) { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); @@ -203,7 +203,7 @@ void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics, CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} + : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFComboBox::~CXFA_FFComboBox() {} @@ -479,7 +479,7 @@ void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget, FWLEventSelChange(&eParam); if (m_pDataAcc->GetChoiceListCommitOn() == XFA_ATTRIBUTEENUM_Select && bLButtonUp) { - m_pDocView->SetFocusWidgetAcc(NULL); + m_pDocView->SetFocusWidgetAcc(nullptr); } } void CXFA_FFComboBox::OnPreOpen(IFWL_Widget* pWidget) { diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h index 8f87190b77..c9ea0fa248 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.h +++ b/xfa/fxfa/app/xfa_ffchoicelist.h @@ -21,7 +21,7 @@ class CXFA_FFListBox : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels); void SetItemState(int32_t nIndex, FX_BOOL bSelected); @@ -71,7 +71,7 @@ class CXFA_FFComboBox : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; virtual void OpenDropDownList(); diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index 6d38cf589c..7c7136b1ca 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -199,7 +199,7 @@ int32_t CXFA_FFDocView::CountPageViews() { } CXFA_FFPageView* CXFA_FFDocView::GetPageView(int32_t nIndex) { if (!m_pXFADocLayout) { - return NULL; + return nullptr; } return static_cast<CXFA_FFPageView*>(m_pXFADocLayout->GetPage(nIndex)); } @@ -224,7 +224,7 @@ FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc) { m_bLayoutEvent = TRUE; FX_BOOL bChanged = FALSE; - CXFA_Node* pFormNode = NULL; + CXFA_Node* pFormNode = nullptr; if (pWidgetAcc) { bChanged = ResetSingleWidgetAccData(pWidgetAcc); pFormNode = pWidgetAcc->GetNode(); @@ -315,10 +315,7 @@ CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() { CXFA_WidgetAccIterator* CXFA_FFDocView::CreateWidgetAccIterator( XFA_WIDGETORDER eOrder) { CXFA_Node* pFormRoot = GetRootSubform(); - if (!pFormRoot) { - return NULL; - } - return new CXFA_WidgetAccIterator(this, pFormRoot); + return pFormRoot ? new CXFA_WidgetAccIterator(this, pFormRoot) : nullptr; } CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { return m_pFocusWidget; @@ -326,11 +323,11 @@ CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { void CXFA_FFDocView::KillFocus() { if (m_pFocusWidget && (m_pFocusWidget->GetStatus() & XFA_WidgetStatus_Focused)) { - (m_pFocusWidget)->OnKillFocus(NULL); + (m_pFocusWidget)->OnKillFocus(nullptr); } - m_pFocusAcc = NULL; - m_pFocusWidget = NULL; - m_pOldFocusWidget = NULL; + m_pFocusAcc = nullptr; + m_pFocusWidget = nullptr; + m_pOldFocusWidget = nullptr; } FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { CXFA_FFWidget* pNewFocus = hWidget; @@ -358,10 +355,10 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { } pNewFocus = m_pOldFocusWidget; if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { - m_pFocusAcc = NULL; - m_pFocusWidget = NULL; - m_pListFocusWidget = NULL; - m_pOldFocusWidget = NULL; + m_pFocusAcc = nullptr; + m_pFocusWidget = nullptr; + m_pListFocusWidget = nullptr; + m_pOldFocusWidget = nullptr; return FALSE; } if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) { @@ -370,7 +367,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { } pNewFocus->OnSetFocus(m_pFocusWidget); } - m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL; + m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : nullptr; m_pFocusWidget = pNewFocus; m_pOldFocusWidget = m_pFocusWidget; return TRUE; @@ -380,7 +377,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() { } void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) { CXFA_FFWidget* pNewFocus = - pWidgetAcc ? pWidgetAcc->GetNextWidget(NULL) : NULL; + pWidgetAcc ? pWidgetAcc->GetNextWidget(nullptr) : nullptr; if (SetFocus(pNewFocus)) { m_pFocusAcc = pWidgetAcc; if (m_iStatus == XFA_DOCVIEW_LAYOUTSTATUS_End) { @@ -390,9 +387,9 @@ void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) { } void CXFA_FFDocView::DeleteLayoutItem(CXFA_FFWidget* pWidget) { if (m_pFocusAcc == pWidget->GetDataAcc()) { - m_pFocusAcc = NULL; - m_pFocusWidget = NULL; - m_pOldFocusWidget = NULL; + m_pFocusAcc = nullptr; + m_pFocusWidget = nullptr; + m_pOldFocusWidget = nullptr; } } static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, @@ -447,7 +444,7 @@ int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, return iRet; } CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pFormNode->GetWidgetData(); - if (pWidgetAcc == NULL) { + if (!pWidgetAcc) { return iRet; } CXFA_EventParam eParam; @@ -470,7 +467,7 @@ int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, } } CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pFormNode->GetWidgetData(); - if (pWidgetAcc == NULL) { + if (!pWidgetAcc) { return iRet; } CXFA_EventParam eParam; @@ -770,11 +767,7 @@ void CXFA_FFDocView::RunBindItems() { wsValue = refNode->GetContent(); } else { CXFA_Node* nodeValue = refNode->GetFirstChildByName(uValueHash); - if (nodeValue == NULL) { - wsValue = refNode->GetContent(); - } else { - wsValue = nodeValue->GetContent(); - } + wsValue = nodeValue ? nodeValue->GetContent() : refNode->GetContent(); } if (!bUseValue) { if (bLabelUseContent) { @@ -802,7 +795,7 @@ CXFA_Node* CXFA_FFDocView::GetRootSubform() { CXFA_Node* pFormPacketNode = ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form)); if (!pFormPacketNode) { - return NULL; + return nullptr; } return pFormPacketNode->GetFirstChildByClass(XFA_Element::Subform); } @@ -811,18 +804,18 @@ CXFA_WidgetAccIterator::CXFA_WidgetAccIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot) : m_ContentIterator(pTravelRoot) { m_pDocView = pDocView; - m_pCurWidgetAcc = NULL; + m_pCurWidgetAcc = nullptr; } CXFA_WidgetAccIterator::~CXFA_WidgetAccIterator() {} void CXFA_WidgetAccIterator::Reset() { - m_pCurWidgetAcc = NULL; + m_pCurWidgetAcc = nullptr; m_ContentIterator.Reset(); } CXFA_WidgetAcc* CXFA_WidgetAccIterator::MoveToFirst() { - return NULL; + return nullptr; } CXFA_WidgetAcc* CXFA_WidgetAccIterator::MoveToLast() { - return NULL; + return nullptr; } CXFA_WidgetAcc* CXFA_WidgetAccIterator::MoveToNext() { CXFA_Node* pItem = m_pCurWidgetAcc ? m_ContentIterator.MoveToNext() @@ -833,18 +826,18 @@ CXFA_WidgetAcc* CXFA_WidgetAccIterator::MoveToNext() { return m_pCurWidgetAcc; pItem = m_ContentIterator.MoveToNext(); } - return NULL; + return nullptr; } CXFA_WidgetAcc* CXFA_WidgetAccIterator::MoveToPrevious() { - return NULL; + return nullptr; } CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { - return NULL; + return nullptr; } FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { return FALSE; } void CXFA_WidgetAccIterator::SkipTree() { m_ContentIterator.SkipChildrenAndMoveToNext(); - m_pCurWidgetAcc = NULL; + m_pCurWidgetAcc = nullptr; } diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index d3e645d56b..66520b2738 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -22,7 +22,7 @@ #include "xfa/fxgraphics/cfx_path.h" CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(NULL) { + : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(nullptr) { m_rtUI.Set(0, 0, 0, 0); m_rtCaption.Set(0, 0, 0, 0); } @@ -166,12 +166,12 @@ void CXFA_FFField::CapPlacement() { mgWidget.GetRightInset(fRightInset); mgWidget.GetTopInset(fTopInset); mgWidget.GetBottomInset(fBottomInset); - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) { + if (!pItem->GetPrev() && !pItem->GetNext()) { rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset); } else { - if (pItem->GetPrev() == NULL) { + if (!pItem->GetPrev()) { rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, 0); - } else if (pItem->GetNext() == NULL) { + } else if (!pItem->GetNext()) { rtWidget.Deflate(fLeftInset, 0, fRightInset, fBottomInset); } else { rtWidget.Deflate(fLeftInset, 0, fRightInset, 0); @@ -190,7 +190,7 @@ void CXFA_FFField::CapPlacement() { } else { fCapReserve = caption.GetReserve(); CXFA_LayoutItem* pItem = this; - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) { + if (!pItem->GetPrev() && !pItem->GetNext()) { m_rtCaption.Set(rtWidget.left, rtWidget.top, rtWidget.width, rtWidget.height); } else { @@ -350,7 +350,7 @@ FX_BOOL CXFA_FFField::OnMouseEnter() { CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::Enter; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return TRUE; } @@ -529,7 +529,7 @@ FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { } CFWL_MsgSetFocus ms; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); m_dwStatus |= XFA_WidgetStatus_Focused; AddInvalidateRect(); @@ -541,7 +541,7 @@ FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { } CFWL_MsgKillFocus ms; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); m_dwStatus &= ~XFA_WidgetStatus_Focused; AddInvalidateRect(); @@ -557,7 +557,7 @@ FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwKeyCode; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return TRUE; } @@ -570,7 +570,7 @@ FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwKeyCode; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return TRUE; } @@ -592,7 +592,7 @@ FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwChar; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return TRUE; } @@ -689,7 +689,7 @@ int32_t CXFA_FFField::CalculateOverride() { if (!pNode) { return 1; } - CXFA_WidgetAcc* pWidgetAcc = NULL; + CXFA_WidgetAcc* pWidgetAcc = nullptr; while (pNode) { pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); if (!pWidgetAcc) { diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h index a2c310fa89..ffe5b6563a 100644 --- a/xfa/fxfa/app/xfa_fffield.h +++ b/xfa/fxfa/app/xfa_fffield.h @@ -57,7 +57,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; void UpdateFWL(); uint32_t UpdateUIProperty(); @@ -70,7 +70,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); void LayoutCaption(); - void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); + void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr); int32_t CalculateOverride(); int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); diff --git a/xfa/fxfa/app/xfa_ffimage.cpp b/xfa/fxfa/app/xfa_ffimage.cpp index 5f62f78317..7c152a196e 100644 --- a/xfa/fxfa/app/xfa_ffimage.cpp +++ b/xfa/fxfa/app/xfa_ffimage.cpp @@ -18,7 +18,7 @@ CXFA_FFImage::~CXFA_FFImage() { CXFA_FFImage::UnloadWidget(); } FX_BOOL CXFA_FFImage::IsLoaded() { - return GetDataAcc()->GetImageImage() != NULL; + return !!GetDataAcc()->GetImageImage(); } FX_BOOL CXFA_FFImage::LoadWidget() { if (GetDataAcc()->GetImageImage()) { @@ -28,7 +28,7 @@ FX_BOOL CXFA_FFImage::LoadWidget() { return CXFA_FFDraw::LoadWidget(); } void CXFA_FFImage::UnloadWidget() { - GetDataAcc()->SetImageImage(NULL); + GetDataAcc()->SetImageImage(nullptr); } void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp index fafa24d5c7..85e464d40a 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.cpp +++ b/xfa/fxfa/app/xfa_ffimageedit.cpp @@ -18,7 +18,7 @@ CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} + : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFImageEdit::~CXFA_FFImageEdit() { CXFA_FFImageEdit::UnloadWidget(); } @@ -41,7 +41,7 @@ FX_BOOL CXFA_FFImageEdit::LoadWidget() { return TRUE; } void CXFA_FFImageEdit::UnloadWidget() { - m_pDataAcc->SetImageEditImage(NULL); + m_pDataAcc->SetImageEditImage(nullptr); CXFA_FFField::UnloadWidget(); } void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, @@ -118,7 +118,7 @@ FX_BOOL CXFA_FFImageEdit::CommitData() { return TRUE; } FX_BOOL CXFA_FFImageEdit::UpdateFWLData() { - m_pDataAcc->SetImageEditImage(NULL); + m_pDataAcc->SetImageEditImage(nullptr); m_pDataAcc->LoadImageEditImage(); return TRUE; } diff --git a/xfa/fxfa/app/xfa_ffimageedit.h b/xfa/fxfa/app/xfa_ffimageedit.h index 88a28f431c..c8f31e2fc4 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.h +++ b/xfa/fxfa/app/xfa_ffimageedit.h @@ -24,7 +24,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void SetFWLRect() override; diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp index 12792bc996..d8c32f9ed9 100644 --- a/xfa/fxfa/app/xfa_ffnotify.cpp +++ b/xfa/fxfa/app/xfa_ffnotify.cpp @@ -221,7 +221,7 @@ int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, } return pDocView->ExecEventActivityByDeepFirst( pFormNode, eEventType, bIsFormReady, bRecursive, - pExclude ? pExclude->GetNode() : NULL); + pExclude ? pExclude->GetNode() : nullptr); } void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); @@ -247,7 +247,7 @@ IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { } CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); - return pDocView ? pDocView->GetWidgetHandler() : NULL; + return pDocView ? pDocView->GetWidgetHandler() : nullptr; } CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { return XFA_GetWidgetFromLayoutItem(pLayoutItem); @@ -299,10 +299,10 @@ void CXFA_FFNotify::RunSubformIndexChange(CXFA_Node* pSubformNode) { CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) { - return NULL; + return nullptr; } CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); - return pAcc ? pAcc->GetNode() : NULL; + return pAcc ? pAcc->GetNode() : nullptr; } void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h index e9e8721df3..322caa3652 100644 --- a/xfa/fxfa/app/xfa_ffnotify.h +++ b/xfa/fxfa/app/xfa_ffnotify.h @@ -54,7 +54,7 @@ class CXFA_FFNotify { XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, - CXFA_WidgetAcc* pExclude = NULL); + CXFA_WidgetAcc* pExclude = nullptr); void AddCalcValidate(CXFA_Node* pNode); CXFA_FFDoc* GetHDOC(); IXFA_DocProvider* GetDocProvider(); @@ -63,7 +63,7 @@ class CXFA_FFNotify { CXFA_FFWidget* GetHWidget(CXFA_LayoutItem* pLayoutItem); void OpenDropDownList(CXFA_FFWidget* hWidget); CFX_WideString GetCurrentDateTime(); - void ResetData(CXFA_WidgetData* pWidgetData = NULL); + void ResetData(CXFA_WidgetData* pWidgetData = nullptr); int32_t GetLayoutStatus(); void RunNodeInitialize(CXFA_Node* pNode); void RunSubformIndexChange(CXFA_Node* pSubformNode); diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index dd40ecf946..54c262faac 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -150,10 +150,10 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToFirst() { return hWidget; } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToLast() { - m_sIterator.SetCurrent(NULL); + m_sIterator.SetCurrent(nullptr); return MoveToPrevious(); } CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToNext() { @@ -163,7 +163,7 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToNext() { return hWidget; } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToPrevious() { for (CXFA_LayoutItem* pLayoutItem = m_sIterator.MoveToPrev(); pLayoutItem; @@ -172,11 +172,11 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::MoveToPrevious() { return hWidget; } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetCurrentWidget() { CXFA_LayoutItem* pLayoutItem = m_sIterator.GetCurrent(); - return pLayoutItem ? XFA_GetWidgetFromLayoutItem(pLayoutItem) : NULL; + return pLayoutItem ? XFA_GetWidgetFromLayoutItem(pLayoutItem) : nullptr; } FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) { return hWidget && m_sIterator.SetCurrent(hWidget); @@ -185,7 +185,7 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget( CXFA_LayoutItem* pLayoutItem) { if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) { if (!PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) { - return NULL; + return nullptr; } if (!pWidget->IsLoaded() && (pWidget->GetStatus() & XFA_WidgetStatus_Visible) != 0) { @@ -193,7 +193,7 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget( } return pWidget; } - return NULL; + return nullptr; } CXFA_FFTabOrderPageWidgetIterator::CXFA_FFTabOrderPageWidgetIterator( @@ -222,7 +222,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() { } } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() { if (m_TabOrderWidgetArray.GetSize() > 0) { @@ -234,7 +234,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() { } } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() { for (int32_t i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) { @@ -245,7 +245,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() { } } m_iCurWidget = -1; - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious() { for (int32_t i = m_iCurWidget - 1; i >= 0; i--) { @@ -256,13 +256,13 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious() { } } m_iCurWidget = -1; - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget() { if (m_iCurWidget >= 0) { return m_TabOrderWidgetArray[m_iCurWidget]; } - return NULL; + return nullptr; } FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget( CXFA_FFWidget* hWidget) { @@ -286,7 +286,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget( } } } - return NULL; + return nullptr; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::FindWidgetByName( const CFX_WideString& wsWidgetName, @@ -408,7 +408,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateSpaceOrderWidgetArray( CXFA_TabParam* pParam = new CXFA_TabParam; FX_BOOL bCurrentItem = FALSE; FX_BOOL bContentArea = FALSE; - OrderContainer(&sIterator, NULL, pParam, bCurrentItem, bContentArea); + OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea); if (pParam->m_Children.GetSize() > 0) { WidgetArray.Append(pParam->m_Children); } @@ -416,7 +416,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateSpaceOrderWidgetArray( bCurrentItem = FALSE; bContentArea = FALSE; pParam->m_Children.RemoveAll(); - OrderContainer(&sIterator, NULL, pParam, bCurrentItem, bContentArea, TRUE); + OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea, TRUE); if (pParam->m_Children.GetSize() > 0) { WidgetArray.Append(pParam->m_Children); } @@ -431,9 +431,9 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetWidget( } return pWidget; } - return NULL; + return nullptr; } -CXFA_TabParam::CXFA_TabParam() : m_pWidget(NULL) {} +CXFA_TabParam::CXFA_TabParam() : m_pWidget(nullptr) {} CXFA_TabParam::~CXFA_TabParam() {} diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index bb25f1bcc1..3af1e34db9 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -21,11 +21,11 @@ CXFA_FFPushButton::CXFA_FFPushButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) : CXFA_FFField(pPageView, pDataAcc), - m_pRolloverTextLayout(NULL), - m_pDownTextLayout(NULL), - m_pDownProvider(NULL), - m_pRollProvider(NULL), - m_pOldDelegate(NULL) {} + m_pRolloverTextLayout(nullptr), + m_pDownTextLayout(nullptr), + m_pDownProvider(nullptr), + m_pRollProvider(nullptr), + m_pOldDelegate(nullptr) {} CXFA_FFPushButton::~CXFA_FFPushButton() { CXFA_FFPushButton::UnloadWidget(); } @@ -139,7 +139,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() { CFX_WideString wsRollover; FX_BOOL bRichText; if (m_pDataAcc->GetButtonRollover(wsRollover, bRichText)) { - if (m_pRollProvider == NULL) { + if (!m_pRollProvider) { m_pRollProvider = new CXFA_TextProvider(m_pDataAcc, XFA_TEXTPROVIDERTYPE_Rollover); } @@ -147,7 +147,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() { } CFX_WideString wsDown; if (m_pDataAcc->GetButtonDown(wsDown, bRichText)) { - if (m_pDownProvider == NULL) { + if (!m_pDownProvider) { m_pDownProvider = new CXFA_TextProvider(m_pDataAcc, XFA_TEXTPROVIDERTYPE_Down); } diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h index dae232e173..e7c9bd7746 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.h +++ b/xfa/fxfa/app/xfa_ffpushbutton.h @@ -32,12 +32,12 @@ class CXFA_FFPushButton : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void LoadHighlightCaption(); void LayoutHighlightCaption(); - void RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); + void RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr); FX_FLOAT GetLineWidth(); FX_ARGB GetLineColor(); FX_ARGB GetFillColor(); diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index 88cc6590e6..3e5b3df8e9 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -38,15 +38,15 @@ void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, GetRectWithoutRotate(rtText); if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) { CXFA_LayoutItem* pItem = this; - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) { + if (!pItem->GetPrev() && !pItem->GetNext()) { XFA_RectWidthoutMargin(rtText, mgWidget); } else { FX_FLOAT fLeftInset, fRightInset, fTopInset = 0, fBottomInset = 0; mgWidget.GetLeftInset(fLeftInset); mgWidget.GetRightInset(fRightInset); - if (pItem->GetPrev() == NULL) { + if (!pItem->GetPrev()) { mgWidget.GetTopInset(fTopInset); - } else if (pItem->GetNext() == NULL) { + } else if (!pItem->GetNext()) { mgWidget.GetBottomInset(fBottomInset); } rtText.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset); @@ -76,7 +76,7 @@ FX_BOOL CXFA_FFText::PerformLayout() { } pTextLayout->m_Blocks.RemoveAll(); CXFA_LayoutItem* pItem = this; - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) { + if (!pItem->GetPrev() && !pItem->GetNext()) { return TRUE; } pItem = pItem->GetFirst(); @@ -84,11 +84,11 @@ FX_BOOL CXFA_FFText::PerformLayout() { CFX_RectF rtText; pItem->GetRect(rtText); if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) { - if (pItem->GetPrev() == NULL) { + if (!pItem->GetPrev()) { FX_FLOAT fTopInset; mgWidget.GetTopInset(fTopInset); rtText.height -= fTopInset; - } else if (pItem->GetNext() == NULL) { + } else if (!pItem->GetNext()) { FX_FLOAT fBottomInset; mgWidget.GetBottomInset(fBottomInset); rtText.height -= fBottomInset; @@ -107,7 +107,7 @@ FX_BOOL CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); - if (NULL == wsURLContent) { + if (!wsURLContent) { return FALSE; } SetButtonDown(TRUE); @@ -120,7 +120,7 @@ FX_BOOL CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); - if (NULL == wsURLContent) { + if (!wsURLContent) { return FALSE; } return TRUE; @@ -131,7 +131,7 @@ FX_BOOL CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { } SetButtonDown(FALSE); const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); - if (NULL == wsURLContent) { + if (!wsURLContent) { return FALSE; } CXFA_FFDoc* pDoc = GetDoc(); @@ -149,8 +149,8 @@ FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { } const FX_WCHAR* CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) { CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout(); - if (NULL == pTextLayout) { - return NULL; + if (!pTextLayout) { + return nullptr; } FX_FLOAT x(fx), y(fy); FWLToClient(x, y); @@ -166,7 +166,7 @@ const FX_WCHAR* CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) { } } } - return NULL; + return nullptr; } void CXFA_FFText::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { CFX_RectF rtWidget; diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index d29446a086..398cf87cd8 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -26,7 +26,7 @@ CXFA_FFTextEdit::CXFA_FFTextEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) - : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} + : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} CXFA_FFTextEdit::~CXFA_FFTextEdit() { if (m_pNormalWidget) { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); @@ -159,14 +159,14 @@ FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) { CXFA_FFWidget::OnSetFocus(pOldWidget); CFWL_MsgSetFocus ms; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return TRUE; } FX_BOOL CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { CFWL_MsgKillFocus ms; ms.m_pDstTarget = m_pNormalWidget->m_pIface; - ms.m_pSrcTarget = NULL; + ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); m_dwStatus &= ~XFA_WidgetStatus_Focused; SetEditScrollOffset(); @@ -782,7 +782,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget, CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)m_pNormalWidget; pDateTime->SetEditText(wsDate); pDateTime->Update(); - GetDoc()->GetDocProvider()->SetFocusWidget(GetDoc(), NULL); + GetDoc()->GetDocProvider()->SetFocusWidget(GetDoc(), nullptr); CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Change; eParam.m_pTarget = m_pDataAcc; diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h index d7c6667435..c6d9c9c862 100644 --- a/xfa/fxfa/app/xfa_fftextedit.h +++ b/xfa/fxfa/app/xfa_fftextedit.h @@ -45,7 +45,7 @@ class CXFA_FFTextEdit : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; void OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged, diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 09f6da0b9f..e4b25dec85 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -123,7 +123,7 @@ void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, } } FX_BOOL CXFA_FFWidget::IsLoaded() { - return m_pPageView != NULL; + return !!m_pPageView; } FX_BOOL CXFA_FFWidget::LoadWidget() { PerformLayout(); @@ -405,10 +405,10 @@ CXFA_FFWidget* CXFA_FFWidget::GetParent() { CXFA_WidgetAcc* pParentWidgetAcc = static_cast<CXFA_WidgetAcc*>(pParentNode->GetWidgetData()); if (pParentWidgetAcc) { - return pParentWidgetAcc->GetNextWidget(NULL); + return pParentWidgetAcc->GetNextWidget(nullptr); } } - return NULL; + return nullptr; } FX_BOOL CXFA_FFWidget::IsAncestorOf(CXFA_FFWidget* pWidget) { if (!pWidget) { @@ -584,14 +584,14 @@ class CXFA_ImageRenderer { int Transparency); }; CXFA_ImageRenderer::CXFA_ImageRenderer() { - m_pDevice = NULL; + m_pDevice = nullptr; m_Status = 0; - m_pDIBSource = NULL; - m_pCloneConvert = NULL; + m_pDIBSource = nullptr; + m_pCloneConvert = nullptr; m_BitmapAlpha = 255; m_FillArgb = 0; m_Flags = 0; - m_DeviceHandle = NULL; + m_DeviceHandle = nullptr; m_BlendType = FXDIB_BLEND_NORMAL; m_Result = TRUE; m_bPrint = FALSE; @@ -741,7 +741,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int bitmap_alpha, int blend_mode, int Transparency) { - if (pDIBitmap == NULL) { + if (!pDIBitmap) { return; } bool bIsolated = !!(Transparency & PDFTRANS_ISOLATED); @@ -780,7 +780,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight()); rect.Intersect(m_pDevice->GetClipBox()); - CFX_DIBitmap* pClone = NULL; + CFX_DIBitmap* pClone = nullptr; FX_BOOL bClone = FALSE; if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) { bClone = TRUE; @@ -823,7 +823,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, FX_BOOL bRet = imageRender.Start(m_pDevice, pCloneConvert, m_FillArgb, m_BitmapAlpha, &m_ImageMatrix, m_Flags); while (bRet) { - bRet = imageRender.Continue(NULL); + bRet = imageRender.Continue(nullptr); } delete pCloneConvert; return; @@ -897,7 +897,7 @@ void XFA_DrawImage(CFX_Graphics* pGS, FX_BOOL bRet = imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage, FXDIB_INTERPOL); while (bRet) { - bRet = imageRender.Continue(NULL); + bRet = imageRender.Continue(nullptr); } pRenderDevice->RestoreState(false); } @@ -932,12 +932,12 @@ static uint8_t* XFA_RemoveBase64Whitespace(const uint8_t* pStr, int32_t iLen) { return pCP; } static int32_t XFA_Base64Decode(const FX_CHAR* pStr, uint8_t* pOutBuffer) { - if (pStr == NULL) { + if (!pStr) { return 0; } uint8_t* pBuffer = XFA_RemoveBase64Whitespace((uint8_t*)pStr, FXSYS_strlen((FX_CHAR*)pStr)); - if (pBuffer == NULL) { + if (!pBuffer) { return 0; } int32_t iLen = FXSYS_strlen((FX_CHAR*)pBuffer); @@ -981,7 +981,7 @@ static const FX_CHAR g_base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; FX_CHAR* XFA_Base64Encode(const uint8_t* buf, int32_t buf_len) { - FX_CHAR* out = NULL; + FX_CHAR* out = nullptr; int i, j; uint32_t limb; out = FX_Alloc(FX_CHAR, ((buf_len * 8 + 5) / 6) + 5); @@ -1046,14 +1046,14 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, CFX_WideString wsImage; pImage->GetContent(wsImage); if (wsHref.IsEmpty() && wsImage.IsEmpty()) { - return NULL; + return nullptr; } CFX_WideString wsContentType; pImage->GetContentType(wsContentType); FXCODEC_IMAGE_TYPE type = XFA_GetImageType(wsContentType); CFX_ByteString bsContent; - uint8_t* pImageBuffer = NULL; - IFX_FileRead* pImageFileRead = NULL; + uint8_t* pImageBuffer = nullptr; + IFX_FileRead* pImageFileRead = nullptr; if (wsImage.GetLength() > 0) { XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); @@ -1085,7 +1085,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, } if (!pImageFileRead) { FX_Free(pImageBuffer); - return NULL; + return nullptr; } bNameImage = FALSE; CFX_DIBitmap* pBitmap = @@ -1120,14 +1120,14 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, int32_t& iImageYDpi) { CFX_GEModule* pGeModule = CFX_GEModule::Get(); if (!pGeModule) { - return NULL; + return nullptr; } CCodec_ModuleMgr* pCodecMgr = pGeModule->GetCodecModule(); if (!pCodecMgr) { - return NULL; + return nullptr; } CFX_DIBAttribute dibAttr; - CFX_DIBitmap* pBitmap = NULL; + CFX_DIBitmap* pBitmap = nullptr; CCodec_ProgressiveDecoder* pProgressiveDecoder = pCodecMgr->CreateProgressiveDecoder(); pProgressiveDecoder->LoadImageInfo(pImageFileRead, type, &dibAttr, false); diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index 1e5bd0ac34..dabb31610a 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -36,7 +36,7 @@ static void XFA_FFDeleteCalcData(void* pData) { } static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteCalcData = { - XFA_FFDeleteCalcData, NULL}; + XFA_FFDeleteCalcData, nullptr}; class CXFA_WidgetLayoutData { public: @@ -135,7 +135,7 @@ class CXFA_TextEditData : public CXFA_FieldLayoutData { class CXFA_ImageEditData : public CXFA_FieldLayoutData { public: CXFA_ImageEditData() - : m_pDIBitmap(NULL), + : m_pDIBitmap(nullptr), m_bNamedImage(FALSE), m_iImageXDpi(0), m_iImageYDpi(0) {} @@ -222,7 +222,7 @@ void CXFA_WidgetAcc::ResetData() { if (!pAcc) { continue; } - CXFA_Value defValue(NULL); + CXFA_Value defValue(nullptr); if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { defValue.GetChildValueContent(wsValue); SetValue(wsValue, XFA_VALUEPICTURE_Raw); @@ -282,7 +282,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType, CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pExcl || pExcl->GetElementType() != XFA_Element::ExclGroup) { - return NULL; + return nullptr; } return static_cast<CXFA_WidgetAcc*>(pExcl->GetWidgetData()); } @@ -695,7 +695,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, if (pRetValue) *pRetValue = pTmpRetValue.release(); - pContext->SetNodesOfRunScript(NULL); + pContext->SetNodesOfRunScript(nullptr); return iRet; } CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { @@ -708,7 +708,7 @@ CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { return static_cast<CXFA_FFWidget*>(pLayout); } void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { - CXFA_FFWidget* pWidget = NULL; + CXFA_FFWidget* pWidget = nullptr; while ((pWidget = GetNextWidget(pWidget)) != nullptr) { if (pWidget == pExcept || !pWidget->IsLoaded() || (GetUIType() != XFA_Element::CheckButton && pWidget->IsFocused())) { @@ -1471,19 +1471,19 @@ CXFA_TextLayout* CXFA_WidgetAcc::GetTextLayout() { return m_pLayoutData ? static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get()) ->GetTextLayout() - : NULL; + : nullptr; } CFX_DIBitmap* CXFA_WidgetAcc::GetImageImage() { return m_pLayoutData ? static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()) ->m_pDIBitmap - : NULL; + : nullptr; } CFX_DIBitmap* CXFA_WidgetAcc::GetImageEditImage() { return m_pLayoutData ? static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()) ->m_pDIBitmap - : NULL; + : nullptr; } void CXFA_WidgetAcc::SetImageImage(CFX_DIBitmap* newImage) { @@ -1570,7 +1570,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_Element::Value); if (!pValueNode) { - return NULL; + return nullptr; } CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) { @@ -1600,12 +1600,12 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { CXFA_Node* pCaptionNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Caption); - if (pCaptionNode == NULL) { - return NULL; + if (!pCaptionNode) { + return nullptr; } CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_Element::Value); - if (pValueNode == NULL) { - return NULL; + if (!pValueNode) { + return nullptr; } CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) { @@ -1619,8 +1619,8 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { } CXFA_Node* pItemNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Items); - if (pItemNode == NULL) { - return NULL; + if (!pItemNode) { + return nullptr; } CXFA_Node* pNode = pItemNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pNode) { @@ -1635,7 +1635,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { } pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); } - return NULL; + return nullptr; } CXFA_Para CXFA_TextProvider::GetParaNode() { if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { @@ -1674,8 +1674,8 @@ FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, CXFA_Node* pWidgetNode = m_pWidgetAcc->GetNode(); CXFA_Node* pParent = pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent); CXFA_Document* pDocument = pWidgetNode->GetDocument(); - CXFA_Node* pIDNode = NULL; - CXFA_WidgetAcc* pEmbAcc = NULL; + CXFA_Node* pIDNode = nullptr; + CXFA_WidgetAcc* pEmbAcc = nullptr; if (pParent) { pIDNode = pDocument->GetNodeByID(pParent, wsAttr.AsStringC()); } diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.h b/xfa/fxfa/app/xfa_ffwidgetacc.h index 5f7aec72d9..9261d41ee7 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.h +++ b/xfa/fxfa/app/xfa_ffwidgetacc.h @@ -21,7 +21,7 @@ class CXFA_TextProvider { public: CXFA_TextProvider(CXFA_WidgetAcc* pWidgetAcc, XFA_TEXTPROVIDERTYPE eType, - CXFA_Node* pTextNode = NULL) + CXFA_Node* pTextNode = nullptr) : m_pWidgetAcc(pWidgetAcc), m_eType(eType), m_pTextNode(pTextNode) { ASSERT(m_pWidgetAcc); } diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index 5221c7cd6d..aaaf07ad66 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -481,7 +481,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateSubform(CXFA_Node* pParent, CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const { - CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : NULL; + CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr; CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(FALSE); if (pParent) pParent->InsertChild(pNewFormItem, pBefore); @@ -491,10 +491,10 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement, CXFA_Node* CXFA_FFWidgetHandler::CreateCopyNode(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const { - CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : NULL; + CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr; CXFA_Node* pNewNode = CreateTemplateNode(eElement, pTemplateParent, - pBefore ? pBefore->GetTemplateNode() : NULL) + pBefore ? pBefore->GetTemplateNode() : nullptr) ->Clone(FALSE); if (pParent) pParent->InsertChild(pNewNode, pBefore); diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 67f96c4e18..5bb4ccb816 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1722,7 +1722,7 @@ const XFA_FONTINFO* XFA_GetFontINFOByFontName( int32_t iStart = 0; int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; int32_t iMid = 0; - const XFA_FONTINFO* pFontInfo = NULL; + const XFA_FONTINFO* pFontInfo = nullptr; do { iMid = (iStart + iEnd) / 2; uint32_t dwFontNameHash = g_XFAFontsMap[iMid].dwFontNameHash; @@ -1798,9 +1798,11 @@ CFGAS_GEFont* CXFA_DefFontMgr::GetDefaultFont( IFGAS_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr(); CFGAS_GEFont* pFont = pFDEFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage); - if (!pFont) - pFont = - pFDEFontMgr->LoadFont((const FX_WCHAR*)NULL, dwFontStyles, wCodePage); + if (!pFont) { + pFont = pFDEFontMgr->LoadFont((const FX_WCHAR*)nullptr, dwFontStyles, + wCodePage); + } + ASSERT(pFont); if (pFont) { m_CacheFonts.Add(pFont); @@ -1834,17 +1836,17 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, CPDF_Font** pDstPDFFont, FX_BOOL bStrictMatch) { CPDF_Document* pDoc = m_pDoc->GetPDFDoc(); - if (pDoc == NULL) { - return NULL; + if (!pDoc) { + return nullptr; } CPDF_Dictionary* pFontSetDict = pDoc->GetRoot()->GetDictBy("AcroForm")->GetDictBy("DR"); if (!pFontSetDict) { - return NULL; + return nullptr; } pFontSetDict = pFontSetDict->GetDictBy("Font"); if (!pFontSetDict) { - return NULL; + return nullptr; } strPsName.Remove(' '); IFGAS_FontMgr* pFDEFontMgr = m_pDoc->GetApp()->GetFDEFontMgr(); @@ -1857,19 +1859,19 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, } CPDF_Dictionary* pFontDict = ToDictionary(pObj->GetDirect()); if (!pFontDict || pFontDict->GetStringBy("Type") != "Font") { - return NULL; + return nullptr; } CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict); if (!pPDFFont) { - return NULL; + return nullptr; } if (!pPDFFont->IsEmbedded()) { *pDstPDFFont = pPDFFont; - return NULL; + return nullptr; } return CFGAS_GEFont::LoadFont(&pPDFFont->m_Font, pFDEFontMgr); } - return NULL; + return nullptr; } CFGAS_GEFont* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index 0706988de8..41d8fecb36 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -46,7 +46,7 @@ CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) { CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) : m_pApp(pApp) { m_dwCapacity = 0; m_fCapacity = 0; - m_pCalendarFont = NULL; + m_pCalendarFont = nullptr; m_Rect.Set(0, 0, 0, 0); m_pCheckBoxTP = new CXFA_FWLCheckBoxTP; m_pListBoxTP = new CFWL_ListBoxTP; @@ -85,14 +85,14 @@ FWL_Error CXFA_FWLTheme::Initialize() { if (!m_pCalendarFont) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetDefFontByCodePage( - FX_CODEPAGE_MSWin_WesternEuropean, 0, NULL); + FX_CODEPAGE_MSWin_WesternEuropean, 0, nullptr); #else m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetFontByCodePage( - FX_CODEPAGE_MSWin_WesternEuropean, 0, NULL); + FX_CODEPAGE_MSWin_WesternEuropean, 0, nullptr); #endif } - ASSERT(NULL != m_pCalendarFont); + ASSERT(m_pCalendarFont); FWLTHEME_Init(); return FWL_Error::Succeeded; } @@ -246,11 +246,11 @@ void* CXFA_FWLTheme::GetCapacity(CFWL_ThemePart* pThemePart, m_Rect.width += para.GetMarginRight(); } } - if (pItem->GetPrev() == NULL) { + if (!pItem->GetPrev()) { if (pItem->GetNext()) { m_Rect.height = 0; } - } else if (pItem->GetNext() == NULL) { + } else if (!pItem->GetNext()) { m_Rect.top = 0; } else { m_Rect.top = 0; diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 8b2871e03c..6643d92856 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -119,9 +119,9 @@ CXFA_LoaderContext::CXFA_LoaderContext() m_fStartLineOffset(0), m_iChar(0), m_iTotalLines(-1), - m_pXMLNode(NULL), - m_pNode(NULL), - m_pParentStyle(NULL), + m_pXMLNode(nullptr), + m_pNode(nullptr), + m_pParentStyle(nullptr), m_dwFlags(0) {} CXFA_LoaderContext::~CXFA_LoaderContext() {} @@ -143,7 +143,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::CreateRootStyle( CXFA_TextProvider* pTextProvider) { CXFA_Font font = pTextProvider->GetFontNode(); CXFA_Para para = pTextProvider->GetParaNode(); - IFDE_CSSComputedStyle* pStyle = m_pSelector->CreateComputedStyle(NULL); + IFDE_CSSComputedStyle* pStyle = m_pSelector->CreateComputedStyle(nullptr); IFDE_CSSFontStyle* pFontStyle = pStyle->GetFontStyles(); IFDE_CSSParagraphStyle* pParaStyle = pStyle->GetParagraphStyles(); FX_FLOAT fLineHeight = 0, fFontSize = 10; @@ -248,7 +248,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::ComputeStyle( } void CXFA_TextParser::DoParse(CFDE_XMLNode* pXMLContainer, CXFA_TextProvider* pTextProvider) { - if (pXMLContainer == NULL || pTextProvider == NULL || m_pAllocator) { + if (!pXMLContainer || !pTextProvider || m_pAllocator) { return; } m_pAllocator.reset(IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Fixed, 32, @@ -268,7 +268,7 @@ void CXFA_TextParser::ParseRichText(CFDE_XMLNode* pXMLNode, if (!tagProvider.m_bTagAvailable) return; - IFDE_CSSComputedStyle* pNewStyle = NULL; + IFDE_CSSComputedStyle* pNewStyle = nullptr; if ((tagProvider.GetTagName() != FX_WSTRC(L"body")) || (tagProvider.GetTagName() != FX_WSTRC(L"html"))) { CXFA_TextParseContext* pTextContext = @@ -545,7 +545,7 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, CFDE_XMLNode* pXMLNode, CFX_WideString& wsValue) { wsValue.clear(); - if (pXMLNode == NULL) { + if (!pXMLNode) { return FALSE; } FX_BOOL bRet = FALSE; @@ -602,7 +602,7 @@ enum XFA_TABSTOPSSTATUS { FX_BOOL CXFA_TextParser::GetTabstops( IFDE_CSSComputedStyle* pStyle, CXFA_TextTabstopsContext* pTabstopContext) { - if (pStyle == NULL || pTabstopContext == NULL) { + if (!pStyle || !pTabstopContext) { return FALSE; } CFX_WideString wsValue; @@ -716,7 +716,7 @@ const CXFA_PieceLineArray* CXFA_TextLayout::GetPieceLines() { return &m_pieceLines; } void CXFA_TextLayout::GetTextDataNode() { - if (m_pTextProvider == NULL) { + if (!m_pTextProvider) { return; } CXFA_Node* pNode = m_pTextProvider->GetTextNode(m_bRichText); @@ -726,7 +726,7 @@ void CXFA_TextLayout::GetTextDataNode() { m_pTextDataNode = pNode; } CFDE_XMLNode* CXFA_TextLayout::GetXMLContainerNode() { - CFDE_XMLNode* pXMLContainer = NULL; + CFDE_XMLNode* pXMLContainer = nullptr; if (m_bRichText) { CFDE_XMLNode* pXMLRoot = m_pTextDataNode->GetXMLMappingNode(); if (!pXMLRoot) { @@ -758,8 +758,8 @@ CFX_RTFBreak* CXFA_TextLayout::CreateBreak(FX_BOOL bDefault) { pBreak->SetLayoutStyles(dwStyle); pBreak->SetLineBreakChar(L'\n'); pBreak->SetLineBreakTolerance(1); - pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, NULL)); - pBreak->SetFontSize(m_textParser.GetFontSize(m_pTextProvider, NULL)); + pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, nullptr)); + pBreak->SetFontSize(m_textParser.GetFontSize(m_pTextProvider, nullptr)); return pBreak; } void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) { @@ -808,9 +808,9 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) { m_pBreak->SetVerticalScale((int32_t)font.GetVerticalScale()); m_pBreak->SetCharSpace(font.GetLetterSpacing()); } - FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, NULL); + FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, nullptr); m_pBreak->SetFontSize(fFontSize); - m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, NULL)); + m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, nullptr)); m_pBreak->SetLineBreakTolerance(fFontSize * 0.2f); } void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle* pStyle, @@ -818,7 +818,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle* pStyle, FX_FLOAT fLineWidth, CFDE_XMLNode* pXMLNode, IFDE_CSSComputedStyle* pParentStyle) { - if (pStyle == NULL) { + if (!pStyle) { InitBreak(fLineWidth); return; } @@ -908,7 +908,7 @@ int32_t CXFA_TextLayout::GetText(CFX_WideString& wsText) { return wsText.GetLength(); } FX_FLOAT CXFA_TextLayout::GetLayoutHeight() { - if (m_pLoader == NULL) { + if (!m_pLoader) { return 0; } int32_t iCount = m_pLoader->m_lineHeights.GetSize(); @@ -957,7 +957,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, FX_FLOAT& fCalcHeight, FX_FLOAT fContentAreaHeight, FX_FLOAT fTextHeight) { - if (m_pLoader == NULL) { + if (!m_pLoader) { return FALSE; } int32_t iBlockCount = m_Blocks.GetSize(); @@ -1051,7 +1051,7 @@ FX_BOOL CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize, m_fMaxWidth = 0; Loader(defaultSize, fLinePos, FALSE); if (fLinePos < 0.1f) - fLinePos = m_textParser.GetFontSize(m_pTextProvider, NULL); + fLinePos = m_textParser.GetFontSize(m_pTextProvider, nullptr); m_pTabstopContext.reset(); defaultSize = CFX_SizeF(m_fMaxWidth, fLinePos); @@ -1079,7 +1079,7 @@ FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) { } FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { - if (m_pLoader == NULL || iBlock < 0 || iBlock >= CountBlocks()) + if (!m_pLoader || iBlock < 0 || iBlock >= CountBlocks()) return FALSE; if (m_pLoader->m_fWidth < 1) return FALSE; @@ -1087,7 +1087,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { m_pLoader->m_iTotalLines = -1; m_iLines = 0; FX_FLOAT fLinePos = 0; - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; CFX_SizeF szText(m_pLoader->m_fWidth, m_pLoader->m_fHeight); int32_t iCount = m_Blocks.GetSize(); int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize(); @@ -1133,7 +1133,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { if (pXMLNode == pContainerNode) break; if (!LoadRichText(pXMLNode, szText, fLinePos, m_pLoader->m_pParentStyle, - TRUE, NULL, FALSE)) { + TRUE, nullptr, FALSE)) { break; } pSaveXMLNode = pXMLNode; @@ -1222,7 +1222,7 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, Layout(i); } } - FXTEXT_CHARPOS* pCharPos = NULL; + FXTEXT_CHARPOS* pCharPos = nullptr; int32_t iCharCount = 0; int32_t iLineStart = 0; int32_t iPieceLines = m_pieceLines.GetSize(); @@ -1356,7 +1356,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, FX_BOOL bEndBreak, FX_BOOL bIsOl, int32_t iLiCount) { - if (pXMLNode == NULL) { + if (!pXMLNode) { return FALSE; } CXFA_TextParseContext* pContext = @@ -1364,12 +1364,12 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, FDE_CSSDISPLAY eDisplay = FDE_CSSDISPLAY_None; FX_BOOL bContentNode = FALSE; FX_FLOAT fSpaceBelow = 0; - IFDE_CSSComputedStyle* pStyle = NULL; + IFDE_CSSComputedStyle* pStyle = nullptr; CFX_WideString wsName; if (bEndBreak) { FX_BOOL bCurOl = FALSE; FX_BOOL bCurLi = FALSE; - CFDE_XMLElement* pElement = NULL; + CFDE_XMLElement* pElement = nullptr; if (pContext) { if (m_bBlockContinue || (m_pLoader && pXMLNode == m_pLoader->m_pXMLNode)) { @@ -1465,7 +1465,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } } if (wsText.GetLength() > 0) { - if (m_pLoader == NULL || m_pLoader->m_iChar == 0) { + if (!m_pLoader || m_pLoader->m_iChar == 0) { if (pLinkData) { pLinkData->Retain(); } @@ -1629,10 +1629,10 @@ void CXFA_TextLayout::EndBreak(uint32_t dwStatus, } void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine) { - if (m_pTabstopContext == NULL || m_pTabstopContext->m_iTabCount == 0) { + if (!m_pTabstopContext || m_pTabstopContext->m_iTabCount == 0) { return; } - if (pStyle == NULL || pPieceLine == NULL) { + if (!pStyle || !pPieceLine) { return; } int32_t iPieces = pPieceLine->m_textPieces.GetSize(); @@ -1691,7 +1691,7 @@ void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus, if (iPieces < 1) { return; } - IFDE_CSSComputedStyle* pStyle = NULL; + IFDE_CSSComputedStyle* pStyle = nullptr; if (bSavePieces) { CXFA_PieceLine* pPieceLine = FXTARGET_NewWith(m_pAllocator.get()) CXFA_PieceLine; @@ -1748,7 +1748,7 @@ void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus, pUserData->m_pLinkData->Retain(); pTP->pLinkData = pUserData->m_pLinkData; } else { - pTP->pLinkData = NULL; + pTP->pLinkData = nullptr; } DoTabstops(pStyle, pPieceLine); } @@ -1958,7 +1958,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece, FXTEXT_CHARPOS* pCharPos, FX_BOOL bCharCode) { - if (pPiece == NULL) { + if (!pPiece) { return 0; } FX_RTFTEXTOBJ tr; diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index 00e7209e97..33dc345e30 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -266,7 +266,7 @@ class CXFA_TextLayout { FX_BOOL CalcSize(const CFX_SizeF& minSize, const CFX_SizeF& maxSize, CFX_SizeF& defaultSize); - FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = NULL); + FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr); void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex); FX_BOOL DrawString(CFX_RenderDevice* pFxDevice, const CFX_Matrix& tmDoc2Device, @@ -288,7 +288,7 @@ class CXFA_TextLayout { FDE_CSSDISPLAY eDisplay, FX_FLOAT fLineWidth, CFDE_XMLNode* pXMLNode, - IFDE_CSSComputedStyle* pParentStyle = NULL); + IFDE_CSSComputedStyle* pParentStyle = nullptr); FX_BOOL Loader(const CFX_SizeF& szText, FX_FLOAT& fLinePos, FX_BOOL bSavePieces = TRUE); @@ -301,7 +301,7 @@ class CXFA_TextLayout { FX_FLOAT& fLinePos, IFDE_CSSComputedStyle* pParentStyle, FX_BOOL bSavePieces, - CXFA_LinkUserData* pLinkData = NULL, + CXFA_LinkUserData* pLinkData = nullptr, FX_BOOL bEndBreak = TRUE, FX_BOOL bIsOl = FALSE, int32_t iLiCount = 0); diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp index ebe68b9408..bc7b91b4e6 100644 --- a/xfa/fxfa/fm2js/xfa_fmparse.cpp +++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp @@ -514,7 +514,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePrimaryExpression() { if (m_pToken->m_type == TOKlbracket) { CXFA_FMSimpleExpression* s = ParseIndexExpression(); if (s) { - e.reset(new CXFA_FMDotAccessorExpression(line, NULL, TOKdot, + e.reset(new CXFA_FMDotAccessorExpression(line, nullptr, TOKdot, wsIdentifier, s)); } NextToken(); @@ -661,7 +661,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( s.release()); } else { CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression( - tempLine, ACCESSOR_NO_INDEX, NULL, FALSE); + tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE); e = new CXFA_FMDotAccessorExpression(line, e, TOKdot, tempStr, s); continue; } @@ -688,7 +688,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( tempStr, s.release()); } else { CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression( - tempLine, ACCESSOR_NO_INDEX, NULL, FALSE); + tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE); e = new CXFA_FMDotDotAccessorExpression(line, e, TOKdotdot, tempStr, s); continue; @@ -716,7 +716,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( tempStr, s.release()); } else { CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression( - tempLine, ACCESSOR_NO_INDEX, NULL, FALSE); + tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE); e = new CXFA_FMDotAccessorExpression(line, e, TOKdotscream, tempStr, s); continue; @@ -730,7 +730,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( break; case TOKdotstar: { CXFA_FMSimpleExpression* s = - new CXFA_FMIndexExpression(line, ACCESSOR_NO_INDEX, NULL, FALSE); + new CXFA_FMIndexExpression(line, ACCESSOR_NO_INDEX, nullptr, FALSE); e = new CXFA_FMDotAccessorExpression(line, e, TOKdotstar, FX_WSTRC(L"*"), s); } break; diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h index 4541cba9c2..04962937e3 100644 --- a/xfa/fxfa/include/fxfa.h +++ b/xfa/fxfa/include/fxfa.h @@ -313,7 +313,7 @@ class IXFA_DocProvider { CFX_RectF& rtPopup) = 0; virtual FX_BOOL PopupMenu(CXFA_FFWidget* hWidget, CFX_PointF ptPopup, - const CFX_RectF* pRectExclude = NULL) = 0; + const CFX_RectF* pRectExclude = nullptr) = 0; virtual void PageViewEvent(CXFA_FFPageView* pPageView, uint32_t dwFlags) = 0; virtual void WidgetPostAdd(CXFA_FFWidget* hWidget, CXFA_WidgetAcc* pWidgetData) = 0; diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h index cf52bbe205..fa6d7fa49d 100644 --- a/xfa/fxfa/include/fxfa_widget.h +++ b/xfa/fxfa/include/fxfa_widget.h @@ -70,7 +70,7 @@ class CXFA_WidgetAcc : public CXFA_WidgetData { CFX_DIBitmap* GetImageEditImage(); void SetImageImage(CFX_DIBitmap* newImage); void SetImageEditImage(CFX_DIBitmap* newImage); - void UpdateUIDisplay(CXFA_FFWidget* pExcept = NULL); + void UpdateUIDisplay(CXFA_FFWidget* pExcept = nullptr); CXFA_Node* GetDatasets(); CFGAS_GEFont* GetFDEFont(); diff --git a/xfa/fxfa/include/xfa_ffdoc.h b/xfa/fxfa/include/xfa_ffdoc.h index af1f8d79cf..2ea829885c 100644 --- a/xfa/fxfa/include/xfa_ffdoc.h +++ b/xfa/fxfa/include/xfa_ffdoc.h @@ -31,7 +31,7 @@ class CXFA_FFDoc { IXFA_DocProvider* GetDocProvider() { return m_pDocProvider; } uint32_t GetDocType(); int32_t StartLoad(); - int32_t DoLoad(IFX_Pause* pPause = NULL); + int32_t DoLoad(IFX_Pause* pPause = nullptr); void StopLoad(); CXFA_FFDocView* CreateDocView(uint32_t dwView = 0); FX_BOOL OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile); diff --git a/xfa/fxfa/include/xfa_ffwidget.h b/xfa/fxfa/include/xfa_ffwidget.h index 9d337d7fbe..23a9a82c85 100644 --- a/xfa/fxfa/include/xfa_ffwidget.h +++ b/xfa/fxfa/include/xfa_ffwidget.h @@ -114,8 +114,8 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { CXFA_FFDoc* GetDoc(); CXFA_FFApp* GetApp(); IXFA_AppProvider* GetAppProvider(); - void InvalidateWidget(const CFX_RectF* pRect = NULL); - void AddInvalidateRect(const CFX_RectF* pRect = NULL); + void InvalidateWidget(const CFX_RectF* pRect = nullptr); + void AddInvalidateRect(const CFX_RectF* pRect = nullptr); FX_BOOL GetCaptionText(CFX_WideString& wsCap); bool IsFocused(); void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy); diff --git a/xfa/fxfa/include/xfa_ffwidgethandler.h b/xfa/fxfa/include/xfa_ffwidgethandler.h index 4aa86d21f0..1cd28ce2f0 100644 --- a/xfa/fxfa/include/xfa_ffwidgethandler.h +++ b/xfa/fxfa/include/xfa_ffwidgethandler.h @@ -23,7 +23,7 @@ class CXFA_FFWidgetHandler { CXFA_FFWidget* CreateWidget(CXFA_FFWidget* hParent, XFA_WIDGETTYPE eType, - CXFA_FFWidget* hBefore = NULL); + CXFA_FFWidget* hBefore = nullptr); FX_BOOL OnMouseEnter(CXFA_FFWidget* hWidget); FX_BOOL OnMouseExit(CXFA_FFWidget* hWidget); @@ -111,7 +111,7 @@ class CXFA_FFWidgetHandler { CXFA_Node* pBefore) const; CXFA_Node* CreateCopyNode(XFA_Element eElement, CXFA_Node* pParent, - CXFA_Node* pBefore = NULL) const; + CXFA_Node* pBefore = nullptr) const; CXFA_Node* CreateTemplateNode(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const; diff --git a/xfa/fxfa/include/xfa_rendercontext.h b/xfa/fxfa/include/xfa_rendercontext.h index 7716c7140b..8bd6a287a3 100644 --- a/xfa/fxfa/include/xfa_rendercontext.h +++ b/xfa/fxfa/include/xfa_rendercontext.h @@ -28,7 +28,7 @@ class CXFA_RenderContext { CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options); - int32_t DoRender(IFX_Pause* pPause = NULL); + int32_t DoRender(IFX_Pause* pPause = nullptr); void StopRender(); protected: diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp index cb5cf7f6b9..95b247a371 100644 --- a/xfa/fxfa/parser/cxfa_box.cpp +++ b/xfa/fxfa/parser/cxfa_box.cpp @@ -13,7 +13,7 @@ namespace { void GetStrokesInternal(CXFA_Node* pNode, CXFA_StrokeArray& strokes, - FX_BOOL bNULL) { + FX_BOOL bNull) { strokes.RemoveAll(); if (!pNode) return; @@ -25,7 +25,7 @@ void GetStrokesInternal(CXFA_Node* pNode, CXFA_Corner(pNode->GetProperty(i, XFA_Element::Corner, i == 0)); if (corner || i == 0) strokes.SetAt(j, corner); - else if (bNULL) + else if (bNull) strokes.SetAt(j, CXFA_Stroke(nullptr)); else if (i == 1) strokes.SetAt(j, strokes[0]); @@ -39,7 +39,7 @@ void GetStrokesInternal(CXFA_Node* pNode, CXFA_Edge(pNode->GetProperty(i, XFA_Element::Edge, i == 0)); if (edge || i == 0) strokes.SetAt(j, edge); - else if (bNULL) + else if (bNull) strokes.SetAt(j, CXFA_Stroke(nullptr)); else if (i == 1) strokes.SetAt(j, strokes[1]); @@ -159,7 +159,7 @@ int32_t CXFA_Box::Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const { CXFA_StrokeArray strokes; GetStrokesInternal(m_pNode, strokes, TRUE); - CXFA_Stroke stroke(NULL); + CXFA_Stroke stroke(nullptr); int32_t iType = Style3D(strokes, stroke); if (iType) { bVisible = stroke.IsVisible(); diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 07ed3b36c1..d241772fe3 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -76,7 +76,7 @@ CXFA_WidgetData::CXFA_WidgetData(CXFA_Node* pNode) : CXFA_Data(pNode), m_bIsNull(TRUE), m_bPreNull(TRUE), - m_pUiChildNode(NULL), + m_pUiChildNode(nullptr), m_eUIType(XFA_Element::Unknown) {} CXFA_Node* CXFA_WidgetData::GetUIChild() { @@ -441,12 +441,12 @@ void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify) { CXFA_Node* CXFA_WidgetData::GetExclGroupNode() { CXFA_Node* pExcl = ToNode(m_pNode->GetNodeItem(XFA_NODEITEM_Parent)); if (!pExcl || pExcl->GetElementType() != XFA_Element::ExclGroup) - return NULL; + return nullptr; return pExcl; } CXFA_Node* CXFA_WidgetData::GetSelectedMember() { - CXFA_Node* pSelectedMember = NULL; + CXFA_Node* pSelectedMember = nullptr; CFX_WideString wsState = GetRawValue(); if (wsState.IsEmpty()) return pSelectedMember; @@ -516,7 +516,7 @@ void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue, CXFA_Node* CXFA_WidgetData::GetExclGroupFirstMember() { CXFA_Node* pExcl = GetNode(); if (!pExcl) - return NULL; + return nullptr; CXFA_Node* pNode = pExcl->GetNodeItem(XFA_NODEITEM_FirstChild); while (pNode) { @@ -525,11 +525,11 @@ CXFA_Node* CXFA_WidgetData::GetExclGroupFirstMember() { pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); } - return NULL; + return nullptr; } CXFA_Node* CXFA_WidgetData::GetExclGroupNextMember(CXFA_Node* pNode) { if (!pNode) - return NULL; + return nullptr; CXFA_Node* pNodeField = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); while (pNodeField) { @@ -538,7 +538,7 @@ CXFA_Node* CXFA_WidgetData::GetExclGroupNextMember(CXFA_Node* pNode) { pNodeField = pNodeField->GetNodeItem(XFA_NODEITEM_NextSibling); } - return NULL; + return nullptr; } int32_t CXFA_WidgetData::GetChoiceListCommitOn() { @@ -573,7 +573,7 @@ FX_BOOL CXFA_WidgetData::IsListBox() { int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { CXFA_NodeArray pItems; - CXFA_Node* pItem = NULL; + CXFA_Node* pItem = nullptr; int32_t iCount = 0; CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -639,7 +639,7 @@ FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray& wsTextArray, FX_BOOL bSaveValue) { CXFA_NodeArray pItems; - CXFA_Node* pItem = NULL; + CXFA_Node* pItem = nullptr; int32_t iCount = 0; CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -943,7 +943,7 @@ void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue, } else { CXFA_Node* pLabelItems = listitems[0]; FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); - CXFA_Node* pSaveItems = NULL; + CXFA_Node* pSaveItems = nullptr; if (bSave) { pSaveItems = pLabelItems; pLabelItems = listitems[1]; @@ -989,7 +989,7 @@ void CXFA_WidgetData::GetItemValue(const CFX_WideStringC& wsLabel, } else { CXFA_Node* pLabelItems = listitems[0]; FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save); - CXFA_Node* pSaveItems = NULL; + CXFA_Node* pSaveItems = nullptr; if (bSave) { pSaveItems = pLabelItems; pLabelItems = listitems[1]; @@ -1462,22 +1462,15 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture, } IFX_Locale* CXFA_WidgetData::GetLocal() { - IFX_Locale* pLocale = NULL; if (!m_pNode) - return pLocale; + return nullptr; - FX_BOOL bLocale = FALSE; CFX_WideString wsLocaleName; - bLocale = m_pNode->GetLocaleName(wsLocaleName); - if (bLocale) { - if (wsLocaleName == FX_WSTRC(L"ambient")) { - pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetDefLocale(); - } else { - pLocale = - m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName); - } - } - return pLocale; + if (!m_pNode->GetLocaleName(wsLocaleName)) + return nullptr; + if (wsLocaleName == FX_WSTRC(L"ambient")) + return m_pNode->GetDocument()->GetLocalMgr()->GetDefLocale(); + return m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName); } FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, diff --git a/xfa/fxfa/parser/xfa_basic_data.cpp b/xfa/fxfa/parser/xfa_basic_data.cpp index 1a9ad1ade3..62972cb995 100644 --- a/xfa/fxfa/parser/xfa_basic_data.cpp +++ b/xfa/fxfa/parser/xfa_basic_data.cpp @@ -321,9 +321,9 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0x21aed, L"id", XFA_ATTRIBUTE_Id, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x25363, L"to", XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Config, (void*)NULL}, + XFA_XDPPACKET_Config, nullptr}, {0xcb0ac9, L"lineThrough", XFA_ATTRIBUTE_LineThrough, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, @@ -335,18 +335,18 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)L"Courier"}, {0x3106c3a, L"beforeTarget", XFA_ATTRIBUTE_BeforeTarget, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x31b19c1, L"name", XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Datasets | XFA_XDPPACKET_Form | XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x3848b3f, L"next", XFA_ATTRIBUTE_Next, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_None}, {0x43e349b, L"dataRowCount", XFA_ATTRIBUTE_DataRowCount, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x5518c25, L"break", XFA_ATTRIBUTE_Break, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Close}, @@ -369,21 +369,21 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_Square}, {0xb3543a6, L"max", XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xb356ca4, L"min", XFA_ATTRIBUTE_Min, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1}, {0xbb8df5d, L"ref", XFA_ATTRIBUTE_Ref, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xbb8f3df, L"rid", XFA_ATTRIBUTE_Rid, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xc080cd3, L"url", XFA_ATTRIBUTE_Url, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xc0811ed, L"use", XFA_ATTRIBUTE_Use, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xcfea02e, L"leftInset", XFA_ATTRIBUTE_LeftInset, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, @@ -396,7 +396,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)(g_XFAMeasurementData + 0)}, {0x13a08bdb, L"overflowTarget", XFA_ATTRIBUTE_OverflowTarget, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x1414d431, L"allowMacro", XFA_ATTRIBUTE_AllowMacro, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, @@ -405,31 +405,31 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_Any}, {0x1517dfa1, L"columnWidths", XFA_ATTRIBUTE_ColumnWidths, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x169134a1, L"overflowLeader", XFA_ATTRIBUTE_OverflowLeader, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x1b8dce3e, L"action", XFA_ATTRIBUTE_Action, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Include}, {0x1e459b8f, L"nonRepudiation", XFA_ATTRIBUTE_NonRepudiation, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x1ec8ab2c, L"rate", XFA_ATTRIBUTE_Rate, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)50}, {0x1ef3a64a, L"allowRichText", XFA_ATTRIBUTE_AllowRichText, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x2038c9b2, L"role", XFA_ATTRIBUTE_Role, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x20914367, L"overflowTrailer", XFA_ATTRIBUTE_OverflowTrailer, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x226ca8f1, L"operation", XFA_ATTRIBUTE_Operation, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x24d85167, L"timeout", XFA_ATTRIBUTE_Timeout, XFA_ATTRIBUTETYPE_NOTSURE, - XFA_XDPPACKET_SourceSet, (void*)NULL}, + XFA_XDPPACKET_SourceSet, nullptr}, {0x25764436, L"topInset", XFA_ATTRIBUTE_TopInset, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, @@ -441,7 +441,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_Unknown}, {0x28dee6e9, L"format", XFA_ATTRIBUTE_Format, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x28e17e91, L"dataPrep", XFA_ATTRIBUTE_DataPrep, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_None}, @@ -453,10 +453,10 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, {0x2b5df51e, L"dataDescription", XFA_ATTRIBUTE_DataDescription, - XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_ConnectionSet, (void*)NULL}, + XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_ConnectionSet, nullptr}, {0x2bb3f470, L"encipherOnly", XFA_ATTRIBUTE_EncipherOnly, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x2cd79033, L"kerningMode", XFA_ATTRIBUTE_KerningMode, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_None}, @@ -467,7 +467,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)7}, {0x2f16a382, L"type", XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_NOTSURE, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x34ae103c, L"reserve", XFA_ATTRIBUTE_Reserve, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 4)}, @@ -490,11 +490,11 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_RefOnly}, {0x4156ee3f, L"delimiter", XFA_ATTRIBUTE_Delimiter, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x42fed1fd, L"contentType", XFA_ATTRIBUTE_ContentType, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Datasets | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x453eaf38, L"startNew", XFA_ATTRIBUTE_StartNew, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x45a6daf8, L"eofAction", XFA_ATTRIBUTE_EofAction, XFA_ATTRIBUTETYPE_Enum, @@ -504,7 +504,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)0}, {0x47d03490, L"connection", XFA_ATTRIBUTE_Connection, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x4873c601, L"baselineShift", XFA_ATTRIBUTE_BaselineShift, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, @@ -518,7 +518,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Portrait}, {0x4fdc3454, L"timeStamp", XFA_ATTRIBUTE_TimeStamp, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_XDP, (void*)NULL}, + XFA_XDPPACKET_XDP, nullptr}, {0x52666f1c, L"printCheckDigit", XFA_ATTRIBUTE_PrintCheckDigit, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, @@ -534,7 +534,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0x54fa722c, L"transferEncoding", XFA_ATTRIBUTE_TransferEncoding, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x552d9ad5, L"usage", XFA_ATTRIBUTE_Usage, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_ExportAndImport}, @@ -545,16 +545,16 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, {0x577682ac, L"preserve", XFA_ATTRIBUTE_Preserve, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x58be2870, L"aliasNode", XFA_ATTRIBUTE_AliasNode, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_UNKNOWN, (void*)0}, {0x5a32e493, L"multiLine", XFA_ATTRIBUTE_MultiLine, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x5a50e9e6, L"version", XFA_ATTRIBUTE_Version, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x5ab23b6c, L"startChar", XFA_ATTRIBUTE_StartChar, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x5b707a35, L"scriptTest", XFA_ATTRIBUTE_ScriptTest, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Error}, @@ -566,14 +566,14 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_ForwardOnly}, {0x5f760b50, L"digitalSignature", XFA_ATTRIBUTE_DigitalSignature, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x60a61edd, L"codeType", XFA_ATTRIBUTE_CodeType, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x60d4c8b1, L"output", XFA_ATTRIBUTE_Output, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_ConnectionSet, (void*)NULL}, + XFA_XDPPACKET_ConnectionSet, nullptr}, {0x64110ab5, L"bookendTrailer", XFA_ATTRIBUTE_BookendTrailer, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x65e30c67, L"imagingBBox", XFA_ATTRIBUTE_ImagingBBox, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)L"none"}, @@ -581,9 +581,9 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x66642f8f, L"force", XFA_ATTRIBUTE_Force, XFA_ATTRIBUTETYPE_Boolean, - XFA_XDPPACKET_Config, (void*)NULL}, + XFA_XDPPACKET_Config, nullptr}, {0x69aa2292, L"crlSign", XFA_ATTRIBUTE_CrlSign, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x6a3405dd, L"previous", XFA_ATTRIBUTE_Previous, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_None}, @@ -607,7 +607,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)0}, {0x79543055, L"letterSpacing", XFA_ATTRIBUTE_LetterSpacing, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x79975f2b, L"lockType", XFA_ATTRIBUTE_LockType, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_SourceSet, (void*)XFA_ATTRIBUTEENUM_ReadOnly}, {0x7a0cc471, L"passwordChar", XFA_ATTRIBUTE_PasswordChar, @@ -645,14 +645,14 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Position}, {0x7f6fd3d7, L"server", XFA_ATTRIBUTE_Server, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x824f21b7, L"embedPDF", XFA_ATTRIBUTE_EmbedPDF, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x8340ea66, L"oddOrEven", XFA_ATTRIBUTE_OddOrEven, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Any}, {0x836d4d7c, L"tabDefault", XFA_ATTRIBUTE_TabDefault, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x8855805f, L"contains", XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Datasets, (void*)XFA_ATTRIBUTEENUM_Data}, {0x8a692521, L"rightInset", XFA_ATTRIBUTE_RightInset, @@ -664,12 +664,12 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_UserControl}, {0x8c99377e, L"relation", XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_NOTSURE, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x8d181d61, L"wideNarrowRatio", XFA_ATTRIBUTE_WideNarrowRatio, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)L"3:1"}, {0x8e1c2921, L"relevant", XFA_ATTRIBUTE_Relevant, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x8e29d794, L"signatureType", XFA_ATTRIBUTE_SignatureType, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Filter}, @@ -680,7 +680,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Square}, {0x8fa01790, L"tabStops", XFA_ATTRIBUTE_TabStops, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0x8fc36c0a, L"outputBelow", XFA_ATTRIBUTE_OutputBelow, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config, (void*)XFA_ATTRIBUTEENUM_Warn}, @@ -701,10 +701,10 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)3}, {0x98fd4d81, L"keyAgreement", XFA_ATTRIBUTE_KeyAgreement, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x99800d7a, L"errorCorrectionLevel", XFA_ATTRIBUTE_ErrorCorrectionLevel, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0x9a63da3d, L"upsMode", XFA_ATTRIBUTE_UpsMode, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_UsCarrier}, @@ -714,11 +714,11 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0x9d833d75, L"circular", XFA_ATTRIBUTE_Circular, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0x9d8ee204, L"psName", XFA_ATTRIBUTE_PsName, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Config, (void*)NULL}, + XFA_XDPPACKET_Config, nullptr}, {0x9dcc3ab3, L"trailer", XFA_ATTRIBUTE_Trailer, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xa0933954, L"unicodeRange", XFA_ATTRIBUTE_UnicodeRange, - XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Config, (void*)NULL}, + XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Config, nullptr}, {0xa1b0d2f5, L"executeType", XFA_ATTRIBUTE_ExecuteType, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Import}, @@ -739,7 +739,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_Auto}, {0xa66404cb, L"keyEncipherment", XFA_ATTRIBUTE_KeyEncipherment, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xa6710262, L"credentialServerPolicy", XFA_ATTRIBUTE_CredentialServerPolicy, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, @@ -758,22 +758,21 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0xac06e2b0, L"colSpan", XFA_ATTRIBUTE_ColSpan, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1}, {0xadc4c77b, L"binding", XFA_ATTRIBUTE_Binding, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xaf754613, L"checksum", XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_NOTSURE, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form | XFA_XDPPACKET_Form, - (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form | XFA_XDPPACKET_Form, nullptr}, {0xb045fbc5, L"charEncoding", XFA_ATTRIBUTE_CharEncoding, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)L"UTF-8"}, {0xb0e5485d, L"bind", XFA_ATTRIBUTE_Bind, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_SourceSet, (void*)NULL}, + XFA_XDPPACKET_SourceSet, nullptr}, {0xb12128b7, L"textEntry", XFA_ATTRIBUTE_TextEntry, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0xb373a862, L"archive", XFA_ATTRIBUTE_Archive, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xb598a1f7, L"uuid", XFA_ATTRIBUTE_Uuid, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_XDP, (void*)NULL}, + XFA_XDPPACKET_XDP, nullptr}, {0xb5e49bf2, L"posture", XFA_ATTRIBUTE_Posture, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Normal}, @@ -783,13 +782,13 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0xb716467b, L"orphans", XFA_ATTRIBUTE_Orphans, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0xbc0c4695, L"qualifiedName", XFA_ATTRIBUTE_QualifiedName, - XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_UNKNOWN, (void*)NULL}, + XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_UNKNOWN, nullptr}, {0xbc254332, L"usehref", XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xbc8fa350, L"locale", XFA_ATTRIBUTE_Locale, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xbd6e1d88, L"weight", XFA_ATTRIBUTE_Weight, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Normal}, @@ -800,49 +799,49 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Link}, {0xbe52dfbf, L"desc", XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet, (void*)NULL}, + XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet, nullptr}, {0xbe9ba472, L"numbered", XFA_ATTRIBUTE_Numbered, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1}, {0xc035c6b1, L"dataColumnCount", XFA_ATTRIBUTE_DataColumnCount, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xc0ec9fa4, L"overline", XFA_ATTRIBUTE_Overline, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0xc2ba0923, L"urlPolicy", XFA_ATTRIBUTE_UrlPolicy, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xc2bd40fd, L"anchorType", XFA_ATTRIBUTE_AnchorType, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_TopLeft}, {0xc39a88bd, L"labelRef", XFA_ATTRIBUTE_LabelRef, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xc3c1442f, L"bookendLeader", XFA_ATTRIBUTE_BookendLeader, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xc4547a08, L"maxLength", XFA_ATTRIBUTE_MaxLength, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*) - 1}, + (void*)-1}, {0xc4fed09b, L"accessKey", XFA_ATTRIBUTE_AccessKey, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xc5762157, L"cursorLocation", XFA_ATTRIBUTE_CursorLocation, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_SourceSet, (void*)XFA_ATTRIBUTEENUM_Client}, {0xc860f30a, L"delayedOpen", XFA_ATTRIBUTE_DelayedOpen, - XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet, (void*)NULL}, + XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet, nullptr}, {0xc8da4da7, L"target", XFA_ATTRIBUTE_Target, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xca5dc27c, L"dataEncipherment", XFA_ATTRIBUTE_DataEncipherment, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xcb150479, L"afterTarget", XFA_ATTRIBUTE_AfterTarget, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xcbcaf66d, L"leader", XFA_ATTRIBUTE_Leader, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xcca7897e, L"picker", XFA_ATTRIBUTE_Picker, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Host}, {0xcd7f7b54, L"from", XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config, (void*)NULL}, + XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config, nullptr}, {0xcea5e62c, L"baseProfile", XFA_ATTRIBUTE_BaseProfile, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Full}, @@ -850,7 +849,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Fit}, {0xd3c84d25, L"rowColumnRatio", XFA_ATTRIBUTE_RowColumnRatio, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xd4b01921, L"lineHeight", XFA_ATTRIBUTE_LineHeight, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 1)}, @@ -858,28 +857,28 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Inverted}, {0xd50f903a, L"valueRef", XFA_ATTRIBUTE_ValueRef, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xd52482e0, L"maxEntries", XFA_ATTRIBUTE_MaxEntries, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Config, (void*)5}, {0xd57c513c, L"dataLength", XFA_ATTRIBUTE_DataLength, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xd6128d8d, L"activity", XFA_ATTRIBUTE_Activity, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Click}, {0xd6a39990, L"input", XFA_ATTRIBUTE_Input, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_ConnectionSet, (void*)NULL}, + XFA_XDPPACKET_ConnectionSet, nullptr}, {0xd6e27f1d, L"value", XFA_ATTRIBUTE_Value, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Datasets | XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xd70798c2, L"blankOrNotBlank", XFA_ATTRIBUTE_BlankOrNotBlank, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Any}, {0xd861f8af, L"addRevocationInfo", XFA_ATTRIBUTE_AddRevocationInfo, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xd8f982bf, L"genericFamily", XFA_ATTRIBUTE_GenericFamily, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config, (void*)XFA_ATTRIBUTEENUM_Serif}, @@ -887,13 +886,13 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Even}, {0xdb55fec5, L"href", XFA_ATTRIBUTE_Href, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xdc75676c, L"textEncoding", XFA_ATTRIBUTE_TextEncoding, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xde7f92ba, L"leadDigits", XFA_ATTRIBUTE_LeadDigits, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*) - 1}, + (void*)-1}, {0xe11a2cbc, L"permissions", XFA_ATTRIBUTE_Permissions, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)2}, @@ -901,9 +900,9 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, {0xe1a26b56, L"codeBase", XFA_ATTRIBUTE_CodeBase, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xe349d044, L"stock", XFA_ATTRIBUTE_Stock, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xe372ae97, L"isNull", XFA_ATTRIBUTE_IsNull, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Datasets, (void*)0}, {0xe4c3a5e5, L"restoreState", XFA_ATTRIBUTE_RestoreState, @@ -923,7 +922,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_Square}, {0xe8f118a8, L"keyCertSign", XFA_ATTRIBUTE_KeyCertSign, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xe948b9a8, L"radius", XFA_ATTRIBUTE_Radius, XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)(g_XFAMeasurementData + 0)}, @@ -931,14 +930,14 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config, (void*)XFA_ATTRIBUTEENUM_Warn}, {0xea7090a0, L"override", XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_NOTSURE, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xeb091003, L"classId", XFA_ATTRIBUTE_ClassId, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xeb511b54, L"disable", XFA_ATTRIBUTE_Disable, XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0}, {0xeda9017a, L"scope", XFA_ATTRIBUTE_Scope, XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xf197844d, L"match", XFA_ATTRIBUTE_Match, XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Once}, @@ -952,7 +951,7 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config, (void*)XFA_ATTRIBUTEENUM_Asterisk}, {0xf575ca75, L"endChar", XFA_ATTRIBUTE_EndChar, XFA_ATTRIBUTETYPE_Cdata, - XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL}, + XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, nullptr}, {0xf6b47749, L"lock", XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Config, (void*)0}, {0xf6b4afb0, L"long", XFA_ATTRIBUTE_Long, XFA_ATTRIBUTETYPE_Measure, @@ -963,10 +962,10 @@ const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { (void*)XFA_ATTRIBUTEENUM_None}, {0xf889e747, L"xdpContent", XFA_ATTRIBUTE_XdpContent, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, {0xfea53ec6, L"decipherOnly", XFA_ATTRIBUTE_DecipherOnly, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, - (void*)NULL}, + nullptr}, }; const int32_t g_iXFAAttributeCount = sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO); @@ -983,7 +982,7 @@ const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_Element::CalendarSymbols, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_Gregorian}, {XFA_Element::Barcode, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, + nullptr}, {XFA_Element::Barcode, XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_None}, {XFA_Element::TimePattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, @@ -1016,10 +1015,8 @@ const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { (void*)XFA_ATTRIBUTEENUM_Optional}, {XFA_Element::PageSet, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_OrderedOccurrence}, - {XFA_Element::Equate, XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, - {XFA_Element::Equate, XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, + {XFA_Element::Equate, XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata, nullptr}, + {XFA_Element::Equate, XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata, nullptr}, {XFA_Element::Traverse, XFA_ATTRIBUTE_Operation, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_Next}, {XFA_Element::Encodings, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum, @@ -1037,9 +1034,9 @@ const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_Element::CurrencySymbol, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_Symbol}, {XFA_Element::EquateRange, XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, + nullptr}, {XFA_Element::EquateRange, XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, + nullptr}, {XFA_Element::SignData, XFA_ATTRIBUTE_Operation, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_Sign}, {XFA_Element::DatePattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, @@ -1051,7 +1048,7 @@ const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_Element::AppearanceFilter, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum, (void*)XFA_ATTRIBUTEENUM_Optional}, {XFA_Element::Form, XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_Cdata, - (void*)NULL}, + nullptr}, {XFA_Element::Value, XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_Boolean, (void*)0}, {XFA_Element::Calculate, XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_Enum, @@ -3393,7 +3390,7 @@ const uint8_t g_XFAElementAttributeData[] = { }; const XFA_PACKETINFO g_XFAPacketData[] = { - {0x0, NULL, XFA_XDPPACKET_USER, NULL, + {0x0, nullptr, XFA_XDPPACKET_USER, nullptr, XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTMANY}, {0x811929d, L"sourceSet", XFA_XDPPACKET_SourceSet, L"http://www.xfa.org/schema/xfa-source-set/", diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp index 67a110b4e5..3d630d9247 100644 --- a/xfa/fxfa/parser/xfa_basic_imp.cpp +++ b/xfa/fxfa/parser/xfa_basic_imp.cpp @@ -36,7 +36,7 @@ const XFA_PACKETINFO* XFA_GetPacketByName(const CFX_WideStringC& wsName) { iStart = iMid + 1; } } while (iStart <= iEnd); - return NULL; + return nullptr; } const XFA_PACKETINFO* XFA_GetPacketByID(uint32_t dwPacket) { @@ -52,7 +52,7 @@ const XFA_PACKETINFO* XFA_GetPacketByID(uint32_t dwPacket) { iStart = iMid + 1; } } while (iStart <= iEnd); - return NULL; + return nullptr; } const XFA_PACKETINFO* XFA_GetPacketByIndex(XFA_PACKET ePacket) { @@ -78,7 +78,7 @@ const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName( iStart = iMid + 1; } } while (iStart <= iEnd); - return NULL; + return nullptr; } const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName) { return g_XFAEnumData + eName; @@ -105,7 +105,8 @@ const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName) { return nullptr; } const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName) { - return (eName < g_iXFAAttributeCount) ? (g_XFAAttributeData + eName) : NULL; + return (eName < g_iXFAAttributeCount) ? (g_XFAAttributeData + eName) + : nullptr; } FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, XFA_Element eElement, @@ -113,7 +114,7 @@ FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, XFA_ATTRIBUTETYPE eType, uint32_t dwPacket) { const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttribute); - if (pInfo == NULL) { + if (!pInfo) { return FALSE; } if (dwPacket && (dwPacket & pInfo->dwPackets) == 0) { @@ -150,7 +151,7 @@ CFX_WideStringC XFA_GetAttributeDefaultValue_Cdata(XFA_Element eElement, XFA_ATTRIBUTETYPE_Cdata, dwPacket)) { return (const FX_WCHAR*)pValue; } - return NULL; + return nullptr; } FX_BOOL XFA_GetAttributeDefaultValue_Boolean(XFA_Element eElement, XFA_ATTRIBUTE eAttribute, @@ -230,7 +231,7 @@ const XFA_ATTRIBUTEINFO* XFA_GetAttributeOfElement(XFA_Element eElement, const XFA_PROPERTY* XFA_GetElementProperties(XFA_Element eElement, int32_t& iCount) { if (eElement == XFA_Element::Unknown) - return NULL; + return nullptr; const XFA_ELEMENTHIERARCHY* pElement = g_XFAElementPropertyIndex + static_cast<int32_t>(eElement); @@ -242,8 +243,8 @@ const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_Element eElement, uint32_t dwPacket) { int32_t iCount = 0; const XFA_PROPERTY* pProperty = XFA_GetElementProperties(eElement, iCount); - if (pProperty == NULL || iCount < 1) { - return NULL; + if (!pProperty || iCount < 1) { + return nullptr; } int32_t iStart = 0, iEnd = iCount - 1, iMid; do { @@ -258,13 +259,13 @@ const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_Element eElement, } } while (iStart <= iEnd); if (iStart > iEnd) { - return NULL; + return nullptr; } const XFA_ELEMENTINFO* pInfo = XFA_GetElementByID(eProperty); ASSERT(pInfo); if (dwPacket == XFA_XDPPACKET_UNKNOWN) return pProperty + iMid; - return (dwPacket & pInfo->dwPackets) ? (pProperty + iMid) : NULL; + return (dwPacket & pInfo->dwPackets) ? (pProperty + iMid) : nullptr; } const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, XFA_ATTRIBUTE eAttribute, @@ -278,7 +279,7 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, if (eType == XFA_ATTRIBUTETYPE_NOTSURE || eType == pAttr->eType) { return pAttr; } - return NULL; + return nullptr; } else { int32_t iBefore = iMid - 1; if (iBefore >= 0) { @@ -288,7 +289,7 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, if (eType == XFA_ATTRIBUTETYPE_NOTSURE || eType == pAttr->eType) { return pAttr; } - return NULL; + return nullptr; } iBefore--; if (iBefore < 0) { @@ -305,7 +306,7 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, if (eType == XFA_ATTRIBUTETYPE_NOTSURE || eType == pAttr->eType) { return pAttr; } - return NULL; + return nullptr; } iAfter++; if (iAfter > g_iXFANotsureCount - 1) { @@ -314,7 +315,7 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, pAttr = g_XFANotsureAttributes + iAfter; } } - return NULL; + return nullptr; } } else if (eElement < pAttr->eElement) { iEnd = iMid - 1; @@ -322,7 +323,7 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, iStart = iMid + 1; } } while (iStart <= iEnd); - return NULL; + return nullptr; } const XFA_METHODINFO* XFA_GetMethodByName(XFA_Element eElement, @@ -354,7 +355,7 @@ const XFA_METHODINFO* XFA_GetMethodByName(XFA_Element eElement, } while (iStart <= iEnd); iElementIndex = scriptIndex->wParentIndex; } - return NULL; + return nullptr; } const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName( XFA_Element eElement, @@ -385,7 +386,7 @@ const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName( } while (iStart <= iEnd); iElementIndex = scriptIndex->wParentIndex; } - return NULL; + return nullptr; } void CXFA_Measurement::Set(const CFX_WideStringC& wsMeasure) { if (wsMeasure.IsEmpty()) { @@ -588,7 +589,7 @@ uint16_t CXFA_WideTextRead::SetCodePage(uint16_t wCodePage) { IFX_Stream* CXFA_WideTextRead::CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength) { - return NULL; + return nullptr; } void CXFA_WideTextRead::Lock() {} diff --git a/xfa/fxfa/parser/xfa_basic_imp.h b/xfa/fxfa/parser/xfa_basic_imp.h index 1c79f5439e..3badbb463e 100644 --- a/xfa/fxfa/parser/xfa_basic_imp.h +++ b/xfa/fxfa/parser/xfa_basic_imp.h @@ -37,7 +37,7 @@ class CXFA_WideTextRead : public IFX_Stream { int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS, - int32_t const* pByteSize = NULL) override; + int32_t const* pByteSize = nullptr) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override {} diff --git a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp index 97ea8dd54b..bcd6a874b3 100644 --- a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp @@ -66,7 +66,7 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( XFA_Element eNodeType, const CFX_WideString& wsName) { if (!pDataParent) { - return NULL; + return nullptr; } CXFA_Node* pParentDDNode = pDataParent->GetDataDescriptionNode(); if (!pParentDDNode) { @@ -116,6 +116,6 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( pDataNode->SetFlag(XFA_NodeFlag_Initialized, false); return pDataNode; } - return NULL; + return nullptr; } } diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index d1aeae92dd..94aa07406b 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -142,7 +142,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, pWidgetData->GetSelectedItemsValue(wsSelTextArray); int32_t iSize = wsSelTextArray.GetSize(); if (iSize >= 1) { - CXFA_Node* pValue = NULL; + CXFA_Node* pValue = nullptr; for (int32_t i = 0; i < iSize; i++) { pValue = pDataNode->CreateSamePacketNode(XFA_Element::DataValue); pValue->SetCData(XFA_ATTRIBUTE_Name, L"value"); @@ -170,7 +170,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, pDataNode->SetAttributeValue(wsValue, wsFormatedValue); break; case XFA_Element::ExclGroup: { - CXFA_Node* pChecked = NULL; + CXFA_Node* pChecked = nullptr; CXFA_Node* pChild = pFormNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pChild->GetElementType() != XFA_Element::Field) { @@ -216,7 +216,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pValue = pChild->GetProperty(0, XFA_Element::Value); CXFA_Node* pItems = pChild->GetChild(0, XFA_Element::Items); CXFA_Node* pText = - pItems ? pItems->GetNodeItem(XFA_NODEITEM_FirstChild) : NULL; + pItems ? pItems->GetNodeItem(XFA_NODEITEM_FirstChild) : nullptr; if (pText) { pText = pText->GetNodeItem(XFA_NODEITEM_NextSibling); } @@ -340,7 +340,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, } static CXFA_Node* XFA_DataMerge_GetGlobalBinding(CXFA_Document* pDocument, uint32_t dwNameHash) { - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; pDocument->m_rgGlobalBinding.Lookup(dwNameHash, pNode); return pNode; } @@ -357,7 +357,7 @@ static CXFA_Node* XFA_DataMerge_ScopeMatchGlobalBinding( uint32_t dwNameHash, XFA_Element eMatchDataNodeType, FX_BOOL bUpLevel = TRUE) { - for (CXFA_Node *pCurDataScope = pDataScope, *pLastDataScope = NULL; + for (CXFA_Node *pCurDataScope = pDataScope, *pLastDataScope = nullptr; pCurDataScope && pCurDataScope->GetPacketID() == XFA_XDPPACKET_Datasets; pLastDataScope = pCurDataScope, pCurDataScope = @@ -387,7 +387,7 @@ static CXFA_Node* XFA_DataMerge_ScopeMatchGlobalBinding( break; } } - return NULL; + return nullptr; } static CXFA_Node* XFA_DataMerge_FindGlobalDataNode(CXFA_Document* pDocument, CFX_WideStringC wsName, @@ -455,14 +455,14 @@ static CXFA_Node* XFA_DataMerge_FindDataRefDataNode(CXFA_Document* pDocument, return pDocument->GetNotBindNode(rs.nodes); } if (rs.dwFlags == XFA_RESOLVENODE_RSTYPE_CreateNodeOne) { - CXFA_Object* pObject = (rs.nodes.GetSize() > 0) ? rs.nodes[0] : NULL; + CXFA_Object* pObject = (rs.nodes.GetSize() > 0) ? rs.nodes[0] : nullptr; CXFA_Node* pNode = ToNode(pObject); if (!bForceBind && pNode && pNode->HasBindItem()) { - pNode = NULL; + pNode = nullptr; } return pNode; } - return NULL; + return nullptr; } CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument, XFA_Element eType, @@ -476,7 +476,7 @@ CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument, return pFormChild; } } - return NULL; + return nullptr; } static FX_BOOL XFA_NeedGenerateForm(CXFA_Node* pTemplateChild, FX_BOOL bUseInstanceManager = TRUE) { @@ -498,8 +498,8 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, CXFA_Node* pTemplateNode, FX_BOOL bRecursive, CXFA_NodeArray* pSubformArray) { - CXFA_Node* pExistingNode = NULL; - if (pSubformArray == NULL) { + CXFA_Node* pExistingNode = nullptr; + if (!pSubformArray) { pExistingNode = XFA_DataMerge_FindFormDOMInstance( pDocument, pTemplateNode->GetElementType(), pTemplateNode->GetNameHash(), pFormParent); @@ -531,7 +531,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, return pExistingNode; } CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(FALSE); - pFormParent->InsertChild(pNewNode, NULL); + pFormParent->InsertChild(pNewNode, nullptr); if (bRecursive) { for (CXFA_Node* pTemplateChild = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -539,7 +539,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, XFA_NODEITEM_NextSibling)) { if (XFA_NeedGenerateForm(pTemplateChild)) { CXFA_Node* pNewChild = pTemplateChild->CloneTemplateToForm(TRUE); - pNewNode->InsertChild(pNewChild, NULL); + pNewNode->InsertChild(pNewChild, nullptr); } } } @@ -590,7 +590,7 @@ static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager( wsInstMgrNodeName = FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); - pFormParent->InsertChild(pNewNode, NULL); + pFormParent->InsertChild(pNewNode, nullptr); pNewNode->SetTemplateNode(pTemplateNode); return pNewNode; } @@ -612,7 +612,7 @@ static CXFA_Node* XFA_DataMerge_FindMatchingDataNode( pIterator = new CXFA_NodeIteratorTemplate< CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode>(pTemplateNode); } - CXFA_Node* pResult = NULL; + CXFA_Node* pResult = nullptr; for (CXFA_Node* pCurTemplateNode = pIterator->GetCurrent(); pCurTemplateNode;) { XFA_Element eMatchNodeType; @@ -751,20 +751,20 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( FX_BOOL bOneInstance, FX_BOOL bDataMerge) { XFA_Element eType = pTemplateNode->GetElementType(); - CXFA_Node* pOccurNode = NULL; - CXFA_Node* pFirstInstance = NULL; + CXFA_Node* pOccurNode = nullptr; + CXFA_Node* pFirstInstance = nullptr; FX_BOOL bUseInstanceManager = pFormParentNode->GetElementType() != XFA_Element::Area; - CXFA_Node* pInstMgrNode = NULL; + CXFA_Node* pInstMgrNode = nullptr; CXFA_NodeArray subformArray; - CXFA_NodeArray* pSearchArray = NULL; + CXFA_NodeArray* pSearchArray = nullptr; if (!bOneInstance && (eType == XFA_Element::SubformSet || eType == XFA_Element::Subform)) { pInstMgrNode = bUseInstanceManager ? XFA_NodeMerge_CloneOrMergeInstanceManager( pDocument, pFormParentNode, pTemplateNode, subformArray) - : NULL; + : nullptr; if (CXFA_Node* pOccurTemplateNode = pTemplateNode->GetFirstChildByClass(XFA_Element::Occur)) { pOccurNode = pInstMgrNode @@ -783,11 +783,11 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( if (pFormParentNode->GetElementType() == XFA_Element::PageArea) { bOneInstance = TRUE; if (subformArray.GetSize() < 1) { - pSearchArray = NULL; + pSearchArray = nullptr; } } else if ((pTemplateNode->GetNameHash() == 0) && (subformArray.GetSize() < 1)) { - pSearchArray = NULL; + pSearchArray = nullptr; } } } @@ -886,7 +886,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( if (eRelation != XFA_ATTRIBUTEENUM_Ordered && (pDataMatch = XFA_DataMerge_FindMatchingDataNode( pDocument, pTemplateChild, pDataScope, bAccessedDataDOM, - FALSE, NULL, bSelfMatch, eBindMatch)) != nullptr) { + FALSE, nullptr, bSelfMatch, eBindMatch)) != nullptr) { XFA_DataMerge_RecurseRecord sNewRecord = {pTemplateChild, pDataMatch}; if (bSelfMatch) { @@ -960,7 +960,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( if (pTemplateNode->GetNameHash() != 0) { break; } - pSearchArray = NULL; + pSearchArray = nullptr; } } else if (!XFA_DataMerge_FindFormDOMInstance( pDocument, pTemplateNode->GetElementType(), @@ -1036,7 +1036,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_Field(CXFA_Document* pDocument, pTemplateChildNode->IsContainerNode()) { if (pTemplateChildNode->GetElementType() == XFA_Element::Field) { XFA_DataMerge_CopyContainer_Field(pDocument, pTemplateChildNode, - pFieldNode, NULL, FALSE); + pFieldNode, nullptr, FALSE); } } } @@ -1045,7 +1045,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_Field(CXFA_Document* pDocument, FX_BOOL bSelfMatch = FALSE; XFA_ATTRIBUTEENUM eBindMatch; CXFA_Node* pDataNode = XFA_DataMerge_FindMatchingDataNode( - pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, TRUE, NULL, + pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, TRUE, nullptr, bSelfMatch, eBindMatch, bUpLevel); if (pDataNode) { XFA_DataMerge_CreateDataBinding(pFieldNode, pDataNode); @@ -1082,7 +1082,7 @@ CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode, ASSERT(FALSE); break; } - return NULL; + return nullptr; } static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, @@ -1098,7 +1098,7 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, CXFA_Node* pTemplateNode = pFormNode->GetTemplateNode(); CXFA_Node* pTemplateNodeBind = pTemplateNode ? pTemplateNode->GetFirstChildByClass(XFA_Element::Bind) - : NULL; + : nullptr; XFA_ATTRIBUTEENUM eMatch = pTemplateNodeBind ? pTemplateNodeBind->GetEnum(XFA_ATTRIBUTE_Match) : XFA_ATTRIBUTEENUM_Once; @@ -1179,7 +1179,8 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, XFA_RESOLVENODE_RS rs; pDocument->GetScriptContext()->ResolveObjects(pDataScope, wsRef, rs, dFlags, pTemplateNode); - CXFA_Object* pObject = (rs.nodes.GetSize() > 0) ? rs.nodes[0] : NULL; + CXFA_Object* pObject = + (rs.nodes.GetSize() > 0) ? rs.nodes[0] : nullptr; pDataNode = ToNode(pObject); if (pDataNode) { XFA_DataMerge_CreateDataBinding( @@ -1257,7 +1258,7 @@ void CXFA_Document::DoDataMerge() { m_pRootNode->InsertChild(pDatasetsRoot); pDatasetsRoot->SetXMLMappingNode(pDatasetsXMLNode); } - CXFA_Node *pDataRoot = NULL, *pDDRoot = NULL; + CXFA_Node *pDataRoot = nullptr, *pDDRoot = nullptr; CFX_WideString wsDatasetsURI; pDatasetsRoot->TryNamespace(wsDatasetsURI); for (CXFA_Node* pChildNode = @@ -1304,7 +1305,8 @@ void CXFA_Document::DoDataMerge() { return; } CXFA_Node* pTemplateChosen = - dwNameHash != 0 ? pTemplateRoot->GetFirstChildByName(dwNameHash) : NULL; + dwNameHash != 0 ? pTemplateRoot->GetFirstChildByName(dwNameHash) + : nullptr; if (!pTemplateChosen || pTemplateChosen->GetElementType() != XFA_Element::Subform) { pTemplateChosen = pTemplateRoot->GetFirstChildByClass(XFA_Element::Subform); @@ -1319,7 +1321,7 @@ void CXFA_Document::DoDataMerge() { pFormRoot = CreateNode(XFA_XDPPACKET_Form, XFA_Element::Form); ASSERT(pFormRoot); pFormRoot->SetCData(XFA_ATTRIBUTE_Name, L"form"); - m_pRootNode->InsertChild(pFormRoot, NULL); + m_pRootNode->InsertChild(pFormRoot, nullptr); } else { CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode> sIterator(pFormRoot); @@ -1399,7 +1401,7 @@ void CXFA_Document::DoDataRemerge(FX_BOOL bDoDataMerge) { while (CXFA_Node* pNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild)) { pFormRoot->RemoveChild(pNode); } - pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); + pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); } XFA_DataMerge_ClearGlobalBinding(this); if (bDoDataMerge) { diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.h b/xfa/fxfa/parser/xfa_document_datamerger_imp.h index f62ff8dace..a31bb3fd15 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.h +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.h @@ -14,7 +14,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer( CXFA_Node* pFormParent, CXFA_Node* pTemplateNode, FX_BOOL bRecursive, - CXFA_NodeArray* pSubformArray = NULL); + CXFA_NodeArray* pSubformArray = nullptr); CXFA_Node* XFA_DataMerge_FindDataScope(CXFA_Node* pParentFormNode); CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument, XFA_Element eType, diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp index 45102c8fb6..bcc37d9f65 100644 --- a/xfa/fxfa/parser/xfa_document_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_imp.cpp @@ -83,7 +83,7 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) { case XFA_HASHCODE_Data: { CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); if (!pDatasetsNode) { - return NULL; + return nullptr; } for (CXFA_Node* pDatasetsChild = pDatasetsNode->GetFirstChildByClass(XFA_Element::DataGroup); @@ -105,46 +105,41 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) { return pDatasetsChild; } } + return nullptr; } - return NULL; case XFA_HASHCODE_Record: { CXFA_Node* pData = ToNode(GetXFAObject(XFA_HASHCODE_Data)); - return pData ? pData->GetFirstChildByClass(XFA_Element::DataGroup) : NULL; + return pData ? pData->GetFirstChildByClass(XFA_Element::DataGroup) + : nullptr; } case XFA_HASHCODE_DataWindow: { - if (m_pScriptDataWindow == NULL) { + if (!m_pScriptDataWindow) m_pScriptDataWindow = new CScript_DataWindow(this); - } return m_pScriptDataWindow; } case XFA_HASHCODE_Event: { - if (m_pScriptEvent == NULL) { + if (!m_pScriptEvent) m_pScriptEvent = new CScript_EventPseudoModel(this); - } return m_pScriptEvent; } case XFA_HASHCODE_Host: { - if (m_pScriptHost == NULL) { + if (!m_pScriptHost) m_pScriptHost = new CScript_HostPseudoModel(this); - } return m_pScriptHost; } case XFA_HASHCODE_Log: { - if (m_pScriptLog == NULL) { + if (!m_pScriptLog) m_pScriptLog = new CScript_LogPseudoModel(this); - } return m_pScriptLog; } case XFA_HASHCODE_Signature: { - if (m_pScriptSignature == NULL) { + if (!m_pScriptSignature) m_pScriptSignature = new CScript_SignaturePseudoModel(this); - } return m_pScriptSignature; } case XFA_HASHCODE_Layout: { - if (m_pScriptLayout == NULL) { + if (!m_pScriptLayout) m_pScriptLayout = new CScript_LayoutPseudoModel(this); - } return m_pScriptLayout; } default: @@ -268,7 +263,7 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber( CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot, const CFX_WideStringC& wsID) { if (!pRoot || wsID.IsEmpty()) { - return NULL; + return nullptr; } CXFA_NodeIterator sIterator(pRoot); for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; @@ -280,12 +275,12 @@ CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot, } } } - return NULL; + return nullptr; } static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument, CXFA_Node* pDestNodeParent, CXFA_Node* pProtoNode) { - CXFA_Node* pExistingNode = NULL; + CXFA_Node* pExistingNode = nullptr; for (CXFA_Node* pFormChild = pDestNodeParent->GetNodeItem(XFA_NODEITEM_FirstChild); pFormChild; @@ -310,7 +305,7 @@ static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument, } CXFA_Node* pNewNode = pProtoNode->Clone(TRUE); pNewNode->SetTemplateNode(pProtoNode); - pDestNodeParent->InsertChild(pNewNode, NULL); + pDestNodeParent->InsertChild(pNewNode, nullptr); } static void XFA_ProtoMerge_MergeNode(CXFA_Document* pDocument, CXFA_Node* pDestNode, @@ -392,7 +387,7 @@ void CXFA_Document::DoProtoMerge() { if (!wsURI.IsEmpty() && wsURI != FX_WSTRC(L".")) { continue; } - CXFA_Node* pProtoNode = NULL; + CXFA_Node* pProtoNode = nullptr; if (!wsSOM.IsEmpty()) { uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.cpp b/xfa/fxfa/parser/xfa_document_layout_imp.cpp index 723ae1db69..416982b749 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_layout_imp.cpp @@ -31,8 +31,8 @@ CXFA_LayoutProcessor* CXFA_Document::GetDocLayout() { } CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument) : m_pDocument(pDocument), - m_pRootItemLayoutProcessor(NULL), - m_pLayoutPageMgr(NULL), + m_pRootItemLayoutProcessor(nullptr), + m_pLayoutPageMgr(nullptr), m_nProgressCounter(0), m_bNeeLayout(TRUE) {} CXFA_LayoutProcessor::~CXFA_LayoutProcessor() { @@ -110,7 +110,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) { FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { if (m_bNeeLayout) { StartLayout(TRUE); - return DoLayout(NULL) == 100; + return DoLayout(nullptr) == 100; } for (int32_t i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) { CXFA_Node* pNode = m_rgChangedContainers[i]; @@ -131,7 +131,7 @@ int32_t CXFA_LayoutProcessor::CountPages() const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0; } CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const { - return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : NULL; + return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : nullptr; } CXFA_LayoutItem* CXFA_LayoutProcessor::GetLayoutItem(CXFA_Node* pFormItem) { return static_cast<CXFA_LayoutItem*>( @@ -143,7 +143,7 @@ void CXFA_LayoutProcessor::AddChangedContainer(CXFA_Node* pContainer) { } } CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const { - return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : NULL; + return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : nullptr; } void CXFA_LayoutProcessor::ClearLayoutData() { @@ -159,13 +159,13 @@ FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() { } CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) : m_pFormNode(pNode), - m_pParent(NULL), - m_pNextSibling(NULL), - m_pFirstChild(NULL), + m_pParent(nullptr), + m_pNextSibling(nullptr), + m_pFirstChild(nullptr), m_bIsContentLayoutItem(bIsContentLayoutItem) {} CXFA_LayoutItem::~CXFA_LayoutItem() {} CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode) - : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(NULL) {} + : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(nullptr) {} CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { return m_pFormNode->GetDocument()->GetLayoutProcessor(); } @@ -195,11 +195,11 @@ CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const { } CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) : CXFA_LayoutItem(pNode, TRUE), - m_pPrev(NULL), - m_pNext(NULL), + m_pPrev(nullptr), + m_pNext(nullptr), m_dwStatus(0) {} CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) { - m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, NULL); + m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, nullptr); } } diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.h b/xfa/fxfa/parser/xfa_document_layout_imp.h index 4da405fc6c..87f7ca01af 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.h +++ b/xfa/fxfa/parser/xfa_document_layout_imp.h @@ -20,7 +20,7 @@ class CXFA_LayoutProcessor { CXFA_Document* GetDocument() const; int32_t StartLayout(FX_BOOL bForceRestart = FALSE); - int32_t DoLayout(IFX_Pause* pPause = NULL); + int32_t DoLayout(IFX_Pause* pPause = nullptr); FX_BOOL IncrementLayout(); int32_t CountPages() const; CXFA_ContainerLayoutItem* GetPage(int32_t index) const; diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 5db2025f6c..52aa58530e 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -31,7 +31,7 @@ FX_BOOL CXFA_DataImporter::ImportData(IFX_FileRead* pDataDocument) { pDataDocumentParser->Release(); return FALSE; } - if (pDataDocumentParser->DoParse(NULL) < XFA_PARSESTATUS_Done) { + if (pDataDocumentParser->DoParse(nullptr) < XFA_PARSESTATUS_Done) { pDataDocumentParser->Release(); return FALSE; } @@ -477,7 +477,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_FileWrite* pWrite, IFX_Stream* pStream = IFX_Stream::CreateStream( pWrite, FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append); - if (pStream == NULL) { + if (!pStream) { return FALSE; } pStream->SetCodePage(FX_CODEPAGE_UTF8); diff --git a/xfa/fxfa/parser/xfa_document_serialize.h b/xfa/fxfa/parser/xfa_document_serialize.h index 9136efce90..276a0d3faa 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.h +++ b/xfa/fxfa/parser/xfa_document_serialize.h @@ -33,7 +33,7 @@ class CXFA_DataExporter { FX_BOOL Export(IFX_FileWrite* pWrite, CXFA_Node* pNode, uint32_t dwFlag = 0, - const FX_CHAR* pChecksum = NULL); + const FX_CHAR* pChecksum = nullptr); protected: FX_BOOL Export(IFX_Stream* pStream, diff --git a/xfa/fxfa/parser/xfa_layout_appadapter.h b/xfa/fxfa/parser/xfa_layout_appadapter.h index 685bc4482a..498c023fb8 100644 --- a/xfa/fxfa/parser/xfa_layout_appadapter.h +++ b/xfa/fxfa/parser/xfa_layout_appadapter.h @@ -16,7 +16,7 @@ class CXFA_TraverseStrategy_PageAreaContainerLayoutItem { if (pLayoutItem->m_pFormNode->GetElementType() == XFA_Element::PageSet) { return static_cast<CXFA_ContainerLayoutItem*>(pLayoutItem->m_pFirstChild); } - return NULL; + return nullptr; } static inline CXFA_ContainerLayoutItem* GetNextSibling( CXFA_ContainerLayoutItem* pLayoutItem) { diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index 5b33e70c36..f5b0920548 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -83,9 +83,9 @@ CXFA_ItemLayoutProcessor::~CXFA_ItemLayoutProcessor() {} CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem( CXFA_Node* pFormNode) { if (!pFormNode) { - return NULL; + return nullptr; } - CXFA_ContentLayoutItem* pLayoutItem = NULL; + CXFA_ContentLayoutItem* pLayoutItem = nullptr; if (m_pOldLayoutItem) { pLayoutItem = m_pOldLayoutItem; m_pOldLayoutItem = m_pOldLayoutItem->m_pNext; @@ -207,7 +207,7 @@ static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout( return XFA_ATTRIBUTEENUM_Position; } static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) { - if (pCurNode == NULL || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode)) { + if (!pCurNode || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode)) { return FALSE; } XFA_NODEITEM eItemType = XFA_NODEITEM_PrevSibling; @@ -216,7 +216,7 @@ static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) { } CXFA_Node* pPreContainer = pCurNode->GetNodeItem(eItemType, XFA_ObjectType::ContainerNode); - if (pPreContainer == NULL) { + if (!pPreContainer) { return FALSE; } CXFA_Node* pKeep = pCurNode->GetFirstChildByClass(XFA_Element::Keep); @@ -285,7 +285,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( fCurBottomMargin = pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset).ToUnit(XFA_UNIT_Pt); } - CXFA_ContentLayoutItem* pSecondLayoutItem = NULL; + CXFA_ContentLayoutItem* pSecondLayoutItem = nullptr; if (m_pCurChildPreprocessor && m_pCurChildPreprocessor->m_pFormNode == pLayoutItem->m_pFormNode) { pSecondLayoutItem = m_pCurChildPreprocessor->CreateContentLayoutItem( @@ -319,14 +319,14 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( } CXFA_ContentLayoutItem* pChildren = (CXFA_ContentLayoutItem*)pLayoutItem->m_pFirstChild; - pLayoutItem->m_pFirstChild = NULL; + pLayoutItem->m_pFirstChild = nullptr; FX_FLOAT lHeightForKeep = 0; CFX_ArrayTemplate<CXFA_ContentLayoutItem*> keepLayoutItems; FX_FLOAT fAddMarginHeight = 0; - for (CXFA_ContentLayoutItem *pChildItem = pChildren, *pChildNext = NULL; + for (CXFA_ContentLayoutItem *pChildItem = pChildren, *pChildNext = nullptr; pChildItem; pChildItem = pChildNext) { pChildNext = (CXFA_ContentLayoutItem*)pChildItem->m_pNextSibling; - pChildItem->m_pNextSibling = NULL; + pChildItem->m_pNextSibling = nullptr; if (fSplitPos <= fCurTopMargin + pChildItem->m_sPos.y + fCurBottomMargin + XFA_LAYOUT_FLOAT_PERCISION) { if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, TRUE)) { @@ -381,7 +381,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( } void CXFA_ItemLayoutProcessor::SplitLayoutItem(FX_FLOAT fSplitPos) { ASSERT(m_pLayoutItem); - SplitLayoutItem(m_pLayoutItem, NULL, fSplitPos); + SplitLayoutItem(m_pLayoutItem, nullptr, fSplitPos); } CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const { @@ -517,7 +517,7 @@ void CXFA_LayoutItem::AddChild(CXFA_LayoutItem* pChildItem) { pChildItem->m_pParent->RemoveChild(pChildItem); } pChildItem->m_pParent = this; - if (m_pFirstChild == NULL) { + if (!m_pFirstChild) { m_pFirstChild = pChildItem; } else { CXFA_LayoutItem* pExistingChildItem = m_pFirstChild; @@ -532,7 +532,7 @@ void CXFA_LayoutItem::AddHeadChild(CXFA_LayoutItem* pChildItem) { pChildItem->m_pParent->RemoveChild(pChildItem); } pChildItem->m_pParent = this; - if (m_pFirstChild == NULL) { + if (!m_pFirstChild) { m_pFirstChild = pChildItem; } else { CXFA_LayoutItem* pExistingChildItem = m_pFirstChild; @@ -546,7 +546,7 @@ void CXFA_LayoutItem::InsertChild(CXFA_LayoutItem* pBeforeItem, return; } if (pChildItem->m_pParent) { - pChildItem->m_pParent = NULL; + pChildItem->m_pParent = nullptr; } pChildItem->m_pParent = this; CXFA_LayoutItem* pExistingChildItem = pBeforeItem->m_pNextSibling; @@ -569,8 +569,8 @@ void CXFA_LayoutItem::RemoveChild(CXFA_LayoutItem* pChildItem) { pExistingChildItem->m_pNextSibling = pChildItem->m_pNextSibling; } } - pChildItem->m_pNextSibling = NULL; - pChildItem->m_pParent = NULL; + pChildItem->m_pNextSibling = nullptr; + pChildItem->m_pParent = nullptr; } CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() { CXFA_ContentLayoutItem* pLayoutItem = m_pLayoutItem; @@ -657,7 +657,7 @@ static void XFA_DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) { pNode = sIterator.MoveToNext()) { CXFA_ContentLayoutItem* pCurLayoutItem = (CXFA_ContentLayoutItem*)pNode->GetUserData(XFA_LAYOUTITEMKEY); - CXFA_ContentLayoutItem* pNextLayoutItem = NULL; + CXFA_ContentLayoutItem* pNextLayoutItem = nullptr; while (pCurLayoutItem) { pNextLayoutItem = pCurLayoutItem->m_pNext; pNotify->OnLayoutItemRemoving(pDocLayout, pCurLayoutItem); @@ -822,7 +822,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode( } } default: - pCurActionNode = NULL; + pCurActionNode = nullptr; nCurStage = XFA_ItemLayoutProcessorStages_Done; } } @@ -852,8 +852,8 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext( } else { pNextContainer = m_pKeepHeadNode; m_bKeepBreakFinish = TRUE; - m_pKeepHeadNode = NULL; - m_pKeepTailNode = NULL; + m_pKeepHeadNode = nullptr; + m_pKeepTailNode = nullptr; m_bIsProcessKeep = FALSE; } } else { @@ -872,8 +872,8 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore( if (m_pKeepTailNode == pContainerNode) { pCurActionNode = m_pKeepHeadNode; m_bKeepBreakFinish = TRUE; - m_pKeepHeadNode = NULL; - m_pKeepTailNode = NULL; + m_pKeepHeadNode = nullptr; + m_pKeepTailNode = nullptr; m_bIsProcessKeep = FALSE; nCurStage = XFA_ItemLayoutProcessorStages_Container; return TRUE; @@ -1050,7 +1050,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( CXFA_Node* pCurChildNode = XFA_LAYOUT_INVALIDNODE; XFA_ItemLayoutProcessorStages nCurChildNodeStage = XFA_ItemLayoutProcessorStages_None; - CXFA_LayoutItem* pBeforeItem = NULL; + CXFA_LayoutItem* pBeforeItem = nullptr; for (XFA_ItemLayoutProcessor_GotoNextContainerNode( pCurChildNode, nCurChildNodeStage, pFormNode, FALSE); pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode( @@ -1062,7 +1062,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( continue; } CXFA_ItemLayoutProcessor* pProcessor = - new CXFA_ItemLayoutProcessor(pCurChildNode, NULL); + new CXFA_ItemLayoutProcessor(pCurChildNode, nullptr); pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); if (!pProcessor->HasLayoutItem()) { delete pProcessor; @@ -1075,7 +1075,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( fAbsoluteY); pProcessor->SetCurrentComponentPos(fAbsoluteX, fAbsoluteY); CXFA_LayoutItem* pProcessItem = pProcessor->ExtractLayoutItem(); - if (pBeforeItem == NULL) { + if (!pBeforeItem) { pPageAreaLayoutItem->AddHeadChild(pProcessItem); } else { pPageAreaLayoutItem->InsertChild(pBeforeItem, pProcessItem); @@ -1083,7 +1083,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( pBeforeItem = pProcessItem; delete pProcessor; } - pBeforeItem = NULL; + pBeforeItem = nullptr; CXFA_LayoutItem* pLayoutItem = pPageAreaLayoutItem->m_pFirstChild; while (pLayoutItem) { if (!pLayoutItem->IsContentLayoutItem() || @@ -1094,7 +1094,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea( if (pLayoutItem->m_pFormNode->GetElementType() == XFA_Element::Draw) { CXFA_LayoutItem* pNextLayoutItem = pLayoutItem->m_pNextSibling; pPageAreaLayoutItem->RemoveChild(pLayoutItem); - if (pBeforeItem == NULL) { + if (!pBeforeItem) { pPageAreaLayoutItem->AddHeadChild(pLayoutItem); } else { pPageAreaLayoutItem->InsertChild(pBeforeItem, pLayoutItem); @@ -1381,7 +1381,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { if (m_pLayoutItem) return; - if (pLayoutNode == NULL) { + if (!pLayoutNode) { pLayoutNode = m_pFormNode; } ASSERT(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE); @@ -1426,7 +1426,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { CXFA_LayoutContext layoutContext; layoutContext.m_prgSpecifiedColumnWidths = &m_rgSpecifiedColumnWidths; CXFA_LayoutContext* pLayoutContext = - iSpecifiedColumnCount > 0 ? &layoutContext : NULL; + iSpecifiedColumnCount > 0 ? &layoutContext : nullptr; if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) { XFA_ItemLayoutProcessor_GotoNextContainerNode( m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE); @@ -1493,7 +1493,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { (CXFA_ContentLayoutItem*)rgRowItems[i]->m_pNextSibling; if (rgRowItemsSpan[i] < 0 && XFA_ItemLayoutProcessor_IsTakingSpace( rgRowItems[i]->m_pFormNode)) { - pNewCell = NULL; + pNewCell = nullptr; } rgRowItems[i] = pNewCell; rgRowItemsSpan[i] = @@ -1817,7 +1817,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite( FX_BOOL& bAddedItemInRow, FX_BOOL& bForceEndPage, XFA_ItemLayoutProcessorResult& result) { - if (pParentProcessor == NULL || pChildProcessor == NULL) { + if (!pParentProcessor || !pChildProcessor) { return FALSE; } if (pParentProcessor->m_pCurChildNode->GetIntact() != @@ -1857,7 +1857,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage( CXFA_ContentLayoutItem* pParentLayoutItem, FX_FLOAT fChildHeight, CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems) { - if (pParentLayoutItem == NULL) { + if (!pParentLayoutItem) { return FALSE; } FX_FLOAT fItemsHeight = 0; @@ -1892,7 +1892,7 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseBinds(CXFA_Node* pFormNode) { CXFA_Node* pBindNode = pNode->GetBindData(); if (pBindNode) { pBindNode->RemoveBindItem(pNode); - pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); + pNode->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); } } pNode->SetFlag(XFA_NodeFlag_UnusedNode, true); @@ -1905,7 +1905,7 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow( CXFA_Node* pFormNode) { ProcessUnUseBinds(pLeaderNode); ProcessUnUseBinds(pTrailerNode); - if (pFormNode == NULL) { + if (!pFormNode) { return; } if (pFormNode->GetElementType() == XFA_Element::Overflow || @@ -1940,7 +1940,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( FX_FLOAT& fContentCurRowHeight, FX_BOOL& bAddedItemInRow, FX_BOOL& bForceEndPage, - CXFA_LayoutContext* pLayoutContext = NULL, + CXFA_LayoutContext* pLayoutContext = nullptr, FX_BOOL bNewRow = FALSE) { FX_BOOL bTakeSpace = XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode); @@ -2007,14 +2007,15 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( (fChildWidth <= fContentCurRowAvailWidth + XFA_LAYOUT_FLOAT_PERCISION) || (fContentWidthLimit - fContentCurRowAvailWidth <= XFA_LAYOUT_FLOAT_PERCISION)) { - CXFA_Node *pOverflowLeaderNode = NULL, *pOverflowTrailerNode = NULL, - *pFormNode = NULL; - CXFA_ContentLayoutItem* pTrailerLayoutItem = NULL; + CXFA_Node* pOverflowLeaderNode = nullptr; + CXFA_Node* pOverflowTrailerNode = nullptr; + CXFA_Node* pFormNode = nullptr; + CXFA_ContentLayoutItem* pTrailerLayoutItem = nullptr; FX_BOOL bIsAddTrailerHeight = FALSE; if (pThis->m_pPageMgr && pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { pFormNode = pThis->m_pPageMgr->QueryOverflow(pProcessor->m_pFormNode); - if (pFormNode == NULL && pLayoutContext && + if (!pFormNode && pLayoutContext && pLayoutContext->m_pOverflowProcessor) { pFormNode = pLayoutContext->m_pOverflowNode; bUseInherited = TRUE; @@ -2025,12 +2026,12 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowTrailerNode)) { if (pOverflowTrailerNode) { CXFA_ItemLayoutProcessor* pOverflowLeaderProcessor = - new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, NULL); + new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, nullptr); pOverflowLeaderProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX); pTrailerLayoutItem = pOverflowLeaderProcessor->HasLayoutItem() ? pOverflowLeaderProcessor->ExtractLayoutItem() - : NULL; + : nullptr; delete pOverflowLeaderProcessor; } if (bUseInherited) { @@ -2148,7 +2149,8 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } return XFA_ItemLayoutProcessorResult_PageFullBreak; } - CXFA_Node *pTempLeaderNode = NULL, *pTempTrailerNode = NULL; + CXFA_Node* pTempLeaderNode = nullptr; + CXFA_Node* pTempTrailerNode = nullptr; if (pThis->m_pPageMgr && !pProcessor->m_bUseInheriated && eRetValue != XFA_ItemLayoutProcessorResult_PageFullBreak) { pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode, @@ -2195,9 +2197,10 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } else if (fContentCurRowY <= XFA_LAYOUT_FLOAT_PERCISION) { pProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight); if (pProcessor->m_pPageMgr->GetNextAvailContentHeight(fChildHeight)) { - CXFA_Node *pTempLeaderNode = NULL, *pTempTrailerNode = NULL; + CXFA_Node* pTempLeaderNode = nullptr; + CXFA_Node* pTempTrailerNode = nullptr; if (pThis->m_pPageMgr) { - if (pFormNode == NULL && pLayoutContext) { + if (!pFormNode && pLayoutContext) { pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode; } pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode, @@ -2243,7 +2246,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem( } } else { if (eRetValue == XFA_ItemLayoutProcessorResult_Done) { - if (pFormNode == NULL && pLayoutContext) { + if (!pFormNode && pLayoutContext) { pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode; } if (pThis->m_pPageMgr) { @@ -2334,7 +2337,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } fRealHeight = fRealHeight - fTopInset - fBottomInset; FX_FLOAT fContentCurRowY = 0; - CXFA_ContentLayoutItem* pLayoutChild = NULL; + CXFA_ContentLayoutItem* pLayoutChild = nullptr; if (m_pLayoutItem) { if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Done && eFlowStrategy != XFA_ATTRIBUTEENUM_Tb) { @@ -2396,7 +2399,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( if (pLayoutChild) { for (CXFA_ContentLayoutItem* pLayoutNext = pLayoutChild; pLayoutNext; pLayoutNext = (CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) { - if (pLayoutNext->m_pNextSibling == NULL && m_pCurChildPreprocessor && + if (!pLayoutNext->m_pNextSibling && m_pCurChildPreprocessor && m_pCurChildPreprocessor->m_pFormNode == pLayoutNext->m_pFormNode) { pLayoutNext->m_pNext = m_pCurChildPreprocessor->m_pLayoutItem; m_pCurChildPreprocessor->m_pLayoutItem = pLayoutNext; @@ -2421,7 +2424,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } if ((CXFA_ContentLayoutItem*)m_pLayoutItem->m_pFirstChild == pLayoutChild) { - m_pLayoutItem->m_pFirstChild = NULL; + m_pLayoutItem->m_pFirstChild = nullptr; } else { CXFA_ContentLayoutItem* pLayoutNext = (CXFA_ContentLayoutItem*)m_pLayoutItem->m_pFirstChild; @@ -2430,7 +2433,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( (CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) { if ((CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling == pLayoutChild) { - pLayoutNext->m_pNextSibling = NULL; + pLayoutNext->m_pNextSibling = nullptr; break; } } @@ -2438,13 +2441,13 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( CXFA_ContentLayoutItem* pLayoutNextTemp = (CXFA_ContentLayoutItem*)pLayoutChild; while (pLayoutNextTemp) { - pLayoutNextTemp->m_pParent = NULL; + pLayoutNextTemp->m_pParent = nullptr; CXFA_ContentLayoutItem* pSaveLayoutNext = (CXFA_ContentLayoutItem*)pLayoutNextTemp->m_pNextSibling; - pLayoutNextTemp->m_pNextSibling = NULL; + pLayoutNextTemp->m_pNextSibling = nullptr; pLayoutNextTemp = pSaveLayoutNext; } - pLayoutChild = NULL; + pLayoutChild = nullptr; } while (m_pCurChildNode) { CXFA_ItemLayoutProcessor* pProcessor = nullptr; @@ -2462,7 +2465,8 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pLayoutItem->RemoveChild(pItem); fContentCalculatedHeight -= pItem->m_sSize.y; } - CXFA_Node *pLeaderNode = NULL, *pTrailerNode = NULL; + CXFA_Node* pLeaderNode = nullptr; + CXFA_Node* pTrailerNode = nullptr; FX_BOOL bCreatePage = FALSE; if (bUseBreakControl && m_pPageMgr && m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, TRUE, @@ -2476,7 +2480,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( if (JudgeLeaderOrTrailerForOccur(pTrailerNode)) { if (m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent) ->GetElementType() == XFA_Element::Form && - m_pLayoutItem == NULL) { + !m_pLayoutItem) { XFA_ItemLayoutProcessor_AddPendingNode(this, pTrailerNode, TRUE); } else { @@ -2500,7 +2504,8 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } } break; case XFA_ItemLayoutProcessorStages_BreakAfter: { - CXFA_Node *pLeaderNode = NULL, *pTrailerNode = NULL; + CXFA_Node* pLeaderNode = nullptr; + CXFA_Node* pTrailerNode = nullptr; FX_BOOL bCreatePage = FALSE; if (bUseBreakControl && m_pPageMgr && m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, FALSE, @@ -2556,10 +2561,10 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } } break; case XFA_ItemLayoutProcessorStages_BookendLeader: { - CXFA_Node* pLeaderNode = NULL; + CXFA_Node* pLeaderNode = nullptr; if (m_pCurChildPreprocessor) { pProcessor = m_pCurChildPreprocessor; - m_pCurChildPreprocessor = NULL; + m_pCurChildPreprocessor = nullptr; } else if (m_pPageMgr && m_pPageMgr->ProcessBookendLeaderOrTrailer( m_pCurChildNode, TRUE, pLeaderNode)) { @@ -2577,15 +2582,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( goto SuspendAndCreateNewRow; } else { delete pProcessor; - pProcessor = NULL; + pProcessor = nullptr; } } } break; case XFA_ItemLayoutProcessorStages_BookendTrailer: { - CXFA_Node* pTrailerNode = NULL; + CXFA_Node* pTrailerNode = nullptr; if (m_pCurChildPreprocessor) { pProcessor = m_pCurChildPreprocessor; - m_pCurChildPreprocessor = NULL; + m_pCurChildPreprocessor = nullptr; } else if (m_pPageMgr && m_pPageMgr->ProcessBookendLeaderOrTrailer( m_pCurChildNode, FALSE, pTrailerNode)) { @@ -2603,7 +2608,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( goto SuspendAndCreateNewRow; } else { delete pProcessor; - pProcessor = NULL; + pProcessor = nullptr; } } } break; @@ -2621,7 +2626,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( FX_BOOL bNewRow = FALSE; if (m_pCurChildPreprocessor) { pProcessor = m_pCurChildPreprocessor; - m_pCurChildPreprocessor = NULL; + m_pCurChildPreprocessor = nullptr; bNewRow = TRUE; } else { pProcessor = @@ -2650,7 +2655,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( fContentCurRowY += XFA_ItemLayoutProcessor_InsertPendingItems( pProcessor, m_pCurChildNode); delete pProcessor; - pProcessor = NULL; + pProcessor = nullptr; } } break; @@ -2694,7 +2699,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( fContainerHeight); if (fContainerHeight >= XFA_LAYOUT_FLOAT_PERCISION || m_pLayoutItem || bRetValue) { - if (m_pLayoutItem == NULL) { + if (!m_pLayoutItem) { m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); } if (fContainerHeight < 0) { @@ -2746,7 +2751,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition( } return FALSE; } - if (m_pLayoutItem == NULL) { + if (!m_pLayoutItem) { m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); } if (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb) { diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h index fc279893c8..f326715339 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.h +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h @@ -47,12 +47,12 @@ enum XFA_ItemLayoutProcessorStages { class CXFA_LayoutContext { public: CXFA_LayoutContext() - : m_prgSpecifiedColumnWidths(NULL), + : m_prgSpecifiedColumnWidths(nullptr), m_fCurColumnWidth(0), m_bCurColumnWidthAvaiable(FALSE), - m_pOverflowProcessor(NULL), - m_pOverflowNode(NULL) {} - ~CXFA_LayoutContext() { m_pOverflowProcessor = NULL; } + m_pOverflowProcessor(nullptr), + m_pOverflowNode(nullptr) {} + ~CXFA_LayoutContext() { m_pOverflowProcessor = nullptr; } CFX_ArrayTemplate<FX_FLOAT>* m_prgSpecifiedColumnWidths; FX_FLOAT m_fCurColumnWidth; FX_BOOL m_bCurColumnWidthAvaiable; @@ -69,7 +69,7 @@ class CXFA_ItemLayoutProcessor { FX_BOOL bUseBreakControl, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight = XFA_LAYOUT_FLOAT_MAX, - CXFA_LayoutContext* pContext = NULL); + CXFA_LayoutContext* pContext = nullptr); void GetCurrentComponentPos(FX_FLOAT& fAbsoluteX, FX_FLOAT& fAbsoluteY); @@ -78,8 +78,8 @@ class CXFA_ItemLayoutProcessor { void SetCurrentComponentPos(FX_FLOAT fAbsoluteX, FX_FLOAT fAbsoluteY); void SetCurrentComponentSize(FX_FLOAT fWidth, FX_FLOAT fHeight); - inline CXFA_Node* GetFormNode() { return m_pFormNode; } - inline FX_BOOL HasLayoutItem() { return m_pLayoutItem != NULL; } + CXFA_Node* GetFormNode() { return m_pFormNode; } + FX_BOOL HasLayoutItem() { return !!m_pLayoutItem; } CXFA_ContentLayoutItem* ExtractLayoutItem(); static FX_BOOL IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor, @@ -139,14 +139,14 @@ class CXFA_ItemLayoutProcessor { CXFA_ContentLayoutItem* CreateContentLayoutItem(CXFA_Node* pFormNode); protected: - void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = NULL); + void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = nullptr); void DoLayoutTableContainer(CXFA_Node* pLayoutNode); XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer( FX_BOOL bUseBreakControl, XFA_ATTRIBUTEENUM eFlowStrategy, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight, - CXFA_LayoutContext* pContext = NULL, + CXFA_LayoutContext* pContext = nullptr, FX_BOOL bRootForceTb = FALSE); void DoLayoutField(); void XFA_ItemLayoutProcessor_GotoNextContainerNode( diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp index 36e72dbd2d..2ade051a81 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp @@ -192,7 +192,7 @@ FX_BOOL CheckContentAreaNotUsed( pLayoutItem; pLayoutItem = (CXFA_ContainerLayoutItem*)pLayoutItem->m_pNextSibling) { if (pLayoutItem->m_pFormNode == pContentArea) { - if (pLayoutItem->m_pFirstChild == NULL) { + if (!pLayoutItem->m_pFirstChild) { pContentAreaLayoutItem = pLayoutItem; return TRUE; } @@ -234,7 +234,7 @@ CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor) CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() { ClearData(); CXFA_LayoutItem* pLayoutItem = GetRootLayoutItem(); - CXFA_LayoutItem* pNextLayout = NULL; + CXFA_LayoutItem* pNextLayout = nullptr; for (; pLayoutItem; pLayoutItem = pNextLayout) { pNextLayout = pLayoutItem->m_pNextSibling; XFA_ReleaseLayoutItem(pLayoutItem); @@ -249,9 +249,9 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { m_pTemplatePageSetRoot = pTemplateNode->GetProperty(0, XFA_Element::PageSet); ASSERT(m_pTemplatePageSetRoot); if (m_pPageSetLayoutItemRoot) { - m_pPageSetLayoutItemRoot->m_pParent = NULL; - m_pPageSetLayoutItemRoot->m_pFirstChild = NULL; - m_pPageSetLayoutItemRoot->m_pNextSibling = NULL; + m_pPageSetLayoutItemRoot->m_pParent = nullptr; + m_pPageSetLayoutItemRoot->m_pFirstChild = nullptr; + m_pPageSetLayoutItemRoot->m_pNextSibling = nullptr; m_pPageSetLayoutItemRoot->m_pFormNode = m_pTemplatePageSetRoot; } else { m_pPageSetLayoutItemRoot = @@ -266,7 +266,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { m_ePageSetMode = eRelation; } InitPageSetMap(); - CXFA_Node* pPageArea = NULL; + CXFA_Node* pPageArea = nullptr; int32_t iCount = 0; for (pPageArea = m_pTemplatePageSetRoot->GetNodeItem(XFA_NODEITEM_FirstChild); pPageArea; @@ -290,7 +290,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { if (!pPageArea) { return FALSE; } - m_pTemplatePageSetRoot->InsertChild(pPageArea, NULL); + m_pTemplatePageSetRoot->InsertChild(pPageArea, nullptr); pPageArea->SetFlag(XFA_NodeFlag_Initialized, true); } CXFA_Node* pContentArea = pPageArea->GetChild(0, XFA_Element::ContentArea); @@ -300,7 +300,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { if (!pContentArea) { return FALSE; } - pPageArea->InsertChild(pContentArea, NULL); + pPageArea->InsertChild(pContentArea, nullptr); pContentArea->SetFlag(XFA_NodeFlag_Initialized, true); pContentArea->SetMeasure(XFA_ATTRIBUTE_X, CXFA_Measurement(0.25f, XFA_UNIT_In)); @@ -318,7 +318,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { if (!pContentArea) { return FALSE; } - pPageArea->InsertChild(pMedium, NULL); + pPageArea->InsertChild(pMedium, nullptr); pMedium->SetFlag(XFA_NodeFlag_Initialized, true); pMedium->SetMeasure(XFA_ATTRIBUTE_Short, CXFA_Measurement(8.5f, XFA_UNIT_In)); @@ -329,7 +329,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { } FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { FX_BOOL bProBreakBefore = FALSE; - CXFA_Node* pBreakBeforeNode = NULL; + CXFA_Node* pBreakBeforeNode = nullptr; while (pRootSubform) { for (CXFA_Node* pBreakNode = pRootSubform->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -369,11 +369,11 @@ FX_BOOL CXFA_LayoutPageMgr::AppendNewPage(FX_BOOL bFirstTemPage) { m_rgProposedContainerRecord.GetTailPosition()) { return TRUE; } - CXFA_Node* pPageNode = GetNextAvailPageArea(NULL); + CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr); if (!pPageNode) { return FALSE; } - if (bFirstTemPage && m_pCurrentContainerRecord == NULL) { + if (bFirstTemPage && !m_pCurrentContainerRecord) { m_pCurrentContainerRecord = m_rgProposedContainerRecord.GetHeadPosition(); } return !bFirstTemPage || m_pCurrentContainerRecord; @@ -464,7 +464,7 @@ CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord( FX_BOOL bCreateNew) { CXFA_ContainerRecord* pNewRecord = new CXFA_ContainerRecord(); if (m_pCurrentContainerRecord) { - if (!IsPageSetRootOrderedOccurrence() || pPageNode == NULL) { + if (!IsPageSetRootOrderedOccurrence() || !pPageNode) { *pNewRecord = *GetCurrentContainerRecord(); m_rgProposedContainerRecord.AddTail(pNewRecord); return pNewRecord; @@ -476,13 +476,13 @@ CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord( } else { CXFA_ContainerLayoutItem* pParentLayoutItem = (CXFA_ContainerLayoutItem*)pPageSet->GetUserData(XFA_LAYOUTITEMKEY); - if (pParentLayoutItem == NULL) { + if (!pParentLayoutItem) { pParentLayoutItem = m_pPageSetCurRoot; } pNewRecord->pCurPageSet = pParentLayoutItem; } } else { - CXFA_ContainerLayoutItem* pParentPageSetLayout = NULL; + CXFA_ContainerLayoutItem* pParentPageSetLayout = nullptr; if (pPageSet == GetCurrentContainerRecord()->pCurPageSet->m_pFormNode) { pParentPageSetLayout = (CXFA_ContainerLayoutItem*)GetCurrentContainerRecord() @@ -496,7 +496,7 @@ CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord( CXFA_ContainerLayoutItem* pPageSetLayoutItem = new CXFA_ContainerLayoutItem(pPageSet); pPageSet->SetUserData(XFA_LAYOUTITEMKEY, (void*)pPageSetLayoutItem); - if (pParentPageSetLayout == NULL) { + if (!pParentPageSetLayout) { CXFA_ContainerLayoutItem* pPrePageSet = m_pPageSetLayoutItemRoot; while (pPrePageSet->m_pNextSibling) { pPrePageSet = (CXFA_ContainerLayoutItem*)pPrePageSet->m_pNextSibling; @@ -529,7 +529,7 @@ CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord( } void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_Node* pNewPageArea) { - CXFA_ContainerLayoutItem* pNewPageAreaLayoutItem = NULL; + CXFA_ContainerLayoutItem* pNewPageAreaLayoutItem = nullptr; if (m_PageArray.GetSize() > m_nAvailPages) { CXFA_ContainerLayoutItem* pContainerItem = m_PageArray[m_nAvailPages]; pContainerItem->m_pFormNode = pNewPageArea; @@ -547,13 +547,13 @@ void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, } pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem); pNewRecord->pCurPageArea = pNewPageAreaLayoutItem; - pNewRecord->pCurContentArea = NULL; + pNewRecord->pCurContentArea = nullptr; } void CXFA_LayoutPageMgr::AddContentAreaLayoutItem( CXFA_ContainerRecord* pNewRecord, CXFA_Node* pContentArea) { - if (pContentArea == NULL) { - pNewRecord->pCurContentArea = NULL; + if (!pContentArea) { + pNewRecord->pCurContentArea = nullptr; return; } CXFA_ContainerLayoutItem* pNewContentAreaLayoutItem = @@ -580,7 +580,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { default: { ProcessLastPageSet(); } break; case XFA_ATTRIBUTEENUM_SimplexPaginated: case XFA_ATTRIBUTEENUM_DuplexPaginated: { - CXFA_LayoutItem* pLastPageAreaLayoutItem = NULL; + CXFA_LayoutItem* pLastPageAreaLayoutItem = nullptr; int32_t nPageAreaCount = 0; for (CXFA_LayoutItem* pPageAreaLayoutItem = pPageSetLayoutItem->m_pFirstChild; @@ -597,13 +597,13 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { break; } if (!FindPageAreaFromPageSet_SimplexDuplex( - pPageSetLayoutItem->m_pFormNode, NULL, NULL, NULL, TRUE, TRUE, - nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only - : XFA_ATTRIBUTEENUM_Last) && + pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, + TRUE, TRUE, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only + : XFA_ATTRIBUTEENUM_Last) && (nPageAreaCount == 1 && !FindPageAreaFromPageSet_SimplexDuplex( - pPageSetLayoutItem->m_pFormNode, NULL, NULL, NULL, TRUE, - TRUE, XFA_ATTRIBUTEENUM_Last))) { + pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, + TRUE, TRUE, XFA_ATTRIBUTEENUM_Last))) { break; } CXFA_Node* pNode = m_pCurPageArea; @@ -719,39 +719,39 @@ FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, switch (eTargetType) { case XFA_ATTRIBUTEENUM_ContentArea: if (pTarget && pTarget->GetElementType() != XFA_Element::ContentArea) { - pTarget = NULL; + pTarget = nullptr; } if (!pTarget || !m_pCurrentContainerRecord || pTarget != GetCurrentContainerRecord()->pCurContentArea->m_pFormNode || bStartNew) { - CXFA_Node* pPageArea = NULL; + CXFA_Node* pPageArea = nullptr; if (pTarget) { pPageArea = pTarget->GetNodeItem(XFA_NODEITEM_Parent); } pPageArea = GetNextAvailPageArea(pPageArea, pTarget); - bRet = pPageArea != NULL; + bRet = !!pPageArea; } break; case XFA_ATTRIBUTEENUM_PageArea: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) { - pTarget = NULL; + pTarget = nullptr; } if (!pTarget || !m_pCurrentContainerRecord || pTarget != GetCurrentContainerRecord()->pCurPageArea->m_pFormNode || bStartNew) { - CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, NULL, TRUE); - bRet = pPageArea != NULL; + CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, TRUE); + bRet = !!pPageArea; } break; case XFA_ATTRIBUTEENUM_PageOdd: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) { - pTarget = NULL; + pTarget = nullptr; } break; case XFA_ATTRIBUTEENUM_PageEven: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) { - pTarget = NULL; + pTarget = nullptr; } break; case XFA_ATTRIBUTEENUM_Auto: @@ -837,14 +837,15 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( CXFA_Node*& pBreakLeaderNode, CXFA_Node*& pBreakTrailerNode, FX_BOOL& bCreatePage) { - CXFA_Node *pLeaderTemplate = NULL, *pTrailerTemplate = NULL; + CXFA_Node* pLeaderTemplate = nullptr; + CXFA_Node* pTrailerTemplate = nullptr; CXFA_Node* pFormNode = pBreakNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); if (XFA_ItemLayoutProcessor_IsTakingSpace(pFormNode)) { bCreatePage = ExecuteBreakBeforeOrAfter(pBreakNode, bBefore, pLeaderTemplate, pTrailerTemplate); CXFA_Document* pDocument = pBreakNode->GetDocument(); - CXFA_Node* pDataScope = NULL; + CXFA_Node* pDataScope = nullptr; pFormNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); if (pLeaderTemplate) { @@ -873,12 +874,12 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer( CXFA_Node* pBookendNode, FX_BOOL bLeader, CXFA_Node*& pBookendAppendNode) { - CXFA_Node* pLeaderTemplate = NULL; + CXFA_Node* pLeaderTemplate = nullptr; CXFA_Node* pFormNode = pBookendNode->GetNodeItem( XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); if (ResolveBookendLeaderOrTrailer(pBookendNode, bLeader, pLeaderTemplate)) { CXFA_Document* pDocument = pBookendNode->GetDocument(); - CXFA_Node* pDataScope = NULL; + CXFA_Node* pDataScope = nullptr; if (pLeaderTemplate) { if (!pDataScope) { pDataScope = XFA_DataMerge_FindDataScope(pFormNode); @@ -937,41 +938,42 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, } return pOverflowNode; } - return NULL; - } else if (pOverflowNode->GetElementType() == XFA_Element::Overflow) { - CFX_WideStringC wsOverflowLeader; - CFX_WideStringC wsOverflowTrailer; - CFX_WideStringC wsOverflowTarget; - pOverflowNode->TryCData(XFA_ATTRIBUTE_Leader, wsOverflowLeader); - pOverflowNode->TryCData(XFA_ATTRIBUTE_Trailer, wsOverflowTrailer); - pOverflowNode->TryCData(XFA_ATTRIBUTE_Target, wsOverflowTarget); - if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { - CXFA_Node* pTarget = - ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget); - if (pTarget) { - m_bCreateOverFlowPage = TRUE; - switch (pTarget->GetElementType()) { - case XFA_Element::PageArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget, - TRUE); - break; - case XFA_Element::ContentArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, - pTarget, TRUE); - break; - default: - break; - } + return nullptr; + } + + if (pOverflowNode->GetElementType() != XFA_Element::Overflow) + return nullptr; + + CFX_WideStringC wsOverflowLeader; + CFX_WideStringC wsOverflowTrailer; + CFX_WideStringC wsOverflowTarget; + pOverflowNode->TryCData(XFA_ATTRIBUTE_Leader, wsOverflowLeader); + pOverflowNode->TryCData(XFA_ATTRIBUTE_Trailer, wsOverflowTrailer); + pOverflowNode->TryCData(XFA_ATTRIBUTE_Target, wsOverflowTarget); + if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) { + CXFA_Node* pTarget = + ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget); + if (pTarget) { + m_bCreateOverFlowPage = TRUE; + switch (pTarget->GetElementType()) { + case XFA_Element::PageArea: + RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget, + TRUE); + break; + case XFA_Element::ContentArea: + RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, + pTarget, TRUE); + break; + default: + break; } } - if (!bCreatePage) { - pLeaderTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader); - pTrailerTemplate = - ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer); - } - return pOverflowNode; } - return nullptr; + if (!bCreatePage) { + pLeaderTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader); + pTrailerTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer); + } + return pOverflowNode; } FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, @@ -979,10 +981,11 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, CXFA_Node*& pTrailerNode, FX_BOOL bDataMerge, FX_BOOL bCreatePage) { - if (pFormNode == NULL) { + if (!pFormNode) { return FALSE; } - CXFA_Node *pLeaderTemplate = NULL, *pTrailerTemplate = NULL; + CXFA_Node* pLeaderTemplate = nullptr; + CXFA_Node* pTrailerTemplate = nullptr; FX_BOOL bIsOverflowNode = FALSE; if (pFormNode->GetElementType() == XFA_Element::Overflow || pFormNode->GetElementType() == XFA_Element::Break) { @@ -998,7 +1001,7 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode, pFormNode = pCurNode->GetNodeItem(XFA_NODEITEM_Parent); } CXFA_Document* pDocument = pCurNode->GetDocument(); - CXFA_Node* pDataScope = NULL; + CXFA_Node* pDataScope = nullptr; if (pLeaderTemplate) { if (!pDataScope) { pDataScope = XFA_DataMerge_FindDataScope(pFormNode); @@ -1061,7 +1064,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet( CXFA_Node* pTargetContentArea, FX_BOOL bNewPage, FX_BOOL bQuery) { - if (pPageSet == NULL && pStartChild == NULL) { + if (!pPageSet && !pStartChild) { return FALSE; } if (IsPageSetRootOrderedOccurrence()) { @@ -1102,20 +1105,19 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( for (; pCurrentNode; pCurrentNode = pCurrentNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pCurrentNode->GetElementType() == XFA_Element::PageArea) { - if ((pTargetPageArea == pCurrentNode || pTargetPageArea == NULL)) { - if (pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea) == - NULL) { + if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) { + if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) { if (pTargetPageArea == pCurrentNode) { CreateMinPageRecord(pCurrentNode, TRUE); - pTargetPageArea = NULL; + pTargetPageArea = nullptr; } continue; } if (!bQuery) { CXFA_ContainerRecord* pNewRecord = - CreateContainerRecord(pCurrentNode, pStartChild == NULL); + CreateContainerRecord(pCurrentNode, !pStartChild); AddPageAreaLayoutItem(pNewRecord, pCurrentNode); - if (pTargetContentArea == NULL) { + if (!pTargetContentArea) { pTargetContentArea = pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea); } @@ -1130,9 +1132,9 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered( CreateMinPageRecord(pCurrentNode, FALSE); } } else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) { - if (FindPageAreaFromPageSet_Ordered(pCurrentNode, NULL, pTargetPageArea, - pTargetContentArea, bNewPage, - bQuery)) { + if (FindPageAreaFromPageSet_Ordered(pCurrentNode, nullptr, + pTargetPageArea, pTargetContentArea, + bNewPage, bQuery)) { bRes = TRUE; break; } @@ -1155,8 +1157,9 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( FX_BOOL bQuery, XFA_ATTRIBUTEENUM ePreferredPosition) { const XFA_ATTRIBUTEENUM eFallbackPosition = XFA_ATTRIBUTEENUM_Any; - CXFA_Node *pPreferredPageArea = NULL, *pFallbackPageArea = NULL; - CXFA_Node* pCurrentNode = NULL; + CXFA_Node* pPreferredPageArea = nullptr; + CXFA_Node* pFallbackPageArea = nullptr; + CXFA_Node* pCurrentNode = nullptr; if (!pStartChild || pStartChild->GetElementType() == XFA_Element::PageArea) { pCurrentNode = pPageSet->GetNodeItem(XFA_NODEITEM_FirstChild); } else { @@ -1198,13 +1201,12 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( } return FALSE; } - if ((pTargetPageArea == pCurrentNode || pTargetPageArea == NULL)) { - if (pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea) == - NULL) { + if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) { + if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) { if (pTargetPageArea == pCurrentNode) { CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); AddPageAreaLayoutItem(pNewRecord, pCurrentNode); - pTargetPageArea = NULL; + pTargetPageArea = nullptr; } continue; } @@ -1226,13 +1228,13 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( } } else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) { if (FindPageAreaFromPageSet_SimplexDuplex( - pCurrentNode, NULL, pTargetPageArea, pTargetContentArea, bNewPage, - bQuery, ePreferredPosition)) { + pCurrentNode, nullptr, pTargetPageArea, pTargetContentArea, + bNewPage, bQuery, ePreferredPosition)) { break; } } } - CXFA_Node* pCurPageArea = NULL; + CXFA_Node* pCurPageArea = nullptr; if (pPreferredPageArea) { pCurPageArea = pPreferredPageArea; } else if (pFallbackPageArea) { @@ -1244,7 +1246,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( if (!bQuery) { CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(); AddPageAreaLayoutItem(pNewRecord, pCurPageArea); - if (pTargetContentArea == NULL) { + if (!pTargetContentArea) { pTargetContentArea = pCurPageArea->GetFirstChildByClass(XFA_Element::ContentArea); } @@ -1276,13 +1278,13 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( CXFA_Node* pTargetContentArea, FX_BOOL bNewPage, FX_BOOL bQuery) { - if (m_pCurPageArea == NULL) { - FindPageAreaFromPageSet(m_pTemplatePageSetRoot, NULL, pTargetPageArea, + if (!m_pCurPageArea) { + FindPageAreaFromPageSet(m_pTemplatePageSetRoot, nullptr, pTargetPageArea, pTargetContentArea, bNewPage, bQuery); ASSERT(m_pCurPageArea); return m_pCurPageArea; } - if (pTargetPageArea == NULL || pTargetPageArea == m_pCurPageArea) { + if (!pTargetPageArea || pTargetPageArea == m_pCurPageArea) { if (!bNewPage && GetNextContentArea(pTargetContentArea)) { return m_pCurPageArea; } @@ -1298,7 +1300,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(m_pCurPageArea); AddPageAreaLayoutItem(pNewRecord, m_pCurPageArea); - if (pTargetContentArea == NULL) { + if (!pTargetContentArea) { pTargetContentArea = m_pCurPageArea->GetFirstChildByClass(XFA_Element::ContentArea); } @@ -1319,14 +1321,14 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( } CXFA_Node* pPageSet = m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent); while (TRUE) { - if (FindPageAreaFromPageSet(pPageSet, NULL, pTargetPageArea, + if (FindPageAreaFromPageSet(pPageSet, nullptr, pTargetPageArea, pTargetContentArea, bNewPage, bQuery)) { return m_pCurPageArea; } if (!bQuery && IsPageSetRootOrderedOccurrence()) { CreateMinPageSetRecord(pPageSet); } - if (FindPageAreaFromPageSet(NULL, pPageSet, pTargetPageArea, + if (FindPageAreaFromPageSet(nullptr, pPageSet, pTargetPageArea, pTargetContentArea, bNewPage, bQuery)) { return m_pCurPageArea; } @@ -1335,23 +1337,23 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( } pPageSet = pPageSet->GetNodeItem(XFA_NODEITEM_Parent); } - return NULL; + return nullptr; } FX_BOOL CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) { CXFA_Node* pCurContentNode = GetCurrentContainerRecord()->pCurContentArea->m_pFormNode; - if (pContentArea == NULL) { + if (!pContentArea) { pContentArea = pCurContentNode->GetNextSameClassSibling(XFA_Element::ContentArea); - if (pContentArea == NULL) { + if (!pContentArea) { return FALSE; } } else { if (pContentArea->GetNodeItem(XFA_NODEITEM_Parent) != m_pCurPageArea) { return FALSE; } - CXFA_ContainerLayoutItem* pContentAreaLayout = NULL; + CXFA_ContainerLayoutItem* pContentAreaLayout = nullptr; if (!CheckContentAreaNotUsed(GetCurrentContainerRecord()->pCurPageArea, pContentArea, pContentAreaLayout)) { return FALSE; @@ -1389,7 +1391,7 @@ void CXFA_LayoutPageMgr::InitPageSetMap() { int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast) { - if (pPageArea == NULL) { + if (!pPageArea) { return 0; } CXFA_Node* pOccurNode = pPageArea->GetFirstChildByClass(XFA_Element::Occur); @@ -1415,7 +1417,7 @@ int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, } void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll) { - if (pPageSet == NULL) { + if (!pPageSet) { return; } int32_t iCurSetCount = 0; @@ -1447,7 +1449,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, } } void CXFA_LayoutPageMgr::CreateNextMinRecord(CXFA_Node* pRecordNode) { - if (pRecordNode == NULL) { + if (!pRecordNode) { return; } for (CXFA_Node* pCurrentNode = @@ -1477,7 +1479,7 @@ void CXFA_LayoutPageMgr::ProcessLastPageSet() { FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { CXFA_Node* pCurContentNode = GetCurrentContainerRecord()->pCurContentArea->m_pFormNode; - if (pCurContentNode == NULL) { + if (!pCurContentNode) { return FALSE; } pCurContentNode = @@ -1495,7 +1497,8 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { CXFA_Node* pSrcPage = m_pCurPageArea; int32_t nSrcPageCount = m_nCurPageCount; FX_POSITION psSrcRecord = m_rgProposedContainerRecord.GetTailPosition(); - CXFA_Node* pNextPage = GetNextAvailPageArea(NULL, NULL, FALSE, TRUE); + CXFA_Node* pNextPage = + GetNextAvailPageArea(nullptr, nullptr, FALSE, TRUE); m_pCurPageArea = pSrcPage; m_nCurPageCount = nSrcPageCount; CXFA_ContainerRecord* pPrevRecord = @@ -1553,8 +1556,8 @@ void CXFA_LayoutPageMgr::ClearRecordList() { } m_rgProposedContainerRecord.RemoveAll(); } - m_pCurrentContainerRecord = NULL; - m_pCurPageArea = NULL; + m_pCurrentContainerRecord = nullptr; + m_pCurPageArea = nullptr; m_nCurPageCount = 0; m_bCreateOverFlowPage = FALSE; m_pPageSetMap.RemoveAll(); @@ -1596,9 +1599,9 @@ void CXFA_LayoutPageMgr::SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem) { if (pCurLayoutItem->m_pFirstChild) { SaveLayoutItem(pCurLayoutItem); } - pCurLayoutItem->m_pParent = NULL; - pCurLayoutItem->m_pNextSibling = NULL; - pCurLayoutItem->m_pFirstChild = NULL; + pCurLayoutItem->m_pParent = nullptr; + pCurLayoutItem->m_pNextSibling = nullptr; + pCurLayoutItem->m_pFirstChild = nullptr; if (!pCurLayoutItem->IsContentLayoutItem() && pCurLayoutItem->m_pFormNode->GetElementType() != XFA_Element::PageArea) { @@ -1623,12 +1626,12 @@ CXFA_Node* CXFA_LayoutPageMgr::QueryOverflow( !wsOverflowTarget.IsEmpty()) { return pCurNode; } - return NULL; + return nullptr; } else if (pCurNode->GetElementType() == XFA_Element::Overflow) { return pCurNode; } } - return NULL; + return nullptr; } void CXFA_LayoutPageMgr::MergePageSetContents() { @@ -1647,7 +1650,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { CXFA_Node* pBindNode = pNode->GetBindData(); if (pBindNode) { pBindNode->RemoveBindItem(pNode); - pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); + pNode->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr); } } pNode->SetFlag(XFA_NodeFlag_UnusedNode, true); @@ -1681,7 +1684,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { if (pRootPageSetContainerItem->m_pFormNode->GetUserData( XFA_LAYOUTITEMKEY) == pRootPageSetContainerItem) { pRootPageSetContainerItem->m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, - NULL); + nullptr); } pRootPageSetContainerItem->m_pFormNode = pPendingPageSet; pPendingPageSet->ClearFlag(XFA_NodeFlag_UnusedNode); @@ -1711,7 +1714,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { (CXFA_ContainerLayoutItem*)pFormLayout->m_pNextSibling; } } - if (pFormLayout == NULL) { + if (!pFormLayout) { bIsExistForm = FALSE; break; } @@ -1903,7 +1906,7 @@ void XFA_ReleaseLayoutItem_NoPageArea(CXFA_LayoutItem* pLayoutItem) { CXFA_LayoutItem *pNext, *pNode = pLayoutItem->m_pFirstChild; while (pNode) { pNext = pNode->m_pNextSibling; - pNode->m_pParent = NULL; + pNode->m_pParent = nullptr; XFA_ReleaseLayoutItem_NoPageArea(pNode); pNode = pNext; } @@ -1912,7 +1915,7 @@ void XFA_ReleaseLayoutItem_NoPageArea(CXFA_LayoutItem* pLayoutItem) { } } void CXFA_LayoutPageMgr::PrepareLayout() { - m_pPageSetCurRoot = NULL; + m_pPageSetCurRoot = nullptr; m_ePageSetMode = XFA_ATTRIBUTEENUM_OrderedOccurrence; m_nAvailPages = 0; ClearRecordList(); @@ -1926,9 +1929,9 @@ void CXFA_LayoutPageMgr::PrepareLayout() { pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.RemoveAll(); if (pPageSetFormNode->HasRemovedChildren()) { XFA_ReleaseLayoutItem(pRootLayoutItem); - m_pPageSetLayoutItemRoot = NULL; - pRootLayoutItem = NULL; - pPageSetFormNode = NULL; + m_pPageSetLayoutItemRoot = nullptr; + pRootLayoutItem = nullptr; + pPageSetFormNode = nullptr; m_PageArray.RemoveAll(); } while (pPageSetFormNode) { @@ -1942,11 +1945,11 @@ void CXFA_LayoutPageMgr::PrepareLayout() { } } pRootLayoutItem = m_pPageSetLayoutItemRoot; - CXFA_ContainerLayoutItem* pNextLayout = NULL; + CXFA_ContainerLayoutItem* pNextLayout = nullptr; for (; pRootLayoutItem; pRootLayoutItem = pNextLayout) { pNextLayout = (CXFA_ContainerLayoutItem*)pRootLayoutItem->m_pNextSibling; SaveLayoutItem(pRootLayoutItem); delete pRootLayoutItem; } - m_pPageSetLayoutItemRoot = NULL; + m_pPageSetLayoutItemRoot = nullptr; } diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h index 91dd2bf306..5ffa40e5c8 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h @@ -12,9 +12,9 @@ class CXFA_ContainerRecord { public: - CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = NULL, - CXFA_ContainerLayoutItem* pPageArea = NULL, - CXFA_ContainerLayoutItem* pContentArea = NULL) + CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = nullptr, + CXFA_ContainerLayoutItem* pPageArea = nullptr, + CXFA_ContainerLayoutItem* pContentArea = nullptr) : pCurPageSet(pPageSet), pCurPageArea(pPageArea), pCurContentArea(pContentArea) {} @@ -53,7 +53,7 @@ class CXFA_LayoutPageMgr { FX_BOOL bDataMerge = FALSE, FX_BOOL bCreatePage = TRUE); CXFA_Node* QueryOverflow(CXFA_Node* pFormNode, - CXFA_LayoutContext* pLayoutContext = NULL); + CXFA_LayoutContext* pLayoutContext = nullptr); FX_BOOL ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, FX_BOOL bLeader, CXFA_Node*& pBookendAppendNode); @@ -72,7 +72,7 @@ class CXFA_LayoutPageMgr { ASSERT(result); return result; } - CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = NULL, + CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = nullptr, FX_BOOL bCreateNew = FALSE); void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_Node* pNewPageArea); @@ -101,27 +101,28 @@ class CXFA_LayoutPageMgr { void CreateNextMinRecord(CXFA_Node* pRecordNode); FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea = NULL, - CXFA_Node* pTargetContentArea = NULL, + CXFA_Node* pTargetPageArea = nullptr, + CXFA_Node* pTargetContentArea = nullptr, FX_BOOL bNewPage = FALSE, FX_BOOL bQuery = FALSE); - FX_BOOL FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet, - CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea = NULL, - CXFA_Node* pTargetContentArea = NULL, - FX_BOOL bNewPage = FALSE, - FX_BOOL bQuery = FALSE); + FX_BOOL FindPageAreaFromPageSet_Ordered( + CXFA_Node* pPageSet, + CXFA_Node* pStartChild, + CXFA_Node* pTargetPageArea = nullptr, + CXFA_Node* pTargetContentArea = nullptr, + FX_BOOL bNewPage = FALSE, + FX_BOOL bQuery = FALSE); FX_BOOL FindPageAreaFromPageSet_SimplexDuplex( CXFA_Node* pPageSet, CXFA_Node* pStartChild, - CXFA_Node* pTargetPageArea = NULL, - CXFA_Node* pTargetContentArea = NULL, + CXFA_Node* pTargetPageArea = nullptr, + CXFA_Node* pTargetContentArea = nullptr, FX_BOOL bNewPage = FALSE, FX_BOOL bQuery = FALSE, XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First); FX_BOOL MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL bLastMatch); CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea, - CXFA_Node* pTargetContentArea = NULL, + CXFA_Node* pTargetContentArea = nullptr, FX_BOOL bNewPage = FALSE, FX_BOOL bQuery = FALSE); FX_BOOL GetNextContentArea(CXFA_Node* pTargetContentArea); diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index 6287547431..507add939c 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -138,7 +138,7 @@ CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, void CXFA_XMLLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const { CXML_Element* pElement = m_pLocaleData->GetElement("", "datePatterns"); - if (pElement == NULL) { + if (!pElement) { return; } CFX_WideString wsName; @@ -162,7 +162,7 @@ void CXFA_XMLLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const { CXML_Element* pElement = m_pLocaleData->GetElement("", "timePatterns"); - if (pElement == NULL) { + if (!pElement) { return; } CFX_WideString wsName; @@ -186,7 +186,7 @@ void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, void CXFA_XMLLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString& wsPattern) const { CXML_Element* pElement = m_pLocaleData->GetElement("", "numberPatterns"); - if (pElement == NULL) { + if (!pElement) { return; } switch (eType) { @@ -340,7 +340,7 @@ void CXFA_NodeLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent, const CFX_WideStringC& wsName) const { CXFA_Node* pChild = - pParent ? pParent->GetNodeItem(XFA_NODEITEM_FirstChild) : NULL; + pParent ? pParent->GetNodeItem(XFA_NODEITEM_FirstChild) : nullptr; while (pChild) { CFX_WideString wsChild; if (pChild->GetAttribute(XFA_ATTRIBUTE_Name, wsChild)) { @@ -350,7 +350,7 @@ CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent, } pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); } - return NULL; + return nullptr; } CFX_WideString CXFA_NodeLocale::GetSymbol( XFA_Element eElement, diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index 8911a41b96..570a719279 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1033,19 +1033,19 @@ const uint8_t g_ruRU_Locale[] = { 0xB3, 0x85, 0xFA, 0x59, 0x2A, 0x7A, 0xFF, 0x3D, 0xC4, 0x3F, 0xDE, 0xCB, 0x8B, 0xC4}; static IFX_Locale* XFA_GetLocaleFromBuffer(const uint8_t* pBuf, int nBufLen) { - if (pBuf == NULL || nBufLen <= 0) { - return NULL; + if (!pBuf || nBufLen <= 0) { + return nullptr; } CFX_GEModule* pGeModule = CFX_GEModule::Get(); if (!pGeModule) { - return NULL; + return nullptr; } CCodec_ModuleMgr* pCodecMgr = pGeModule->GetCodecModule(); if (!pCodecMgr) { - return NULL; + return nullptr; } - CXML_Element* pLocale = NULL; - uint8_t* pOut = NULL; + CXML_Element* pLocale = nullptr; + uint8_t* pOut = nullptr; uint32_t dwSize; pCodecMgr->GetFlateModule()->FlateOrLZWDecode(FALSE, pBuf, nBufLen, TRUE, 0, 0, 0, 0, 0, pOut, dwSize); @@ -1056,7 +1056,7 @@ static IFX_Locale* XFA_GetLocaleFromBuffer(const uint8_t* pBuf, int nBufLen) { if (pLocale) { return new CXFA_XMLLocale(pLocale); } - return NULL; + return nullptr; } static uint16_t XFA_GetLanguage(CFX_WideString wsLanguage) { uint16_t dwLangueID = XFA_LANGID_en_US; @@ -1163,7 +1163,7 @@ IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { } IFX_Locale* CXFA_LocaleMgr::GetLocale(uint16_t lcid) { - IFX_Locale* pLocal = NULL; + IFX_Locale* pLocal = nullptr; switch (lcid) { case XFA_LANGID_zh_CN: pLocal = XFA_GetLocaleFromBuffer(g_zhCN_Locale, sizeof(g_zhCN_Locale)); @@ -1226,7 +1226,7 @@ IFX_Locale* CXFA_LocaleMgr::GetLocaleByName( } int32_t iLen = wsLocaleName.GetLength(); if (iLen < 2) { - return NULL; + return nullptr; } iCount = m_XMLLocaleArray.GetSize(); for (i = 0; i < iCount; i++) { @@ -1256,9 +1256,10 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { CXFA_Node* pCommon = pChildfConfig ? pChildfConfig->GetFirstChildByClass(XFA_Element::Common) - : NULL; + : nullptr; CXFA_Node* pLocale = - pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale) : NULL; + pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale) + : nullptr; if (pLocale) { pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE); } @@ -1267,7 +1268,7 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { } return m_wsConfigLocale.AsStringC(); } -static CXFA_TimeZoneProvider* g_pProvider = NULL; +static CXFA_TimeZoneProvider* g_pProvider = nullptr; // Static. CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() { @@ -1287,7 +1288,7 @@ CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Get() { // Static. void CXFA_TimeZoneProvider::Destroy() { delete g_pProvider; - g_pProvider = NULL; + g_pProvider = nullptr; } #include <time.h> diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index f9c86b0961..0aa646d932 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -34,12 +34,12 @@ static const FX_DOUBLE fraction_scales[] = {0.1, CXFA_LocaleValue::CXFA_LocaleValue() { m_dwType = XFA_VT_NULL; m_bValid = TRUE; - m_pLocaleMgr = NULL; + m_pLocaleMgr = nullptr; } CXFA_LocaleValue::CXFA_LocaleValue(const CXFA_LocaleValue& value) { m_dwType = XFA_VT_NULL; m_bValid = TRUE; - m_pLocaleMgr = NULL; + m_pLocaleMgr = nullptr; *this = value; } CXFA_LocaleValue::CXFA_LocaleValue(uint32_t dwType, diff --git a/xfa/fxfa/parser/xfa_localevalue.h b/xfa/fxfa/parser/xfa_localevalue.h index 912af93eeb..83885bd56d 100644 --- a/xfa/fxfa/parser/xfa_localevalue.h +++ b/xfa/fxfa/parser/xfa_localevalue.h @@ -44,7 +44,7 @@ class CXFA_LocaleValue { FX_BOOL ValidateValue(const CFX_WideString& wsValue, const CFX_WideString& wsPattern, IFX_Locale* pLocale, - CFX_WideString* pMatchFormat = NULL); + CFX_WideString* pMatchFormat = nullptr); FX_BOOL FormatPatterns(CFX_WideString& wsResult, const CFX_WideString& wsFormat, IFX_Locale* pLocale, @@ -65,8 +65,8 @@ class CXFA_LocaleValue { FX_BOOL bSign = TRUE); FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, - IFX_Locale* pLocale = NULL, - int32_t* pos = NULL); + IFX_Locale* pLocale = nullptr, + int32_t* pos = nullptr); CFX_WideString GetValue() const; uint32_t GetType() const; diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index 54cacc318a..e402c1826f 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -270,19 +270,19 @@ class CXFA_Node : public CXFA_Object { CXFA_Measurement GetMeasure(XFA_ATTRIBUTE eAttr) const; FX_BOOL SetObject(XFA_ATTRIBUTE eAttr, void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL); + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); FX_BOOL TryObject(XFA_ATTRIBUTE eAttr, void*& pData); void* GetObject(XFA_ATTRIBUTE eAttr) { void* pData; - return TryObject(eAttr, pData) ? pData : NULL; + return TryObject(eAttr, pData) ? pData : nullptr; } FX_BOOL SetUserData(void* pKey, void* pData, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL); + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); FX_BOOL TryUserData(void* pKey, void*& pData, FX_BOOL bProtoAlso = FALSE); void* GetUserData(void* pKey, FX_BOOL bProtoAlso = FALSE) { void* pData; - return TryUserData(pKey, pData, bProtoAlso) ? pData : NULL; + return TryUserData(pKey, pData, bProtoAlso) ? pData : nullptr; } CXFA_Node* GetProperty(int32_t index, XFA_Element eType, @@ -292,7 +292,7 @@ class CXFA_Node : public CXFA_Object { XFA_Element eType, FX_BOOL bOnlyChild = FALSE); int32_t InsertChild(int32_t index, CXFA_Node* pNode); - FX_BOOL InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = NULL); + FX_BOOL InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr); FX_BOOL RemoveChild(CXFA_Node* pNode, bool bNotify = true); CXFA_Node* Clone(FX_BOOL bRecursive); CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const; @@ -335,7 +335,7 @@ class CXFA_Node : public CXFA_Object { void Script_Som_ResolveNodeList(CFXJSE_Value* pValue, CFX_WideString wsExpression, uint32_t dwFlag, - CXFA_Node* refNode = NULL); + CXFA_Node* refNode = nullptr); void Script_TreeClass_All(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); @@ -646,16 +646,17 @@ class CXFA_Node : public CXFA_Object { FX_BOOL GetMapModuleValue(void* pKey, void*& pValue); void SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue); FX_BOOL GetMapModuleString(void* pKey, CFX_WideStringC& wsValue); - void SetMapModuleBuffer(void* pKey, - void* pValue, - int32_t iBytes, - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL); + void SetMapModuleBuffer( + void* pKey, + void* pValue, + int32_t iBytes, + XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr); FX_BOOL GetMapModuleBuffer(void* pKey, void*& pValue, int32_t& iBytes, FX_BOOL bProtoAlso = TRUE) const; FX_BOOL HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso = FALSE); - void RemoveMapModuleKey(void* pKey = NULL); + void RemoveMapModuleKey(void* pKey = nullptr); void MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr = TRUE); void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey); void MoveBufferMapData(CXFA_Node* pSrcModule, @@ -746,17 +747,17 @@ class CXFA_AttachNodeList : public CXFA_NodeList { class CXFA_TraverseStrategy_XFAContainerNode { public: static CXFA_Node* GetFirstChild(CXFA_Node* pTemplateNode, - void* pUserData = NULL) { + void* pUserData = nullptr) { return pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode); } static CXFA_Node* GetNextSibling(CXFA_Node* pTemplateNode, - void* pUserData = NULL) { + void* pUserData = nullptr) { return pTemplateNode->GetNodeItem(XFA_NODEITEM_NextSibling, XFA_ObjectType::ContainerNode); } static CXFA_Node* GetParent(CXFA_Node* pTemplateNode, - void* pUserData = NULL) { + void* pUserData = nullptr) { return pTemplateNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode); } diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index 47b244fce5..28c56ce0f3 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -3977,7 +3977,7 @@ FX_BOOL CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr, FX_BOOL CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) { void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); pData = GetUserData(pKey); - return pData != nullptr; + return !!pData; } FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTETYPE eType, @@ -5076,8 +5076,8 @@ CXFA_ThisProxy::CXFA_ThisProxy(CXFA_Node* pThisNode, CXFA_Node* pScriptNode) : CXFA_Object(pThisNode->GetDocument(), XFA_ObjectType::VariablesThis, XFA_Element::Unknown), - m_pThisNode(NULL), - m_pScriptNode(NULL) { + m_pThisNode(nullptr), + m_pScriptNode(nullptr) { m_pThisNode = pThisNode; m_pScriptNode = pScriptNode; } diff --git a/xfa/fxfa/parser/xfa_parser.h b/xfa/fxfa/parser/xfa_parser.h index b6c81e9f18..90b462541c 100644 --- a/xfa/fxfa/parser/xfa_parser.h +++ b/xfa/fxfa/parser/xfa_parser.h @@ -20,10 +20,10 @@ class IXFA_Parser { virtual void Release() = 0; virtual int32_t StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0; - virtual int32_t DoParse(IFX_Pause* pPause = NULL) = 0; + virtual int32_t DoParse(IFX_Pause* pPause = nullptr) = 0; virtual int32_t ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = NULL) = 0; + IFX_Pause* pPause = nullptr) = 0; virtual void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) = 0; virtual CXFA_Document* GetFactory() const = 0; diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 20964053f5..5e17df8d3a 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -47,7 +47,7 @@ static CFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( CFDE_XMLDoc* pXMLDoc, FX_BOOL bVerifyWellFormness = FALSE) { if (!pXMLDoc) { - return NULL; + return nullptr; } CFDE_XMLNode* pXMLFakeRoot = pXMLDoc->GetRoot(); for (CFDE_XMLNode* pXMLNode = @@ -67,7 +67,7 @@ static CFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( return pXMLNode; } } - return NULL; + return nullptr; } int32_t CXFA_SimpleParser::StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID) { @@ -75,7 +75,7 @@ int32_t CXFA_SimpleParser::StartParse(IFX_FileRead* pStream, m_pFileRead = pStream; m_pStream = IFX_Stream::CreateStream( pStream, FX_STREAMACCESS_Read | FX_STREAMACCESS_Text); - if (m_pStream == NULL) { + if (!m_pStream) { return XFA_PARSESTATUS_StreamErr; } uint16_t wCodePage = m_pStream->GetCodePage(); @@ -92,7 +92,7 @@ int32_t CXFA_SimpleParser::StartParse(IFX_FileRead* pStream, return XFA_PARSESTATUS_Ready; } int32_t CXFA_SimpleParser::DoParse(IFX_Pause* pPause) { - if (m_pXMLDoc == NULL || m_ePacketID == XFA_XDPPACKET_UNKNOWN) { + if (!m_pXMLDoc || m_ePacketID == XFA_XDPPACKET_UNKNOWN) { return XFA_PARSESTATUS_StatusErr; } int32_t iRet = m_pXMLDoc->DoLoad(pPause); @@ -107,7 +107,7 @@ int32_t CXFA_SimpleParser::DoParse(IFX_Pause* pPause) { m_pXMLDoc->CloseXML(); if (m_pStream) { m_pStream->Release(); - m_pStream = NULL; + m_pStream = nullptr; } if (!m_pRootNode) { return XFA_PARSESTATUS_StatusErr; @@ -118,7 +118,7 @@ int32_t CXFA_SimpleParser::ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, IFX_Pause* pPause) { CloseParser(); - pXMLNode = NULL; + pXMLNode = nullptr; IFX_Stream* pStream = XFA_CreateWideTextRead(wsXML); if (!pStream) { return XFA_PARSESTATUS_StreamErr; @@ -142,7 +142,7 @@ int32_t CXFA_SimpleParser::ParseXMLData(const CFX_WideString& wsXML, } if (m_pStream) { m_pStream->Release(); - m_pStream = NULL; + m_pStream = nullptr; } pXMLNode = XFA_FDEExtension_GetDocumentNode(m_pXMLDoc); return XFA_PARSESTATUS_Done; @@ -356,7 +356,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket(CFDE_XMLNode* pXMLDocumentNode, XFA_XDPPACKET ePacketID) { switch (ePacketID) { case XFA_XDPPACKET_UNKNOWN: - return NULL; + return nullptr; case XFA_XDPPACKET_XDP: return ParseAsXDPPacket_XDP(pXMLDocumentNode, ePacketID); case XFA_XDPPACKET_Config: @@ -426,7 +426,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( pXMLConfigDOMRoot = pChildItem; pXFAConfigDOMRoot = ParseAsXDPPacket_Config(pXMLConfigDOMRoot, XFA_XDPPACKET_Config); - pXFARootNode->InsertChild(pXFAConfigDOMRoot, NULL); + pXFARootNode->InsertChild(pXFAConfigDOMRoot, nullptr); } } CFDE_XMLNode* pXMLDatasetsDOMRoot = nullptr; @@ -522,17 +522,17 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Config( pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_Config)->pName, XFA_GetPacketByIndex(XFA_PACKET_Config)->pURI, XFA_GetPacketByIndex(XFA_PACKET_Config)->eFlags)) { - return NULL; + return nullptr; } CXFA_Node* pNode = m_pFactory->CreateNode(XFA_XDPPACKET_Config, XFA_Element::Config); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Config)->pName); if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID)) { - return NULL; + return nullptr; } pNode->SetXMLMappingNode(pXMLDocumentNode); return pNode; @@ -540,7 +540,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Config( CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( CFDE_XMLNode* pXMLDocumentNode, XFA_XDPPACKET ePacketID) { - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (ePacketID == XFA_XDPPACKET_Template) { if (XFA_FDEExtension_MatchNodeName( pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_Template)->pName, @@ -549,7 +549,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( pNode = m_pFactory->CreateNode(XFA_XDPPACKET_Template, XFA_Element::Template); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Template)->pName); @@ -564,7 +564,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI); } if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID)) { - return NULL; + return nullptr; } } } else if (ePacketID == XFA_XDPPACKET_Form) { @@ -578,7 +578,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( pXMLDocumentElement->GetString(L"checksum", wsChecksum); if (wsChecksum.GetLength() != 28 || m_pXMLParser->m_dwCheckStatus != 0x03) { - return NULL; + return nullptr; } std::unique_ptr<CXFA_ChecksumContext> pChecksum(new CXFA_ChecksumContext); pChecksum->StartChecksum(); @@ -603,7 +603,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( CXFA_Node* pTemplateChosen = pTemplateRoot ? pTemplateRoot->GetFirstChildByClass(XFA_Element::Subform) - : NULL; + : nullptr; FX_BOOL bUseAttribute = TRUE; if (pTemplateChosen && pTemplateChosen->GetEnum(XFA_ATTRIBUTE_RestoreState) != @@ -611,7 +611,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( bUseAttribute = FALSE; } if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, bUseAttribute)) { - return NULL; + return nullptr; } } } @@ -631,7 +631,7 @@ static CFDE_XMLNode* XFA_GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) { pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_XDP)->pName, XFA_GetPacketByIndex(XFA_PACKET_XDP)->pURI, XFA_GetPacketByIndex(XFA_PACKET_XDP)->eFlags)) { - return NULL; + return nullptr; } for (CFDE_XMLNode* pDatasetsNode = pXMLDocumentNode->GetNodeItem(CFDE_XMLNode::FirstChild); @@ -645,7 +645,7 @@ static CFDE_XMLNode* XFA_GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) { } return pDatasetsNode; } - return NULL; + return nullptr; } CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( CFDE_XMLNode* pXMLDocumentNode, @@ -655,17 +655,17 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( CXFA_Node* pNode = m_pFactory->CreateNode(XFA_XDPPACKET_Datasets, XFA_Element::DataModel); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Datasets)->pName); if (!DataLoader(pNode, pDatasetsXMLNode, FALSE)) { - return NULL; + return nullptr; } pNode->SetXMLMappingNode(pDatasetsXMLNode); return pNode; } - CFDE_XMLNode* pDataXMLNode = NULL; + CFDE_XMLNode* pDataXMLNode = nullptr; if (XFA_FDEExtension_MatchNodeName( pXMLDocumentNode, FX_WSTRC(L"data"), XFA_GetPacketByIndex(XFA_PACKET_Datasets)->pURI, @@ -695,13 +695,13 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( if (pDataXMLNode != pXMLDocumentNode) { pDataXMLNode->Release(); } - return NULL; + return nullptr; } CFX_WideString wsLocalName; static_cast<CFDE_XMLElement*>(pDataXMLNode)->GetLocalTagName(wsLocalName); pNode->SetCData(XFA_ATTRIBUTE_Name, wsLocalName); if (!DataLoader(pNode, pDataXMLNode, TRUE)) { - return NULL; + return nullptr; } pNode->SetXMLMappingNode(pDataXMLNode); if (pDataXMLNode != pXMLDocumentNode) { @@ -709,12 +709,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( } return pNode; } - return NULL; + return nullptr; } CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( CFDE_XMLNode* pXMLDocumentNode, XFA_XDPPACKET ePacketID) { - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (ePacketID == XFA_XDPPACKET_LocaleSet) { if (XFA_FDEExtension_MatchNodeName( pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_LocaleSet)->pName, @@ -723,12 +723,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode = m_pFactory->CreateNode(XFA_XDPPACKET_LocaleSet, XFA_Element::LocaleSet); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_LocaleSet)->pName); if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID)) { - return NULL; + return nullptr; } } } else if (ePacketID == XFA_XDPPACKET_ConnectionSet) { @@ -740,12 +740,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode = m_pFactory->CreateNode(XFA_XDPPACKET_ConnectionSet, XFA_Element::ConnectionSet); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_ConnectionSet)->pName); if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID)) { - return NULL; + return nullptr; } } } else if (ePacketID == XFA_XDPPACKET_SourceSet) { @@ -756,12 +756,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet( pNode = m_pFactory->CreateNode(XFA_XDPPACKET_SourceSet, XFA_Element::SourceSet); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_SourceSet)->pName); if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID)) { - return NULL; + return nullptr; } } } @@ -780,14 +780,14 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Xdc( CXFA_Node* pNode = m_pFactory->CreateNode(XFA_XDPPACKET_Xdc, XFA_Element::Xdc); if (!pNode) { - return NULL; + return nullptr; } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Xdc)->pName); pNode->SetXMLMappingNode(pXMLDocumentNode); return pNode; } - return NULL; + return nullptr; } CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_User( CFDE_XMLNode* pXMLDocumentNode, @@ -795,13 +795,13 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_User( CXFA_Node* pNode = m_pFactory->CreateNode(XFA_XDPPACKET_XDP, XFA_Element::Packet); if (!pNode) { - return NULL; + return nullptr; } CFX_WideString wsName; static_cast<CFDE_XMLElement*>(pXMLDocumentNode)->GetLocalTagName(wsName); pNode->SetCData(XFA_ATTRIBUTE_Name, wsName); if (!UserPacketLoader(pNode, pXMLDocumentNode)) { - return NULL; + return nullptr; } pNode->SetXMLMappingNode(pXMLDocumentNode); return pNode; @@ -848,12 +848,11 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, bOneOfPropertyFound = TRUE; } CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, eType); - if (pXFAChild == NULL) { - return NULL; - } - if (ePacketID == XFA_XDPPACKET_Config) { + if (!pXFAChild) + return nullptr; + if (ePacketID == XFA_XDPPACKET_Config) pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName.AsStringC()); - } + FX_BOOL IsNeedValue = TRUE; for (int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { @@ -1102,7 +1101,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, } CXFA_Node* pXFAChild = m_pFactory->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); - if (pXFAChild == NULL) { + if (!pXFAChild) { return; } CFX_WideString wsNodeName; @@ -1142,7 +1141,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, } CXFA_Node* pXFAMetaData = m_pFactory->CreateNode( XFA_XDPPACKET_Datasets, XFA_Element::DataValue); - if (pXFAMetaData == NULL) { + if (!pXFAMetaData) { return; } pXFAMetaData->SetCData(XFA_ATTRIBUTE_Name, wsAttrName); @@ -1182,7 +1181,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, } CXFA_Node* pXFAChild = m_pFactory->CreateNode(XFA_XDPPACKET_Datasets, XFA_Element::DataValue); - if (pXFAChild == NULL) { + if (!pXFAChild) { return; } pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCharData); @@ -1200,7 +1199,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, } CXFA_Node* pXFAChild = m_pFactory->CreateNode(XFA_XDPPACKET_Datasets, XFA_Element::DataValue); - if (pXFAChild == NULL) { + if (!pXFAChild) { return; } pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsText); @@ -1346,16 +1345,16 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, void CXFA_SimpleParser::CloseParser() { if (m_pXMLDoc) { m_pXMLDoc->Release(); - m_pXMLDoc = NULL; + m_pXMLDoc = nullptr; } if (m_pStream) { m_pStream->Release(); - m_pStream = NULL; + m_pStream = nullptr; } } CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify) - : m_nodeParser(NULL, TRUE), m_pNotify(pNotify), m_pDocument(NULL) {} + : m_nodeParser(nullptr, TRUE), m_pNotify(pNotify), m_pDocument(nullptr) {} CXFA_DocumentParser::~CXFA_DocumentParser() { CloseParser(); } @@ -1385,7 +1384,7 @@ int32_t CXFA_DocumentParser::ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, IFX_Pause* pPause) { CloseParser(); - int32_t nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, NULL); + int32_t nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, nullptr); if (nRetStatus == XFA_PARSESTATUS_Done && pXMLNode) { m_pDocument = new CXFA_Document(this); m_nodeParser.SetFactory(m_pDocument); @@ -1521,7 +1520,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { m_pChild = new CFDE_XMLInstruction(m_ws1); m_pParent->InsertChildNode(m_pChild); } else { - m_pChild = NULL; + m_pChild = nullptr; } m_ws1.clear(); break; diff --git a/xfa/fxfa/parser/xfa_parser_imp.h b/xfa/fxfa/parser/xfa_parser_imp.h index 3a56cc0996..df0b31dc69 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.h +++ b/xfa/fxfa/parser/xfa_parser_imp.h @@ -21,10 +21,10 @@ class CXFA_SimpleParser : public IXFA_Parser { void Release() override; int32_t StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; - int32_t DoParse(IFX_Pause* pPause = NULL) override; + int32_t DoParse(IFX_Pause* pPause = nullptr) override; int32_t ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = NULL) override; + IFX_Pause* pPause = nullptr) override; void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; CXFA_Document* GetFactory() const override; CXFA_Node* GetRootNode() const override; @@ -91,10 +91,10 @@ class CXFA_DocumentParser : public IXFA_Parser { void Release() override; int32_t StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; - int32_t DoParse(IFX_Pause* pPause = NULL) override; + int32_t DoParse(IFX_Pause* pPause = nullptr) override; int32_t ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = NULL) override; + IFX_Pause* pPause = nullptr) override; void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; CXFA_Document* GetFactory() const override; CXFA_Node* GetRootNode() const override; diff --git a/xfa/fxfa/parser/xfa_script.h b/xfa/fxfa/parser/xfa_script.h index faaaceec78..020e809881 100644 --- a/xfa/fxfa/parser/xfa_script.h +++ b/xfa/fxfa/parser/xfa_script.h @@ -60,7 +60,7 @@ struct XFA_RESOLVENODE_RS { }; inline XFA_RESOLVENODE_RS::XFA_RESOLVENODE_RS() - : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {} + : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(nullptr) {} inline XFA_RESOLVENODE_RS::~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index bd4b73247a..84d5fc9223 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -305,7 +305,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( if (!pNotify) { return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { std::unique_ptr<CFXJSE_Value> pValue(pArguments->GetValue(0)); if (pValue->IsObject()) { @@ -435,7 +435,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( } int32_t iStart = 0; CFX_WideString wsName; - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; int32_t iExpLength = wsExpression.GetLength(); while (iStart < iExpLength) { iStart = XFA_FilterName(wsExpression.AsStringC(), iStart, wsName); @@ -496,7 +496,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( if (!pNotify) { return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { std::unique_ptr<CFXJSE_Value> pValue(pArguments->GetValue(0)); if (pValue->IsObject()) { @@ -586,7 +586,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg( CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue) { - if (pArguments == NULL || iArgIndex < 0) { + if (!pArguments || iArgIndex < 0) { return FALSE; } FX_BOOL bIsJsType = FALSE; diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index 2afa5fcdec..109fc311e6 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -643,7 +643,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, if (nNodes < 1) { if (dwStyles & XFA_RESOLVENODE_CreateNode) { bNextCreate = TRUE; - if (m_ResolveProcessor->GetNodeHelper()->m_pCreateParent == nullptr) { + if (!m_ResolveProcessor->GetNodeHelper()->m_pCreateParent) { m_ResolveProcessor->GetNodeHelper()->m_pCreateParent = ToNode(rndFind.m_CurNode); m_ResolveProcessor->GetNodeHelper()->m_iCreateCount = 1; diff --git a/xfa/fxfa/parser/xfa_script_imp.h b/xfa/fxfa/parser/xfa_script_imp.h index 08be85f7c9..c6bb14862e 100644 --- a/xfa/fxfa/parser/xfa_script_imp.h +++ b/xfa/fxfa/parser/xfa_script_imp.h @@ -32,13 +32,13 @@ class CXFA_ScriptContext { FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, const CFX_WideStringC& wsScript, CFXJSE_Value* pRetValue, - CXFA_Object* pThisObject = NULL); + CXFA_Object* pThisObject = nullptr); int32_t ResolveObjects(CXFA_Object* refNode, const CFX_WideStringC& wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, uint32_t dwStyles = XFA_RESOLVENODE_Children, - CXFA_Node* bindNode = NULL); + CXFA_Node* bindNode = nullptr); CFXJSE_Value* GetJSValueFromMap(CXFA_Object* pObject); void AddToCacheList(std::unique_ptr<CXFA_NodeList> pList); CXFA_Object* GetThisObject() const { return m_pThisObject; } diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp index de47bd2e91..e158132170 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp @@ -48,7 +48,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( XFA_LAYOUTMODEL_HWXY layoutModel) { int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { - const FX_WCHAR* methodName = NULL; + const FX_WCHAR* methodName = nullptr; switch (layoutModel) { case XFA_LAYOUTMODEL_H: methodName = L"h"; @@ -66,7 +66,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; CFX_WideString wsUnit(L"pt"); int32_t iIndex = 0; if (iLength >= 1) { @@ -178,7 +178,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan"); return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); } @@ -424,7 +424,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"absPageInBatch"); return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); } @@ -457,7 +457,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch"); return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); } @@ -511,7 +511,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp( ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); return; } - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); } diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp index 42f406e48a..e866a1923d 100644 --- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp +++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp @@ -18,11 +18,11 @@ CXFA_NodeHelper::CXFA_NodeHelper() : m_eLastCreateType(XFA_Element::DataValue), - m_pCreateParent(NULL), + m_pCreateParent(nullptr), m_iCreateCount(0), m_iCreateFlag(XFA_RESOLVENODE_RSTYPE_CreateNodeOne), m_iCurAllStart(-1), - m_pAllStartParent(NULL) {} + m_pAllStartParent(nullptr) {} CXFA_NodeHelper::~CXFA_NodeHelper() {} @@ -30,14 +30,14 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetOneChild( CXFA_Node* parent, const FX_WCHAR* pwsName, FX_BOOL bIsClassName) { - if (parent == NULL) { - return NULL; + if (!parent) { + return nullptr; } CXFA_NodeArray siblings; uint32_t uNameHash = FX_HashCode_GetW(CFX_WideStringC(pwsName), false); XFA_NodeAcc_TraverseAnySiblings(parent, uNameHash, &siblings, bIsClassName); if (siblings.GetSize() == 0) { - return NULL; + return nullptr; } return siblings[0]; } @@ -56,7 +56,7 @@ int32_t CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, parent->GetElementType(), pNode->GetElementType(), XFA_XDPPACKET_UNKNOWN); if (!pProperty && eLogicType == XFA_LOGIC_Transparent) { parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_Transparent); - if (parent == NULL) { + if (!parent) { return 0; } } @@ -74,7 +74,7 @@ int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings( uint32_t dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName) { - if (parent == NULL || pSiblings == NULL) { + if (!parent || !pSiblings) { return 0; } int32_t nCount = 0; @@ -136,7 +136,7 @@ int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName, FX_BOOL bIsFindProperty) { - if (parent == NULL || pSiblings == NULL) { + if (!parent || !pSiblings) { return 0; } int32_t nCount = 0; @@ -211,7 +211,7 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetParent( CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType) { if (!pNode) { - return NULL; + return nullptr; } if (eLogicType == XFA_LOGIC_NoTransparent) { return pNode->GetNodeItem(XFA_NODEITEM_Parent); @@ -220,7 +220,7 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetParent( CXFA_Node* node = pNode; while (TRUE) { parent = XFA_ResolveNodes_GetParent(node); - if (parent == NULL) { + if (!parent) { break; } XFA_Element parentType = parent->GetElementType(); @@ -239,12 +239,12 @@ int32_t CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, FX_BOOL bIsClassIndex) { CXFA_Node* parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent); - if (parent == NULL) { + if (!parent) { return 0; } if (!bIsProperty && eLogicType == XFA_LOGIC_Transparent) { parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_Transparent); - if (parent == NULL) { + if (!parent) { return 0; } } @@ -302,7 +302,7 @@ void CXFA_NodeHelper::XFA_GetNameExpression(CXFA_Node* refNode, } FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) { - if (refNode == NULL) { + if (!refNode) { return FALSE; } XFA_Element refNodeType = refNode->GetElementType(); @@ -358,7 +358,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode( CFX_WideString wsCondition, FX_BOOL bLastNode, CXFA_ScriptContext* pScriptContext) { - if (m_pCreateParent == NULL) { + if (!m_pCreateParent) { return FALSE; } FX_BOOL bIsClassName = FALSE; @@ -409,13 +409,13 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode( } } if (!bResult) { - m_pCreateParent = NULL; + m_pCreateParent = nullptr; } return bResult; } void CXFA_NodeHelper::XFA_SetCreateNodeType(CXFA_Node* refNode) { - if (refNode == NULL) { + if (!refNode) { return; } if (refNode->GetElementType() == XFA_Element::Subform) { diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index bcfaa113d4..2ca137e510 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -25,7 +25,7 @@ CXFA_ResolveProcessor::~CXFA_ResolveProcessor() { } int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { - if (rnd.m_CurNode == NULL) { + if (!rnd.m_CurNode) { return -1; } if (!rnd.m_CurNode->IsNode()) { @@ -84,7 +84,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild( CXFA_ResolveNodesData& rnd) { CFX_WideString wsName = rnd.m_wsName; CFX_WideString wsCondition = rnd.m_wsCondition; - CXFA_Node* findNode = NULL; + CXFA_Node* findNode = nullptr; CXFA_NodeArray siblings; FX_BOOL bClassName = FALSE; if (wsName.GetAt(0) == '#') { @@ -93,7 +93,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild( } findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild( ToNode(rnd.m_CurNode), wsName.c_str(), bClassName); - if (findNode == NULL) { + if (!findNode) { return 0; } if (wsCondition.IsEmpty()) { @@ -226,8 +226,8 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( rndFind.m_uHashName = uNameHash; CXFA_NodeArray children; CXFA_NodeArray properties; - CXFA_Node* pVariablesNode = NULL; - CXFA_Node* pPageSetNode = NULL; + CXFA_Node* pVariablesNode = nullptr; + CXFA_Node* pPageSetNode = nullptr; CXFA_Node* pChild = curNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { if (pChild->GetElementType() == XFA_Element::Variables) { @@ -353,7 +353,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( } return 0; } - CXFA_Node* pProp = NULL; + CXFA_Node* pProp = nullptr; if (XFA_Element::Subform == curNode->GetElementType() && XFA_HASHCODE_Occur == uNameHash) { CXFA_Node* pInstanceManager = @@ -650,7 +650,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray( m_pNodeHelper->m_iCreateCount = 1; findNodes.RemoveAll(); m_pNodeHelper->m_iCurAllStart = -1; - m_pNodeHelper->m_pAllStartParent = NULL; + m_pNodeHelper->m_pAllStartParent = nullptr; } else { if (m_pNodeHelper->m_iCurAllStart == -1) { m_pNodeHelper->m_iCurAllStart = m_iCurStart; @@ -826,14 +826,14 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_SetIndexDataBind( CXFA_ResolveNodesData::CXFA_ResolveNodesData(CXFA_ScriptContext* pSC) : m_pSC(pSC), - m_CurNode(NULL), + m_CurNode(nullptr), m_wsName(), m_uHashName(XFA_HASHCODE_None), m_wsCondition(), m_nLevel(0), m_Nodes(), m_dwStyles(XFA_RESOLVENODE_Children), - m_pScriptAttribute(NULL), + m_pScriptAttribute(nullptr), m_dwFlag(XFA_RESOVENODE_RSTYPE_Nodes) {} CXFA_ResolveNodesData::~CXFA_ResolveNodesData() { diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.h b/xfa/fxfa/parser/xfa_script_resolveprocessor.h index ae9add69cb..ffcd9b4475 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.h +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.h @@ -15,7 +15,7 @@ class CXFA_ScriptContext; class CXFA_ResolveNodesData { public: - CXFA_ResolveNodesData(CXFA_ScriptContext* pSC = NULL); + CXFA_ResolveNodesData(CXFA_ScriptContext* pSC = nullptr); ~CXFA_ResolveNodesData(); CXFA_ScriptContext* m_pSC; diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp index face46bed8..2d7e1860cf 100644 --- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp @@ -36,7 +36,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify( return; } CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); } @@ -57,7 +57,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign( return; } CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_NodeList* pNodeList = NULL; + CXFA_NodeList* pNodeList = nullptr; CFX_WideString wsExpression; CFX_WideString wsXMLIdent; if (iLength >= 1) { @@ -107,7 +107,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear( return; } CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_Node* pNode = NULL; + CXFA_Node* pNode = nullptr; FX_BOOL bClear = TRUE; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index bf050e7a3c..1036d9353f 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -32,7 +32,8 @@ FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( template <class NodeType, class TraverseStrategy> class CXFA_NodeIteratorTemplate { public: - CXFA_NodeIteratorTemplate(NodeType* pRootNode = NULL) : m_pRoot(pRootNode) { + CXFA_NodeIteratorTemplate(NodeType* pRootNode = nullptr) + : m_pRoot(pRootNode) { if (pRootNode) { m_NodeStack.Push(pRootNode); } @@ -74,13 +75,13 @@ class CXFA_NodeIteratorTemplate { return TRUE; } NodeType* GetCurrent() const { - return m_NodeStack.GetSize() ? *m_NodeStack.GetTopElement() : NULL; + return m_NodeStack.GetSize() ? *m_NodeStack.GetTopElement() : nullptr; } NodeType* GetRoot() const { return m_pRoot; } NodeType* MoveToPrev() { int32_t nStackLength = m_NodeStack.GetSize(); if (nStackLength == 1) { - return NULL; + return nullptr; } else if (nStackLength > 1) { NodeType* pCurItem = *m_NodeStack.GetTopElement(); m_NodeStack.Pop(); @@ -90,7 +91,7 @@ class CXFA_NodeIteratorTemplate { if (pCurItem == pParentFirstChildItem) { return pParentItem; } - NodeType *pPrevItem = pParentFirstChildItem, *pPrevItemNext = NULL; + NodeType *pPrevItem = pParentFirstChildItem, *pPrevItemNext = nullptr; for (; pPrevItem; pPrevItem = pPrevItemNext) { pPrevItemNext = TraverseStrategy::GetNextSibling(pPrevItem); if (!pPrevItemNext || pPrevItemNext == pCurItem) { @@ -107,7 +108,7 @@ class CXFA_NodeIteratorTemplate { if (m_NodeStack.GetSize() > 0) { NodeType* pChildItem = *m_NodeStack.GetTopElement(); while ((pChildItem = TraverseStrategy::GetFirstChild(pChildItem)) != - NULL) { + nullptr) { while (NodeType* pNextItem = TraverseStrategy::GetNextSibling(pChildItem)) { pChildItem = pNextItem; @@ -116,10 +117,10 @@ class CXFA_NodeIteratorTemplate { } return *m_NodeStack.GetTopElement(); } - return NULL; + return nullptr; } NodeType* MoveToNext() { - NodeType** ppNode = NULL; + NodeType** ppNode = nullptr; NodeType* pCurrent = GetCurrent(); while (m_NodeStack.GetSize() > 0) { while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) { @@ -127,7 +128,7 @@ class CXFA_NodeIteratorTemplate { return *ppNode; } NodeType* pChild = TraverseStrategy::GetFirstChild(*ppNode); - if (pChild == NULL) { + if (!pChild) { break; } m_NodeStack.Push(pChild); @@ -144,7 +145,7 @@ class CXFA_NodeIteratorTemplate { } } } - return NULL; + return nullptr; } NodeType* SkipChildrenAndMoveToNext() { NodeType** ppNode = nullptr; @@ -184,7 +185,7 @@ FX_BOOL XFA_IsLayoutElement(XFA_Element eElement, void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream, - const FX_CHAR* pChecksum = NULL, + const FX_CHAR* pChecksum = nullptr, FX_BOOL bSaveXML = FALSE); #endif // XFA_FXFA_PARSER_XFA_UTILS_H_ diff --git a/xfa/fxfa/parser/xfa_utils_imp.cpp b/xfa/fxfa/parser/xfa_utils_imp.cpp index 9220601d50..b1fe7b3524 100644 --- a/xfa/fxfa/parser/xfa_utils_imp.cpp +++ b/xfa/fxfa/parser/xfa_utils_imp.cpp @@ -20,7 +20,7 @@ CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { XFA_Element eType = pNode->GetElementType(); eWidgetType = eType; if (eType != XFA_Element::Field && eType != XFA_Element::Draw) { - return NULL; + return nullptr; } eWidgetType = XFA_Element::Unknown; XFA_Element eUIType = XFA_Element::Unknown; @@ -58,7 +58,7 @@ CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { default: break; } - CXFA_Node* pUIChild = NULL; + CXFA_Node* pUIChild = nullptr; CXFA_Node* pUI = pNode->GetProperty(0, XFA_Element::Ui, TRUE); CXFA_Node* pChild = pUI->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -188,7 +188,7 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData) { } void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, CFX_WideString& wsPlainText) { - if (pXMLNode == NULL) { + if (!pXMLNode) { return; } switch (pXMLNode->GetType()) { |