From 5570d23890cc7bae4903a29fbcf8ac543ba1a2c7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 5 Nov 2015 08:46:13 -0800 Subject: Fix XFA compilation warnings, part 2 Mostly unused variables, unused private members, or initialization order. Added a few missing initializers for pointer members along the way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1414903004 . --- xfa/src/fxfa/src/app/xfa_ffapp.cpp | 19 ++++--- xfa/src/fxfa/src/app/xfa_ffapp.h | 36 +++++++------ xfa/src/fxfa/src/app/xfa_ffdoc.cpp | 13 ++--- xfa/src/fxfa/src/app/xfa_ffdocview.cpp | 21 ++++---- xfa/src/fxfa/src/app/xfa_ffdocview.h | 1 + xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp | 6 +-- xfa/src/fxfa/src/app/xfa_fontmgr.h | 18 ++++--- xfa/src/fxfa/src/app/xfa_textlayout.cpp | 33 +++++------- xfa/src/fxfa/src/app/xfa_textlayout.h | 49 +++++++----------- xfa/src/fxfa/src/common/xfa_document.h | 3 -- xfa/src/fxfa/src/common/xfa_object.h | 1 - xfa/src/fxfa/src/common/xfa_utils.h | 4 +- xfa/src/fxfa/src/fm2js/xfa_expression.cpp | 17 ++++--- xfa/src/fxfa/src/fm2js/xfa_expression.h | 6 --- xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp | 3 +- xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp | 5 +- xfa/src/fxfa/src/parser/xfa_document_imp.cpp | 28 +++++----- .../fxfa/src/parser/xfa_document_layout_imp.cpp | 5 +- xfa/src/fxfa/src/parser/xfa_document_serialize.cpp | 2 - xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp | 45 ++++++----------- xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp | 15 +++--- xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h | 8 +-- xfa/src/fxfa/src/parser/xfa_localevalue.cpp | 3 -- xfa/src/fxfa/src/parser/xfa_object_imp.cpp | 18 +++---- xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp | 59 ---------------------- xfa/src/fxfa/src/parser/xfa_parser_imp.cpp | 38 +++++++------- xfa/src/fxfa/src/parser/xfa_parser_imp.h | 19 ++++--- xfa/src/fxfa/src/parser/xfa_script_imp.cpp | 16 +++--- xfa/src/fxfa/src/parser/xfa_script_imp.h | 3 +- 29 files changed, 198 insertions(+), 296 deletions(-) (limited to 'xfa/src/fxfa') diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.cpp b/xfa/src/fxfa/src/app/xfa_ffapp.cpp index bca0e182e8..363b5b5742 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffapp.cpp @@ -66,19 +66,18 @@ IXFA_App* IXFA_App::Create(IXFA_AppProvider* pProvider) { // virtual IXFA_App::~IXFA_App() {} CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider) - : m_pDocHandler(NULL), - m_pFWLTheme(NULL), + : m_pDocHandler(nullptr), + m_pFWLTheme(nullptr), m_pProvider(pProvider), - m_pFontMgr(NULL), - m_pAdapterWidgetMgr(NULL), - m_pFDEFontMgr(NULL), - m_pMenuHandler(NULL), - m_pAdapterThreadMgr(NULL) + m_pFontMgr(nullptr), #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ - , - m_pFontSource(NULL) + m_pFontSource(nullptr), #endif -{ + m_pAdapterWidgetMgr(nullptr), + m_pWidgetMgrDelegate(nullptr), + m_pFDEFontMgr(nullptr), + m_pMenuHandler(nullptr), + m_pAdapterThreadMgr(nullptr) { m_pFWLApp = IFWL_App::Create(this); FWL_SetApp(m_pFWLApp); m_pFWLApp->Initialize(); diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.h b/xfa/src/fxfa/src/app/xfa_ffapp.h index 838d2d6fce..ed93538ac6 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.h +++ b/xfa/src/fxfa/src/app/xfa_ffapp.h @@ -29,22 +29,26 @@ class CXFA_FFApp : public IXFA_App, public IFWL_AdapterNative { CXFA_FFApp(IXFA_AppProvider* pProvider); ~CXFA_FFApp() override; - virtual IXFA_DocHandler* GetDocHandler(); - virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, - IFX_FileRead* pStream, - FX_BOOL bTakeOverFile); - virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, - CPDF_Document* pPDFDoc); - virtual IXFA_AppProvider* GetAppProvider() { return m_pProvider; } - virtual void SetDefaultFontMgr(IXFA_FontMgr* pFontMgr); - virtual IXFA_MenuHandler* GetMenuHandler(); - virtual IFWL_AdapterWidgetMgr* GetWidgetMgr( - IFWL_WidgetMgrDelegate* pDelegate); - virtual IFWL_AdapterThreadMgr* GetThreadMgr(); - virtual IFWL_AdapterTimerMgr* GetTimerMgr(); - virtual IFWL_AdapterCursorMgr* GetCursorMgr(); - virtual IFWL_AdapterMonitorMgr* GetMonitorMgr(); - virtual IFWL_AdapterClipboardMgr* GetClipboardMgr(); + // IFXFA_App: + IXFA_DocHandler* GetDocHandler() override; + IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, + IFX_FileRead* pStream, + FX_BOOL bTakeOverFile) override; + IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, + CPDF_Document* pPDFDoc) override; + IXFA_AppProvider* GetAppProvider() override { return m_pProvider; } + void SetDefaultFontMgr(IXFA_FontMgr* pFontMgr) override; + IXFA_MenuHandler* GetMenuHandler() override; + + // IFWL_AdapterNative: + IFWL_AdapterWidgetMgr* GetWidgetMgr( + IFWL_WidgetMgrDelegate* pDelegate) override; + IFWL_AdapterThreadMgr* GetThreadMgr() override; + IFWL_AdapterTimerMgr* GetTimerMgr() override; + IFWL_AdapterCursorMgr* GetCursorMgr() override; + IFWL_AdapterMonitorMgr* GetMonitorMgr() override; + IFWL_AdapterClipboardMgr* GetClipboardMgr() override; + CXFA_FontMgr* GetXFAFontMgr(); IFX_FontMgr* GetFDEFontMgr(); CXFA_FWLTheme* GetFWLTheme(); diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp index 69907a5f6b..cb2cb3b9ea 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp @@ -14,13 +14,14 @@ #include "xfa_fontmgr.h" CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider) : m_pDocProvider(pDocProvider), - m_dwDocType(XFA_DOCTYPE_Static), - m_pDocument(NULL), - m_pStream(NULL), + m_pDocument(nullptr), + m_pStream(nullptr), m_pApp(pApp), - m_pNotify(NULL), - m_pPDFDoc(NULL), - m_bOwnStream(TRUE) {} + m_pNotify(nullptr), + m_pPDFDoc(nullptr), + m_dwDocType(XFA_DOCTYPE_Static), + m_bOwnStream(TRUE) { +} CXFA_FFDoc::~CXFA_FFDoc() { CloseDoc(); } diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp index 8f9265a54d..728edb45d0 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp @@ -46,17 +46,18 @@ extern const XFA_ATTRIBUTEENUM gs_EventActivity[] = { XFA_ATTRIBUTEENUM_Unknown, }; CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc) - : m_pDoc(pDoc), - m_pWidgetHandler(NULL), - m_pXFADocLayout(NULL), + : m_bLayoutEvent(FALSE), + m_pListFocusWidget(nullptr), + m_bInLayoutStatus(FALSE), + m_pDoc(pDoc), + m_pWidgetHandler(nullptr), + m_pXFADocLayout(nullptr), + m_pFocusAcc(nullptr), + m_pFocusWidget(nullptr), + m_pOldFocusWidget(nullptr), m_iStatus(XFA_DOCVIEW_LAYOUTSTATUS_None), - m_iLock(0), - m_bLayoutEvent(FALSE), - m_pFocusAcc(NULL), - m_pFocusWidget(NULL), - m_pListFocusWidget(NULL), - m_pOldFocusWidget(NULL), - m_bInLayoutStatus(FALSE) {} + m_iLock(0) { +} CXFA_FFDocView::~CXFA_FFDocView() { DestroyDocView(); if (m_pWidgetHandler) { diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.h b/xfa/src/fxfa/src/app/xfa_ffdocview.h index 5f8407bec5..210104d448 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.h +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.h @@ -111,6 +111,7 @@ class CXFA_FFDocView : public IXFA_DocView { void ShowNullTestMsg(); FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc); CXFA_Node* GetRootSubform(); + CXFA_FFDoc* m_pDoc; CXFA_FFWidgetHandler* m_pWidgetHandler; IXFA_DocLayout* m_pXFADocLayout; diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp index 4ef638333b..1c439788b7 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp @@ -458,13 +458,11 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateField(XFA_ELEMENT eElement, } CXFA_Node* CXFA_FFWidgetHandler::CreateArc(CXFA_Node* pParent, CXFA_Node* pBefore) const { - CXFA_Node* pField = CreateDraw(XFA_ELEMENT_Arc, pParent, pBefore); - return pField; + return CreateDraw(XFA_ELEMENT_Arc, pParent, pBefore); } CXFA_Node* CXFA_FFWidgetHandler::CreateRectangle(CXFA_Node* pParent, CXFA_Node* pBefore) const { - CXFA_Node* pField = CreateDraw(XFA_ELEMENT_Rectangle, pParent, pBefore); - return pField; + return CreateDraw(XFA_ELEMENT_Rectangle, pParent, pBefore); } CXFA_Node* CXFA_FFWidgetHandler::CreateImage(CXFA_Node* pParent, CXFA_Node* pBefore) const { diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.h b/xfa/src/fxfa/src/app/xfa_fontmgr.h index 0eed999343..5afb09b3c7 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.h +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.h @@ -17,14 +17,16 @@ class CXFA_DefFontMgr : public IXFA_FontMgr { public: CXFA_DefFontMgr() {} ~CXFA_DefFontMgr() override; - virtual IFX_Font* GetFont(IXFA_Doc* hDoc, - const CFX_WideStringC& wsFontFamily, - FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); - virtual IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, - const CFX_WideStringC& wsFontFamily, - FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + + // IXFA_FontMgr: + IFX_Font* GetFont(IXFA_Doc* hDoc, + const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage = 0xFFFF) override; + IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, + const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage = 0xFFFF) override; protected: CFX_PtrArray m_CacheFonts; diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp index 06f6b4cff9..ffc471d506 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp +++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp @@ -671,28 +671,23 @@ FX_BOOL CXFA_TextParser::GetTabstops( return TRUE; } CXFA_TextLayout::CXFA_TextLayout(IXFA_TextProvider* pTextProvider) - : m_pTextProvider(pTextProvider), - m_pTextDataNode(NULL), - m_pAllocator(NULL), - m_pBreak(NULL), - m_dwTextData(0), - m_pLoader(NULL), + : m_bHasBlock(FALSE), + m_pTextProvider(pTextProvider), + m_pTextDataNode(nullptr), + m_bRichText(FALSE), + m_pAllocator(nullptr), + m_pBreak(nullptr), + m_pLoader(nullptr), m_iLines(0), m_fMaxWidth(0), - m_pTabstopContext(NULL), - m_bBlockContinue(TRUE), - m_bRichText(FALSE), - m_bHasBlock(FALSE) { - FXSYS_assert(m_pTextProvider != NULL); + m_pTabstopContext(nullptr), + m_bBlockContinue(TRUE) { + FXSYS_assert(m_pTextProvider); } CXFA_TextLayout::~CXFA_TextLayout() { m_textParser.Reset(); - if (m_pLoader != NULL) { - delete m_pLoader; - } - if (m_pTabstopContext != NULL) { - delete m_pTabstopContext; - } + delete m_pLoader; + delete m_pTabstopContext; Unload(); } void CXFA_TextLayout::Unload() { @@ -1571,9 +1566,9 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode* pXMLNode, } } if (wsName == FX_WSTRC(L"a")) { - if (pLinkData != NULL) { + if (pLinkData) { pLinkData->Release(); - pLinkData = NULL; + pLinkData = nullptr; } } if (IsEnd(bSavePieces)) { diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.h b/xfa/src/fxfa/src/app/xfa_textlayout.h index 8b5974c179..a42c27ede8 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.h +++ b/xfa/src/fxfa/src/app/xfa_textlayout.h @@ -45,10 +45,10 @@ class CXFA_CSSTagProvider : public IFDE_CSSTagProvider { class CXFA_TextParseContext : public CFX_Target { public: CXFA_TextParseContext() - : m_ppMatchedDecls(NULL), + : m_pParentStyle(nullptr), + m_ppMatchedDecls(nullptr), m_dwMatchedDecls(0), - m_eDisplay(FDE_CSSDISPLAY_None), - m_pParentStyle(NULL) {} + m_eDisplay(FDE_CSSDISPLAY_None) {} ~CXFA_TextParseContext() { if (m_ppMatchedDecls != NULL) { FDE_Free(m_ppMatchedDecls); @@ -184,33 +184,29 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { public: CXFA_TextUserData(IFX_MEMAllocator* pAllocator, IFDE_CSSComputedStyle* pStyle) : m_pStyle(pStyle), + m_pLinkData(nullptr), m_pAllocator(pAllocator), - m_dwRefCount(0), - m_pLinkData(NULL) { - FXSYS_assert(m_pAllocator != NULL); - if (m_pStyle != NULL) { + m_dwRefCount(0) { + FXSYS_assert(m_pAllocator); + if (m_pStyle) m_pStyle->AddRef(); - } } CXFA_TextUserData(IFX_MEMAllocator* pAllocator, IFDE_CSSComputedStyle* pStyle, CXFA_LinkUserData* pLinkData) : m_pStyle(pStyle), + m_pLinkData(pLinkData), m_pAllocator(pAllocator), - m_dwRefCount(0), - m_pLinkData(pLinkData) { - FXSYS_assert(m_pAllocator != NULL); - if (m_pStyle != NULL) { + m_dwRefCount(0) { + FXSYS_assert(m_pAllocator); + if (m_pStyle) m_pStyle->AddRef(); - } } ~CXFA_TextUserData() { - if (m_pStyle != NULL) { + if (m_pStyle) m_pStyle->Release(); - } - if (m_pLinkData != NULL) { + if (m_pLinkData) m_pLinkData->Release(); - } } virtual FX_DWORD Release() { FX_DWORD dwRefCount = --m_dwRefCount; @@ -329,11 +325,13 @@ class CXFA_TextLayout { const CFX_Matrix& tmDoc2Device, const CFX_RectF& rtClip, int32_t iBlock = 0); - FX_BOOL IsLoaded() const { return m_pieceLines.GetSize() > 0; } void Unload(); const CXFA_PieceLineArray* GetPieceLines(); + FX_BOOL m_bHasBlock; + CFX_Int32Array m_Blocks; + private: void GetTextDataNode(); IFDE_XMLNode* GetXMLContainerNode(); @@ -347,7 +345,6 @@ class CXFA_TextLayout { FX_BOOL Loader(const CFX_SizeF& szText, FX_FLOAT& fLinePos, FX_BOOL bSavePieces = TRUE); - void LoadText(CXFA_Node* pNode, const CFX_SizeF& szText, FX_FLOAT& fLinePos, @@ -361,22 +358,18 @@ class CXFA_TextLayout { FX_BOOL bEndBreak = TRUE, FX_BOOL bIsOl = FALSE, int32_t iLiCount = 0); - FX_BOOL AppendChar(const CFX_WideString& wsText, FX_FLOAT& fLinePos, FX_FLOAT fSpaceAbove, FX_BOOL bSavePieces); - void AppendTextLine(FX_DWORD dwStatus, FX_FLOAT& fLinePos, FX_BOOL bSavePieces, FX_BOOL bEndBreak = FALSE); void EndBreak(FX_DWORD dwStatus, FX_FLOAT& fLinePos, FX_BOOL bDefault); FX_BOOL IsEnd(FX_BOOL bSavePieces); - void ProcessText(CFX_WideString& wsText); void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom); - void RenderString(IFDE_RenderDevice* pDevice, IFDE_SolidBrush* pBrush, CXFA_PieceLine* pPieceLine, @@ -389,33 +382,25 @@ class CXFA_TextLayout { int32_t iPiece, FXTEXT_CHARPOS* pCharPos, const CFX_Matrix& tmDoc2Device); - int32_t GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS* pCharPos, FX_BOOL bCharCode = FALSE); FX_BOOL ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ& tr); - void DoTabstops(IFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine); FX_BOOL Layout(int32_t iBlock); int32_t CountBlocks() const; + IXFA_TextProvider* m_pTextProvider; CXFA_Node* m_pTextDataNode; FX_BOOL m_bRichText; IFX_MEMAllocator* m_pAllocator; IFX_RTFBreak* m_pBreak; - FX_DWORD m_dwTextData; - CXFA_LoaderContext* m_pLoader; int32_t m_iLines; FX_FLOAT m_fMaxWidth; - CXFA_TextParser m_textParser; CXFA_PieceLineArray m_pieceLines; CXFA_TextTabstopsContext* m_pTabstopContext; FX_BOOL m_bBlockContinue; - - public: - FX_BOOL m_bHasBlock; - CFX_Int32Array m_Blocks; }; #endif diff --git a/xfa/src/fxfa/src/common/xfa_document.h b/xfa/src/fxfa/src/common/xfa_document.h index fe19ea06a6..e9b3f59e47 100644 --- a/xfa/src/fxfa/src/common/xfa_document.h +++ b/xfa/src/fxfa/src/common/xfa_document.h @@ -154,7 +154,6 @@ class CXFA_Document : public IXFA_ObjFactory { XFA_ELEMENT eElement); void DoProtoMerge(); CXFA_Node* GetNodeByID(CXFA_Node* pRoot, const CFX_WideStringC& wsID); - void DoDataMerge(); void DoDataRemerge(FX_BOOL bDoDataMerge); CXFA_Node* DataMerge_CopyContainer(CXFA_Node* pTemplateNode, @@ -171,7 +170,6 @@ class CXFA_Document : public IXFA_ObjFactory { IXFA_ScriptContext* GetScriptContext(); void ClearLayoutData(); - public: CFX_MapPtrTemplate m_rgGlobalBinding; CXFA_NodeArray m_pPendingPageSet; @@ -180,7 +178,6 @@ class CXFA_Document : public IXFA_ObjFactory { IXFA_ScriptContext* m_pScriptContext; CXFA_LayoutProcessor* m_pLayoutProcessor; CXFA_Node* m_pRootNode; - CXFA_LocaleMgr* m_pLocalMgr; CScript_DataWindow* m_pScriptDataWindow; CScript_EventPseudoModel* m_pScriptEvent; diff --git a/xfa/src/fxfa/src/common/xfa_object.h b/xfa/src/fxfa/src/common/xfa_object.h index efc0ca9afd..6ff3164def 100644 --- a/xfa/src/fxfa/src/common/xfa_object.h +++ b/xfa/src/fxfa/src/common/xfa_object.h @@ -620,7 +620,6 @@ class CXFA_Node : public CXFA_Object { void* pKey, FX_BOOL bRecursive = FALSE); - protected: CXFA_Node* m_pNext; CXFA_Node* m_pChild; CXFA_Node* m_pLastChild; diff --git a/xfa/src/fxfa/src/common/xfa_utils.h b/xfa/src/fxfa/src/common/xfa_utils.h index 8f8a36f621..3a39bb4644 100644 --- a/xfa/src/fxfa/src/common/xfa_utils.h +++ b/xfa/src/fxfa/src/common/xfa_utils.h @@ -54,10 +54,10 @@ class CXFA_NodeIteratorTemplate { } return TRUE; } - NodeType* GetCurrent() { + NodeType* GetCurrent() const { return m_NodeStack.GetSize() ? *m_NodeStack.GetTopElement() : NULL; } - NodeType* GetRoot() { return m_pRoot; } + NodeType* GetRoot() const { return m_pRoot; } NodeType* MoveToPrev() { int32_t nStackLength = m_NodeStack.GetSize(); if (nStackLength == 1) { diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp index 440ce5b4f1..53b7197e10 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp @@ -10,9 +10,11 @@ static CFX_WideStringC RUNTIMEBLOCKTEMPARRAY = static CFX_WideStringC RUNTIMEBLOCKTEMPARRAYINDEX = FX_WSTRC(L"foxit_xfa_formcalc_runtime_block_temp_array_index"); CXFA_FMExpression::CXFA_FMExpression(FX_DWORD line) - : m_line(line), m_type(XFA_FM_EXPTYPE_UNKNOWN) {} + : m_type(XFA_FM_EXPTYPE_UNKNOWN), m_line(line) { +} CXFA_FMExpression::CXFA_FMExpression(FX_DWORD line, XFA_FM_EXPTYPE type) - : m_line(line), m_type(type) {} + : m_type(type), m_line(line) { +} void CXFA_FMExpression::ToJavaScript(CFX_WideTextBuf& javascript) {} void CXFA_FMExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) {} CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition( @@ -22,10 +24,11 @@ CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition( CFX_WideStringCArray* pArguments, CFX_PtrArray* pExpressions) : CXFA_FMExpression(line, XFA_FM_EXPTYPE_FUNC), - m_isGlobal(isGlobal), m_wsName(wsName), m_pArguments(pArguments), - m_pExpressions(pExpressions) {} + m_pExpressions(pExpressions), + m_isGlobal(isGlobal) { +} CXFA_FMFunctionDefinition::~CXFA_FMFunctionDefinition() { if (m_pArguments) { m_pArguments->RemoveAll(); @@ -383,7 +386,8 @@ void CXFA_FMWhileExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) { m_pExpression->ToImpliedReturnJS(javascript); } CXFA_FMBreakExpression::CXFA_FMBreakExpression(FX_DWORD line) - : CXFA_FMExpression(line, XFA_FM_EXPTYPE_BREAK), m_pExpression(0) {} + : CXFA_FMExpression(line, XFA_FM_EXPTYPE_BREAK) { +} CXFA_FMBreakExpression::~CXFA_FMBreakExpression() {} void CXFA_FMBreakExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << RUNTIMEFUNCTIONRETURNVALUE; @@ -396,7 +400,8 @@ void CXFA_FMBreakExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) { javascript << FX_WSTRC(L"break;\n"); } CXFA_FMContinueExpression::CXFA_FMContinueExpression(FX_DWORD line) - : CXFA_FMExpression(line, XFA_FM_EXPTYPE_CONTINUE), m_pExpression(0) {} + : CXFA_FMExpression(line, XFA_FM_EXPTYPE_CONTINUE) { +} CXFA_FMContinueExpression::~CXFA_FMContinueExpression() {} void CXFA_FMContinueExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << RUNTIMEFUNCTIONRETURNVALUE; diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.h b/xfa/src/fxfa/src/fm2js/xfa_expression.h index 95a66d5653..dcc0a7b04f 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.h +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.h @@ -131,9 +131,6 @@ class CXFA_FMBreakExpression : public CXFA_FMExpression { virtual ~CXFA_FMBreakExpression(); virtual void ToJavaScript(CFX_WideTextBuf& javascript); virtual void ToImpliedReturnJS(CFX_WideTextBuf&); - - private: - CXFA_FMLoopExpression* m_pExpression; }; class CXFA_FMContinueExpression : public CXFA_FMExpression { public: @@ -141,9 +138,6 @@ class CXFA_FMContinueExpression : public CXFA_FMExpression { virtual ~CXFA_FMContinueExpression(); virtual void ToJavaScript(CFX_WideTextBuf& javascript); virtual void ToImpliedReturnJS(CFX_WideTextBuf&); - - private: - CXFA_FMLoopExpression* m_pExpression; }; class CXFA_FMForExpression : public CXFA_FMLoopExpression { public: diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp index 8a87763bf2..66ecfb8890 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp @@ -7155,7 +7155,8 @@ static FXJSE_FUNCTION formcalc_fm2js_functions[] = { {"get_fm_jsobj", CXFA_FM2JSContext::get_fm_jsobj}, {"fm_var_filter", CXFA_FM2JSContext::fm_var_filter}, }; -CXFA_FM2JSContext::CXFA_FM2JSContext() : m_pDocument(NULL), m_hFMClass(NULL) { +CXFA_FM2JSContext::CXFA_FM2JSContext() + : m_hFMClass(nullptr), m_pDocument(nullptr) { FX_memset(&m_fmClass, 0, sizeof(FXJSE_CLASS)); } CXFA_FM2JSContext::~CXFA_FM2JSContext() { diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp index f103673b88..ab3ceacf84 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp @@ -428,8 +428,9 @@ CXFA_FMCallExpression::CXFA_FMCallExpression(FX_DWORD line, CFX_PtrArray* pArguments, FX_BOOL bIsSomMethod) : CXFA_FMUnaryExpression(line, TOKcall, pExp), - m_pArguments(pArguments), - m_bIsSomMethod(bIsSomMethod) {} + m_bIsSomMethod(bIsSomMethod), + m_pArguments(pArguments) { +} CXFA_FMCallExpression::~CXFA_FMCallExpression() { if (m_pArguments) { int32_t argc = m_pArguments->GetSize(); diff --git a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp index e403c22ebe..644a29bb2b 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp @@ -26,24 +26,22 @@ #include "xfa_script_signaturepseudomodel.h" CXFA_Document::CXFA_Document(IXFA_DocParser* pParser) : m_pParser(pParser), - m_pLayoutProcessor(NULL), - m_pRootNode(NULL), - m_pScriptContext(NULL), - m_pLocalMgr(NULL), - m_pScriptDataWindow(NULL), - m_pScriptEvent(NULL), - m_pScriptHost(NULL), - m_pScriptLog(NULL), - m_pScriptLayout(NULL), - m_pScriptSignature(NULL), - m_dwDocFlags(0), - m_eCurVersionMode(XFA_VERSION_DEFAULT) { + m_pScriptContext(nullptr), + m_pLayoutProcessor(nullptr), + m_pRootNode(nullptr), + m_pLocalMgr(nullptr), + m_pScriptDataWindow(nullptr), + m_pScriptEvent(nullptr), + m_pScriptHost(nullptr), + m_pScriptLog(nullptr), + m_pScriptLayout(nullptr), + m_pScriptSignature(nullptr), + m_eCurVersionMode(XFA_VERSION_DEFAULT), + m_dwDocFlags(0) { ASSERT(m_pParser); } CXFA_Document::~CXFA_Document() { - if (m_pRootNode) { - delete m_pRootNode; - } + delete m_pRootNode; PurgeNodes(); } void CXFA_Document::ClearLayoutData() { diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp index 77094e3dce..627497be3a 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp @@ -169,10 +169,11 @@ FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() { CXFA_LayoutItemImpl::CXFA_LayoutItemImpl(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) : m_pFormNode(pNode), - m_bIsContentLayoutItem(bIsContentLayoutItem), m_pParent(NULL), m_pNextSibling(NULL), - m_pFirstChild(NULL) {} + m_pFirstChild(NULL), + m_bIsContentLayoutItem(bIsContentLayoutItem) { +} CXFA_LayoutItemImpl::~CXFA_LayoutItemImpl() {} CXFA_ContainerLayoutItemImpl::CXFA_ContainerLayoutItemImpl(CXFA_Node* pNode) : CXFA_LayoutItemImpl(pNode, FALSE), m_pOldSubform(NULL) {} diff --git a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp index f9c3235f7c..558765270a 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp @@ -561,8 +561,6 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, } return TRUE; } -static void XFA_DataExporter_GenerateChecksum(CXFA_Document* pDocument, - CFX_WideString& wsChecksum) {} void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode) { if (!pDataNode || pDataNode->GetClassID() == XFA_ELEMENT_DataValue) { return; diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp index 54279a53d0..2c0d41b276 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp @@ -22,32 +22,29 @@ #include "xfa_layout_appadapter.h" CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, CXFA_LayoutPageMgr* pPageMgr) - : m_pFormNode(pNode), - m_pLayoutItem(NULL), + : m_bKeepBreakFinish(FALSE), + m_bIsProcessKeep(FALSE), + m_pKeepHeadNode(nullptr), + m_pKeepTailNode(nullptr), + m_pFormNode(pNode), + m_pLayoutItem(nullptr), +#ifdef _XFA_LAYOUTITEM_ProcessCACHE_ + m_pOldLayoutItem(nullptr), +#else + m_pPageMgrCreateItem(nullptr), +#endif m_pCurChildNode(XFA_LAYOUT_INVALIDNODE), + m_pCurChildPreprocessor(nullptr), m_nCurChildNodeStage(XFA_ItemLayoutProcessorStages_None), - m_pCurChildPreprocessor(NULL), m_fUsedSize(0), m_pPageMgr(pPageMgr), - m_bHasAvailHeight(TRUE) -#ifdef _XFA_LAYOUTITEM_ProcessCACHE_ - , - m_pOldLayoutItem(NULL) -#else - , - m_pPageMgrCreateItem(NULL) -#endif - , - m_bKeepBreakFinish(FALSE), - m_pKeepHeadNode(NULL), - m_pKeepTailNode(NULL), - m_bIsProcessKeep(FALSE), m_bBreakPending(TRUE), m_fLastRowWidth(0), m_fLastRowY(0), - m_bUseInheriated(FALSE), m_fWidthLimite(0), - m_ePreProcessRs(XFA_ItemLayoutProcessorResult_Done) { + m_bUseInheriated(FALSE), + m_ePreProcessRs(XFA_ItemLayoutProcessorResult_Done), + m_bHasAvailHeight(TRUE) { FXSYS_assert(m_pFormNode && (m_pFormNode->IsContainerNode() || m_pFormNode->GetClassID() == XFA_ELEMENT_Form)); #ifdef _XFA_LAYOUTITEM_ProcessCACHE_ @@ -897,18 +894,6 @@ void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos( break; } } -static FX_BOOL XFA_ItemLayoutProcessor_FloatAlmostEqual(FX_FLOAT f1, - FX_FLOAT f2) { - return f1 >= f2 - XFA_LAYOUT_FLOAT_PERCISION && - f1 <= f2 + XFA_LAYOUT_FLOAT_PERCISION; -} -static FX_BOOL XFA_ItemLayoutProcessor_FloatGreaterThan(FX_FLOAT f1, - FX_FLOAT f2) { - return f1 > f2 + XFA_LAYOUT_FLOAT_PERCISION; -} -static FX_BOOL XFA_ItemLayoutProcessor_FloatLessThan(FX_FLOAT f1, FX_FLOAT f2) { - return f1 < f2 - XFA_LAYOUT_FLOAT_PERCISION; -} FX_BOOL CXFA_ItemLayoutProcessor::IncrementRelayoutNode( CXFA_LayoutProcessor* pLayoutProcessor, CXFA_Node* pNode, diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp index 5688d69e48..09d22d37a6 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp @@ -23,15 +23,16 @@ #include "xfa_layout_appadapter.h" CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor) : m_pLayoutProcessor(pLayoutProcessor), - m_pTemplatePageSetRoot(NULL), - m_pPageSetLayoutItemRoot(NULL), - m_pCurrentContainerRecord(NULL), + m_pTemplatePageSetRoot(nullptr), + m_pPageSetLayoutItemRoot(nullptr), + m_pPageSetCurRoot(nullptr), + m_pCurrentContainerRecord(nullptr), + m_pCurPageArea(nullptr), + m_nAvailPages(0), m_nCurPageCount(0), - m_pCurPageArea(NULL), m_ePageSetMode(XFA_ATTRIBUTEENUM_OrderedOccurrence), - m_nAvailPages(0), - m_pPageSetCurRoot(NULL), - m_bCreateOverFlowPage(FALSE) {} + m_bCreateOverFlowPage(FALSE) { +} CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() { ClearData(); CXFA_LayoutItemImpl* pLayoutItem = GetRootLayoutItem(); diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h index 65fb69f605..89e2da4755 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h @@ -129,6 +129,9 @@ class CXFA_LayoutPageMgr { void MergePageSetContents(); void LayoutPageSetContents(); void PrepareLayout(); +#if defined(_XFA_LAYOUTITEM_MAPCACHE_) || defined(_XFA_LAYOUTITEM_ProcessCACHE_) + void SaveLayoutItem(CXFA_LayoutItemImpl* pParentLayoutItem); +#endif CXFA_LayoutProcessor* m_pLayoutProcessor; CXFA_Node* m_pTemplatePageSetRoot; CXFA_ContainerLayoutItemImpl* m_pPageSetLayoutItemRoot; @@ -141,12 +144,9 @@ class CXFA_LayoutPageMgr { XFA_ATTRIBUTEENUM m_ePageSetMode; FX_BOOL m_bCreateOverFlowPage; CFX_MapPtrTemplate m_pPageSetMap; + CFX_ArrayTemplate m_PageArray; #ifdef _XFA_LAYOUTITEM_MAPCACHE_ - void SaveLayoutItem(CXFA_LayoutItemImpl* pParentLayoutItem); CFX_MapPtrToPtr m_NodeToContent; -#elif defined(_XFA_LAYOUTITEM_ProcessCACHE_) - void SaveLayoutItem(CXFA_LayoutItemImpl* pParentLayoutItem); #endif - CFX_ArrayTemplate m_PageArray; }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp index bf87c8af69..93c371d996 100644 --- a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp +++ b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp @@ -32,9 +32,6 @@ static const FX_DOUBLE fraction_scales[] = {0.1, 0.00000000000001, 0.000000000000001, 0.0000000000000001}; -static FX_BOOL IsAlpha(FX_WCHAR c) { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); -} CXFA_LocaleValue::CXFA_LocaleValue() { m_dwType = XFA_VT_NULL; m_bValid = TRUE; diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index cf906072f3..bbc2e5b685 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -88,17 +88,17 @@ static XFA_OBJECTTYPE XFA_GetElementObjectType(XFA_ELEMENT eElement) { } CXFA_Node::CXFA_Node(CXFA_Document* pDoc, FX_WORD ePacket, XFA_ELEMENT eElement) : CXFA_Object(pDoc, XFA_GetElementObjectType(eElement)), - m_pParent(NULL), - m_pNext(NULL), - m_pChild(NULL), - m_pLastChild(NULL), - m_pXMLNode(NULL), - m_ePacket(ePacket), + m_pNext(nullptr), + m_pChild(nullptr), + m_pLastChild(nullptr), + m_pParent(nullptr), + m_pXMLNode(nullptr), m_eNodeClass(eElement), + m_ePacket(ePacket), m_dwNameHash(0), - m_pAuxNode(NULL), - m_pMapModuleData(NULL) { - ASSERT(m_pDocument != NULL); + m_pAuxNode(nullptr), + m_pMapModuleData(nullptr) { + ASSERT(m_pDocument); } CXFA_Node::~CXFA_Node() { FXSYS_assert(m_pParent == NULL); diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp index c7cd0f2078..86276483b6 100644 --- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp @@ -2801,65 +2801,6 @@ FX_BOOL CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) { iLeadDigits = -1; return FALSE; } -static CFX_WideString XFA_NumericNormalize(const CFX_WideString& wsValue, - IFX_Locale* pLocale) { - CFX_WideString wsDecimalSymbol; - if (pLocale) { - pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDecimalSymbol); - } - if (wsDecimalSymbol.IsEmpty()) { - wsDecimalSymbol = '.'; - } - CFX_WideString wsNewValue(wsValue); - wsNewValue.TrimLeft(L" "); - wsNewValue.TrimLeft(L"0"); - wsNewValue.TrimRight(L" "); - int32_t iCount = wsNewValue.GetLength(); - if (iCount == 0) { - return FX_WSTRC(L"0"); - } - int32_t iIndex = 0; - CFX_WideString wsRet; - FX_WCHAR* pRetBuffer = wsRet.GetBuffer(iCount); - int32_t i = 0; - if (wsNewValue[i] == L'-') { - pRetBuffer[iIndex++] = '-'; - } else if (wsNewValue[i] == L'+') { - i++; - } - FX_BOOL bHasPoint = FALSE; - int32_t nCharStart = -1; - for (; i < iCount; i++) { - FX_WCHAR wc = wsNewValue[i]; - if (XFA_IsDigit(wc)) { - if (nCharStart != -1) { - CFX_WideStringC wsChar((const FX_WCHAR*)wsNewValue + nCharStart, - i - nCharStart); - if (wsChar == '.' || wsChar == wsDecimalSymbol) { - bHasPoint = TRUE; - nCharStart = -1; - } else { - pRetBuffer[0] = '0'; - iCount = 1; - break; - } - } - pRetBuffer[iIndex++] = wc; - continue; - } - if (bHasPoint) { - pRetBuffer[0] = '0'; - iCount = 1; - break; - } - if (nCharStart == -1) { - nCharStart = i; - pRetBuffer[iIndex++] = wc; - } - } - wsRet.ReleaseBuffer(iCount); - return wsRet; -} CFX_WideString XFA_NumericLimit(const CFX_WideString& wsValue, int32_t iLead, int32_t iTread) { diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp index b0bbf4db75..937d6fa2ce 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp @@ -24,13 +24,15 @@ IXFA_Parser* IXFA_Parser::Create(IXFA_ObjFactory* pFactory, } CXFA_SimpleParser::CXFA_SimpleParser(IXFA_ObjFactory* pFactory, FX_BOOL bDocumentParser) - : m_pXMLParser(NULL), - m_pXMLDoc(NULL), - m_pStream(NULL), + : m_pXMLParser(nullptr), + m_pXMLDoc(nullptr), + m_pStream(nullptr), + m_pFileRead(nullptr), m_pFactory(pFactory), + m_pRootNode(nullptr), m_ePacketID(XFA_XDPPACKET_UNKNOWN), - m_pRootNode(NULL), - m_bDocumentParser(bDocumentParser) {} + m_bDocumentParser(bDocumentParser) { +} CXFA_SimpleParser::~CXFA_SimpleParser() { CloseParser(); } @@ -421,7 +423,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( pPacketInfo->eFlags)) { continue; } - if (pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) { + if (pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) { return nullptr; } pXMLConfigDOMRoot = pChildItem; @@ -1390,7 +1392,8 @@ IXFA_DocParser* IXFA_DocParser::Create(IXFA_Notify* pNotify) { return new CXFA_DocumentParser(pNotify); } CXFA_DocumentParser::CXFA_DocumentParser(IXFA_Notify* pNotify) - : m_pNotify(pNotify), m_nodeParser(NULL, TRUE), m_pDocument(NULL) {} + : m_nodeParser(NULL, TRUE), m_pNotify(pNotify), m_pDocument(NULL) { +} CXFA_DocumentParser::~CXFA_DocumentParser() { CloseParser(); } @@ -1442,22 +1445,19 @@ void CXFA_DocumentParser::CloseParser() { m_nodeParser.CloseParser(); } CXFA_XMLParser::CXFA_XMLParser(IFDE_XMLNode* pRoot, IFX_Stream* pStream) - : m_pRoot(pRoot), - m_pStream(pStream), - m_pParser(NULL), - m_dwStatus(FDE_XMLSYNTAXSTATUS_None), - m_pParent(pRoot), - m_pChild(NULL), - m_NodeStack(16), - m_ws1(), - m_ws2() + : #ifdef _XFA_VERIFY_Checksum_ - , m_nElementStart(0), m_dwCheckStatus(0), - m_dwCurrentCheckStatus(0) + m_dwCurrentCheckStatus(0), #endif -{ + m_pRoot(pRoot), + m_pStream(pStream), + m_pParser(nullptr), + m_pParent(pRoot), + m_pChild(nullptr), + m_NodeStack(16), + m_dwStatus(FDE_XMLSYNTAXSTATUS_None) { ASSERT(m_pParent && m_pStream); m_NodeStack.Push(m_pParent); m_pParser = IFDE_XMLSyntaxParser::Create(); diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.h b/xfa/src/fxfa/src/parser/xfa_parser_imp.h index 9ee400f8a6..d7f76b39b6 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.h @@ -64,9 +64,8 @@ class CXFA_SimpleParser : public IXFA_Parser { void ParseInstruction(CXFA_Node* pXFANode, IFDE_XMLInstruction* pXMLInstruction, XFA_XDPPACKET ePacketID); - - protected: void SetFactory(IXFA_ObjFactory* pFactory); + CXFA_XMLParser* m_pXMLParser; IFDE_XMLDoc* m_pXMLDoc; IFX_Stream* m_pStream; @@ -112,6 +111,14 @@ class CXFA_XMLParser : public IFDE_XMLParser { virtual void Release() { delete this; } virtual int32_t DoParser(IFX_Pause* pPause); +#ifdef _XFA_VERIFY_Checksum_ + FX_FILESIZE m_nStart[2]; + size_t m_nSize[2]; + FX_FILESIZE m_nElementStart; + FX_WORD m_dwCheckStatus; + FX_WORD m_dwCurrentCheckStatus; +#endif + protected: IFDE_XMLNode* m_pRoot; IFX_Stream* m_pStream; @@ -123,13 +130,5 @@ class CXFA_XMLParser : public IFDE_XMLParser { CFX_WideString m_ws1; CFX_WideString m_ws2; FX_DWORD m_dwStatus; -#ifdef _XFA_VERIFY_Checksum_ - public: - FX_FILESIZE m_nStart[2]; - size_t m_nSize[2]; - FX_FILESIZE m_nElementStart; - FX_WORD m_dwCheckStatus; - FX_WORD m_dwCurrentCheckStatus; -#endif }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index 34668ea66a..95b8b78377 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -21,15 +21,15 @@ #include "xfa_script_nodehelper.h" CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument) : m_pDocument(pDocument), - m_hJsRuntime(NULL), - m_hJsContext(NULL), - m_hJsClass(NULL), - m_pEventParam(NULL), - m_pResolveProcessor(NULL), + m_hJsContext(nullptr), + m_hJsRuntime(nullptr), + m_hJsClass(nullptr), m_eScriptType(XFA_SCRIPTLANGTYPE_Unkown), - m_hFM2JSContext(NULL), - m_pThisObject(NULL), - m_pScriptNodeArray(NULL), + m_pEventParam(nullptr), + m_pScriptNodeArray(nullptr), + m_pResolveProcessor(nullptr), + m_hFM2JSContext(nullptr), + m_pThisObject(nullptr), m_dwBuiltInInFlags(0), m_eRunAtType(XFA_ATTRIBUTEENUM_Client) { FX_memset(&m_JsGlobalClass, 0, sizeof(FXJSE_CLASS)); diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.h b/xfa/src/fxfa/src/parser/xfa_script_imp.h index 83a06e5076..9a1ed6daf2 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.h @@ -95,8 +95,8 @@ class CXFA_ScriptContext : public IXFA_ScriptContext { void DefineJsContext(); FXJSE_HCONTEXT CreateVariablesContext(CXFA_Node* pScriptNode, CXFA_Node* pSubform); - void DefineJsClass(); + CXFA_Document* m_pDocument; FXJSE_HCONTEXT m_hJsContext; FXJSE_HRUNTIME m_hJsRuntime; @@ -105,7 +105,6 @@ class CXFA_ScriptContext : public IXFA_ScriptContext { FXJSE_CLASS m_JsGlobalClass; FXJSE_CLASS m_JsNormalClass; CFX_MapPtrTemplate m_mapXFAToHValue; - FXJSE_CLASS m_JsGlobalVariablesClass; CFX_MapPtrTemplate m_mapVariableToHValue; CXFA_EventParam* m_pEventParam; -- cgit v1.2.3