diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-03 09:57:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-03 15:04:53 +0200 |
commit | a61b4c214b8acfcdddd2f5203184468e329bdb92 (patch) | |
tree | 6fec90f7a394852d719dbc8ac1bf22728e6af129 /include/filter | |
parent | ea59fc4831b9d2430de51faa8c3e0a24e6d90cd1 (diff) |
forcepoint#70 give all escher client data objects a common parent class
and make NotifyFreeObj a virtual method of SvxMSDffClientData, finding
the sc case where the client data was neither SvxMSDffImportData nor
ProcessData.
make the sc case a XclImpDrawObjClientData whose NotifyFreeObj is a noop
Change-Id: I07422e7a3415114674bb1e3c1ef120299adf2dc8
Reviewed-on: https://gerrit.libreoffice.org/58551
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/filter')
-rw-r--r-- | include/filter/msfilter/msdffimp.hxx | 32 | ||||
-rw-r--r-- | include/filter/msfilter/svdfppt.hxx | 14 |
2 files changed, 28 insertions, 18 deletions
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index 79ff6759a168..4eadb1c779b0 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -73,6 +73,13 @@ namespace com { namespace sun { namespace star { namespace embed { class XStorage; } } } } +class MSFILTER_DLLPUBLIC SvxMSDffClientData +{ +public: + virtual void NotifyFreeObj(SdrObject* pObj) = 0; + virtual ~SvxMSDffClientData() {} +}; + class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet { const SvxMSDffManager& rManager; @@ -99,9 +106,9 @@ public: static sal_Int32 Fix16ToAngle( sal_Int32 nAngle ); #ifdef DBG_CUSTOMSHAPE - void ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeType = 0 ) const; + void ReadPropSet( SvStream& rIn, SvxMSDffClientData* pClientData, sal_uInt32 nShapeType = 0 ) const; #else - void ReadPropSet( SvStream& rIn, void* pClientData ) const; + void ReadPropSet( SvStream& rIn, SvxMSDffClientData* pClientData ) const; #endif void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const; @@ -265,7 +272,7 @@ private: /** block of parameters for import/export for a single call of ImportObjAtCurrentStreamPos() */ -class MSFILTER_DLLPUBLIC SvxMSDffImportData +class MSFILTER_DLLPUBLIC SvxMSDffImportData : public SvxMSDffClientData { private: /** list of all SvxMSDffImportRec instances of/for a group */ @@ -280,7 +287,7 @@ public: explicit SvxMSDffImportData(const tools::Rectangle& rParentRect); SvxMSDffImportData& operator=( SvxMSDffImportData const & ) = delete; // MSVC2015 workaround SvxMSDffImportData( SvxMSDffImportData const & ) = delete; // MSVC2015 workaround - ~SvxMSDffImportData(); + virtual ~SvxMSDffImportData() override; bool empty() const { return m_Records.empty(); } void insert(SvxMSDffImportRec* pImpRec); void unmap(const SdrObject* pObj) { m_ObjToRecMap.erase(pObj); } @@ -289,6 +296,7 @@ public: SvxMSDffImportRec* find(const SdrObject* pObj); MSDffImportRecords::const_iterator begin() const { return m_Records.begin(); } MSDffImportRecords::const_iterator end() const { return m_Records.end(); } + virtual void NotifyFreeObj(SdrObject* pObj) override; }; struct DffObjData @@ -499,18 +507,18 @@ protected: sal_uInt32& rBuffLen ); virtual void ProcessClientAnchor2( SvStream& rStData, DffRecordHeader& rHd, - void* pData, DffObjData& ); + SvxMSDffClientData& rData, DffObjData& ); static void ProcessClientData( SvStream& rStData, sal_uInt32 nDatLen, std::unique_ptr<char[]>& rpBuff, sal_uInt32& rBuffLen ); virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, - void* pData, + SvxMSDffClientData& rClientData, tools::Rectangle& rTextRect, SdrObject* pObj); - virtual void NotifyFreeObj(void* pData, SdrObject* pObj); - void FreeObj(void* pData, SdrObject* pObj); + virtual void NotifyFreeObj(SvxMSDffClientData& rData, SdrObject* pObj); + void FreeObj(SvxMSDffClientData& rData, SdrObject* pObj); /** Object finalization, used by the Excel filter to correctly @@ -552,7 +560,7 @@ public: Color MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const; virtual bool SeekToShape( SvStream& rSt, - void* pClientData, + SvxMSDffClientData* pClientData, sal_uInt32 nId ) const; static bool SeekToRec( SvStream& rSt, sal_uInt16 nRecId, @@ -661,21 +669,21 @@ public: bool GetShape(sal_uLong nId, SdrObject*& rpData, SvxMSDffImportData& rData); SdrObject* ImportObj( SvStream& rSt, - void* pData, + SvxMSDffClientData& rData, tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId); SdrObject* ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, - void* pData, + SvxMSDffClientData& rData, tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId ); SdrObject* ImportShape( const DffRecordHeader& rHd, SvStream& rSt, - void* pData, + SvxMSDffClientData& rData, tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect, int nCalledByGroup, diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 5600200334d9..dd220f9bcc3e 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -479,13 +479,13 @@ public: SdrEscherImport( PowerPointImportParam&, const OUString& rBaseURL ); virtual ~SdrEscherImport() override; virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const override; - virtual bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const override; + virtual bool SeekToShape( SvStream& rSt, SvxMSDffClientData* pClientData, sal_uInt32 nId ) const override; PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const; void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph ); virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPageCapsule pPage ) const; - virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, tools::Rectangle& rTextRect, SdrObject* pObj ) override; - virtual void NotifyFreeObj(void* pData, SdrObject* pObj) override; - virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj ) override; + virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, SvxMSDffClientData& rClientData, tools::Rectangle& rTextRect, SdrObject* pObj ) override; + virtual void NotifyFreeObj(SvxMSDffClientData& rData, SdrObject* pObj) override; + virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, SvxMSDffClientData& rData, DffObjData& rObj ) override; void ImportHeaderFooterContainer( DffRecordHeader const & rHeader, HeaderFooterEntry& rEntry ); }; @@ -531,7 +531,7 @@ struct MSFILTER_DLLPUBLIC HeaderFooterEntry explicit HeaderFooterEntry( const PptSlidePersistEntry* pMaster = nullptr ); }; -struct ProcessData +struct MSFILTER_DLLPUBLIC ProcessData : public SvxMSDffClientData { PptSlidePersistEntry& rPersistEntry; SdPageCapsule pPage; @@ -541,6 +541,8 @@ struct ProcessData ProcessData( PptSlidePersistEntry& rP, SdPageCapsule pP ) : rPersistEntry ( rP ), pPage ( pP ) {}; + + virtual void NotifyFreeObj(SdrObject* pObj) override; }; @@ -638,7 +640,7 @@ public: void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist ); virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const override; - virtual bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const override; + virtual bool SeekToShape( SvStream& rSt, SvxMSDffClientData* pClientData, sal_uInt32 nId ) const override; virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const override; SdrObject* CreateTable( SdrObject* pGroupObject, |