From 25d2ad482399ec20fdd0542d7c286ed06842f053 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 23 Mar 2017 15:19:44 -0400 Subject: Tighten up XFA Visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl changes the protected sections to be private where possible in XFA. Change-Id: Ibeb6ad00389686b666b1c3c5e136b9eefe35ec9e Reviewed-on: https://pdfium-review.googlesource.com/3164 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fxfa/parser/cscript_eventpseudomodel.h | 2 +- xfa/fxfa/parser/cscript_hostpseudomodel.h | 4 +--- xfa/fxfa/parser/cscript_layoutpseudomodel.h | 4 +--- xfa/fxfa/parser/cxfa_dataexporter.h | 2 +- xfa/fxfa/parser/cxfa_dataimporter.h | 2 +- xfa/fxfa/parser/cxfa_document.h | 2 +- xfa/fxfa/parser/cxfa_document_parser.h | 2 +- xfa/fxfa/parser/cxfa_image.h | 2 +- xfa/fxfa/parser/cxfa_layoutpagemgr.h | 2 +- xfa/fxfa/parser/cxfa_nodehelper.h | 1 - xfa/fxfa/parser/cxfa_validate.h | 2 +- xfa/fxfa/parser/cxfa_widetextread.h | 2 +- xfa/fxfa/parser/cxfa_widgetdata.h | 2 +- xfa/fxfa/parser/xfa_locale.h | 5 ++--- xfa/fxfa/parser/xfa_localevalue.h | 2 +- xfa/fxfa/parser/xfa_object.h | 6 +++--- xfa/fxfa/parser/xfa_utils.h | 2 +- 17 files changed, 19 insertions(+), 25 deletions(-) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.h b/xfa/fxfa/parser/cscript_eventpseudomodel.h index 6415287c8e..e50c5ac187 100644 --- a/xfa/fxfa/parser/cscript_eventpseudomodel.h +++ b/xfa/fxfa/parser/cscript_eventpseudomodel.h @@ -63,7 +63,7 @@ class CScript_EventPseudoModel : public CXFA_Object { void Emit(CFXJSE_Arguments* pArguments); void Reset(CFXJSE_Arguments* pArguments); - protected: + private: void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting); }; diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.h b/xfa/fxfa/parser/cscript_hostpseudomodel.h index 7d24a1d2b4..c64ad2ed7d 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.h +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.h @@ -50,12 +50,10 @@ class CScript_HostPseudoModel : public CXFA_Object { void PageDown(CFXJSE_Arguments* pArguments); void CurrentDateTime(CFXJSE_Arguments* pArguments); - protected: + private: bool ValidateArgsForMsg(CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue); - - private: void ThrowSetLanguageException() const; void ThrowSetNumPagesException() const; void ThrowSetPlatformException() const; diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.h b/xfa/fxfa/parser/cscript_layoutpseudomodel.h index e5e1131adc..a61f927299 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.h +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.h @@ -50,14 +50,12 @@ class CScript_LayoutPseudoModel : public CXFA_Object { void SheetCount(CFXJSE_Arguments* pArguments); void AbsPage(CFXJSE_Arguments* pArguments); - protected: + private: std::vector GetObjArray(CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, bool bOnPageArea); void PageImp(CFXJSE_Arguments* pArguments, bool bAbsPage); - - private: void ThrowSetReadyException() const; }; diff --git a/xfa/fxfa/parser/cxfa_dataexporter.h b/xfa/fxfa/parser/cxfa_dataexporter.h index 2037167fba..ac441ca21d 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.h +++ b/xfa/fxfa/parser/cxfa_dataexporter.h @@ -25,7 +25,7 @@ class CXFA_DataExporter { uint32_t dwFlag, const char* pChecksum); - protected: + private: bool Export(const CFX_RetainPtr& pStream, CXFA_Node* pNode, uint32_t dwFlag, diff --git a/xfa/fxfa/parser/cxfa_dataimporter.h b/xfa/fxfa/parser/cxfa_dataimporter.h index bf04b05846..4e8bdda314 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.h +++ b/xfa/fxfa/parser/cxfa_dataimporter.h @@ -19,7 +19,7 @@ class CXFA_DataImporter { bool ImportData(const CFX_RetainPtr& pDataDocument); - protected: + private: CXFA_Document* const m_pDocument; }; diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h index 293515610c..3446b88382 100644 --- a/xfa/fxfa/parser/cxfa_document.h +++ b/xfa/fxfa/parser/cxfa_document.h @@ -109,7 +109,7 @@ class CXFA_Document { std::map m_rgGlobalBinding; std::vector m_pPendingPageSet; - protected: + private: CXFA_DocumentParser* m_pParser; CXFA_Node* m_pRootNode; std::unique_ptr m_pScriptContext; diff --git a/xfa/fxfa/parser/cxfa_document_parser.h b/xfa/fxfa/parser/cxfa_document_parser.h index 617bddf55b..9a219f74c1 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.h +++ b/xfa/fxfa/parser/cxfa_document_parser.h @@ -31,7 +31,7 @@ class CXFA_DocumentParser { CXFA_FFNotify* GetNotify() const; CXFA_Document* GetDocument() const; - protected: + private: CXFA_SimpleParser m_nodeParser; CXFA_FFNotify* m_pNotify; std::unique_ptr m_pDocument; diff --git a/xfa/fxfa/parser/cxfa_image.h b/xfa/fxfa/parser/cxfa_image.h index bf69897693..204441ab6b 100644 --- a/xfa/fxfa/parser/cxfa_image.h +++ b/xfa/fxfa/parser/cxfa_image.h @@ -26,7 +26,7 @@ class CXFA_Image : public CXFA_Data { bool SetHref(const CFX_WideString& wsHref); bool SetTransferEncoding(int32_t iTransferEncoding); - protected: + private: bool m_bDefValue; }; diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h index be90b4674f..ae967b55c0 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h @@ -51,7 +51,7 @@ class CXFA_LayoutPageMgr { bool bLeader, CXFA_Node*& pBookendAppendNode); - protected: + private: bool AppendNewPage(bool bFirstTemPage = false); void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord, CXFA_ContainerRecord* pPrevRecord); diff --git a/xfa/fxfa/parser/cxfa_nodehelper.h b/xfa/fxfa/parser/cxfa_nodehelper.h index 7da6c5dece..d26ccf64e9 100644 --- a/xfa/fxfa/parser/cxfa_nodehelper.h +++ b/xfa/fxfa/parser/cxfa_nodehelper.h @@ -62,7 +62,6 @@ class CXFA_NodeHelper { void SetCreateNodeType(CXFA_Node* refNode); bool NodeIsProperty(CXFA_Node* refNode); - public: XFA_Element m_eLastCreateType; CXFA_Node* m_pCreateParent; int32_t m_iCreateCount; diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validate.h index 03bbaddf7b..470cefe773 100644 --- a/xfa/fxfa/parser/cxfa_validate.h +++ b/xfa/fxfa/parser/cxfa_validate.h @@ -31,7 +31,7 @@ class CXFA_Validate : public CXFA_Data { void GetPicture(CFX_WideString& wsPicture); CXFA_Script GetScript(); - protected: + private: void GetMessageText(CFX_WideString& wsMessage, const CFX_WideString& wsMessageType); void SetMessageText(CFX_WideString& wsMessage, diff --git a/xfa/fxfa/parser/cxfa_widetextread.h b/xfa/fxfa/parser/cxfa_widetextread.h index 6c4a97f358..3850660fbd 100644 --- a/xfa/fxfa/parser/cxfa_widetextread.h +++ b/xfa/fxfa/parser/cxfa_widetextread.h @@ -36,7 +36,7 @@ class CXFA_WideTextRead : public IFGAS_Stream { CFX_WideString GetSrcText() const; - protected: + private: explicit CXFA_WideTextRead(const CFX_WideString& wsBuffer); ~CXFA_WideTextRead() override; diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index a04726e105..3e74018432 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -162,7 +162,7 @@ class CXFA_WidgetData : public CXFA_Data { bool m_bIsNull; bool m_bPreNull; - protected: + private: void SyncValue(const CFX_WideString& wsValue, bool bNotify); void InsertListTextItem(CXFA_Node* pItems, const CFX_WideString& wsText, diff --git a/xfa/fxfa/parser/xfa_locale.h b/xfa/fxfa/parser/xfa_locale.h index 5326f513c1..ae3e4bd170 100644 --- a/xfa/fxfa/parser/xfa_locale.h +++ b/xfa/fxfa/parser/xfa_locale.h @@ -41,7 +41,7 @@ class CXFA_XMLLocale : public IFX_Locale { void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString& wsPattern) const override; - protected: + private: void GetPattern(CXML_Element* pElement, const CFX_ByteStringC& bsTag, const CFX_WideStringC& wsName, @@ -50,7 +50,6 @@ class CXFA_XMLLocale : public IFX_Locale { int index, bool bAbbr) const; - private: std::unique_ptr m_pLocaleData; }; @@ -83,7 +82,7 @@ class CXFA_NodeLocale : public IFX_Locale { void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString& wsPattern) const override; - protected: + private: CXFA_Node* GetNodeByName(CXFA_Node* pParent, const CFX_WideStringC& wsName) const; CFX_WideString GetSymbol(XFA_Element eElement, diff --git a/xfa/fxfa/parser/xfa_localevalue.h b/xfa/fxfa/parser/xfa_localevalue.h index cea5eb1dc5..dfe758d4a9 100644 --- a/xfa/fxfa/parser/xfa_localevalue.h +++ b/xfa/fxfa/parser/xfa_localevalue.h @@ -99,7 +99,7 @@ class CXFA_LocaleValue { bool IsEmpty() const { return m_wsValue.IsEmpty(); } bool IsValid() const { return m_bValid; } - protected: + private: bool ParsePatternValue(const CFX_WideString& wsValue, const CFX_WideString& wsPattern, IFX_Locale* pLocale); diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index 91b88631ed..3e98a4747c 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -615,7 +615,7 @@ class CXFA_Node : public CXFA_Object { bool bSetting, XFA_ATTRIBUTE eAttribute); - protected: + private: friend class CXFA_Document; CXFA_Node(CXFA_Document* pDoc, @@ -737,7 +737,7 @@ class CXFA_ArrayNodeList : public CXFA_NodeList { void SetArrayNodeList(const std::vector& srcArray); - protected: + private: std::vector m_array; }; @@ -752,7 +752,7 @@ class CXFA_AttachNodeList : public CXFA_NodeList { bool Remove(CXFA_Node* pNode) override; CXFA_Node* Item(int32_t iIndex) override; - protected: + private: CXFA_Node* m_pAttachNode; }; class CXFA_TraverseStrategy_XFAContainerNode { diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index c40fdf1b18..c3111795da 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -91,7 +91,7 @@ class CXFA_NodeIteratorTemplate { return m_pCurrent; } - protected: + private: bool RootReachableFromNode(NodeType* pNode) { if (!pNode) return false; -- cgit v1.2.3