[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - filter/source include/filter sc/source sd/source sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 7 15:40:18 UTC 2018
filter/source/msfilter/msdffimp.cxx | 66 ++++++++++++++++++-----------------
filter/source/msfilter/svdfppt.cxx | 27 +++++++-------
include/filter/msfilter/msdffimp.hxx | 32 ++++++++++------
include/filter/msfilter/svdfppt.hxx | 14 ++++---
sc/source/filter/excel/xiescher.cxx | 33 +++++++++++------
sc/source/filter/inc/xiescher.hxx | 4 +-
sd/source/filter/ppt/pptin.cxx | 16 ++++----
sd/source/filter/ppt/pptin.hxx | 2 -
sw/source/filter/ww8/ww8graf2.cxx | 2 -
sw/source/filter/ww8/ww8par.cxx | 4 +-
sw/source/filter/ww8/ww8par.hxx | 2 -
11 files changed, 115 insertions(+), 87 deletions(-)
New commits:
commit 1a6a05adf8b0f2620c0798e8c6811b08c80d0dea
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 3 09:57:24 2018 +0100
Commit: Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Aug 7 17:39:57 2018 +0200
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/58552
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 923013f96d82..96db3884ddbf 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -242,9 +242,9 @@ void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, sal_uInt32 nOffsDg
}
#ifdef DBG_CUSTOMSHAPE
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeId ) const
+void DffPropertyReader::ReadPropSet( SvStream& rIn, SvxMSDffClientData* pClientData, sal_uInt32 nShapeId ) const
#else
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
+void DffPropertyReader::ReadPropSet( SvStream& rIn, SvxMSDffClientData* pClientData ) const
#endif
{
sal_uLong nFilePos = rIn.Tell();
@@ -3182,7 +3182,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
}
}
-bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_uInt32 nId ) const
+bool SvxMSDffManager::SeekToShape( SvStream& rSt, SvxMSDffClientData* /* pClientData */, sal_uInt32 nId ) const
{
bool bRet = false;
if ( !maFidcls.empty() )
@@ -4021,7 +4021,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
}
// PptSlidePersistEntry& rPersistEntry, SdPage* pPage
-SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
+SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, SvxMSDffClientData& rClientData,
tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId )
{
SdrObject* pRet = nullptr;
@@ -4029,17 +4029,17 @@ SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
bool bOk = ReadDffRecordHeader(rSt, aObjHd);
if (bOk && aObjHd.nRecType == DFF_msofbtSpgrContainer)
{
- pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ pRet = ImportGroup( aObjHd, rSt, rClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
}
else if (bOk && aObjHd.nRecType == DFF_msofbtSpContainer)
{
- pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ pRet = ImportShape( aObjHd, rSt, rClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
}
aObjHd.SeekToBegOfRecord( rSt ); // restore FilePos
return pRet;
}
-SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
+SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, SvxMSDffClientData& rClientData,
tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect,
int nCalledByGroup, sal_Int32* pShapeId )
{
@@ -4058,7 +4058,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
mnFix16Angle = 0;
if (!aRecHd.SeekToBegOfRecord(rSt))
return pRet;
- pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
+ pRet = ImportObj( rSt, rClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
if ( pRet )
{
sal_Int32 nGroupRotateAngle = 0;
@@ -4103,7 +4103,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
if (!aRecHd2.SeekToBegOfRecord(rSt))
return pRet;
sal_Int32 nShapeId;
- SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
+ SdrObject* pTmp = ImportGroup( aRecHd2, rSt, rClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
if (pTmp)
{
SdrObjGroup* pGroup = dynamic_cast<SdrObjGroup*>(pRet);
@@ -4114,7 +4114,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
insertShapeId(nShapeId, pTmp);
}
else
- FreeObj(pClientData, pTmp);
+ FreeObj(rClientData, pTmp);
}
}
else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
@@ -4122,7 +4122,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
if (!aRecHd2.SeekToBegOfRecord(rSt))
return pRet;
sal_Int32 nShapeId;
- SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
+ SdrObject* pTmp = ImportShape( aRecHd2, rSt, rClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
if (pTmp)
{
SdrObjGroup* pGroup = dynamic_cast<SdrObjGroup*>(pRet);
@@ -4133,7 +4133,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
insertShapeId(nShapeId, pTmp);
}
else
- FreeObj(pClientData, pTmp);
+ FreeObj(rClientData, pTmp);
}
}
if (!aRecHd2.SeekToEndOfRecord(rSt))
@@ -4168,7 +4168,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
return pRet;
}
-SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
+SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, SvxMSDffClientData& rClientData,
tools::Rectangle& rClientRect, const tools::Rectangle& rGlobalChildRect,
int nCalledByGroup, sal_Int32* pShapeId )
{
@@ -4231,9 +4231,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if (!maShapeRecords.Current()->SeekToBegOfRecord(rSt))
return pRet;
#ifdef DBG_AUTOSHAPE
- ReadPropSet( rSt, pClientData, (sal_uInt32)aObjData.eShapeType );
+ ReadPropSet( rSt, &rClientData, (sal_uInt32)aObjData.eShapeType );
#else
- ReadPropSet( rSt, pClientData );
+ ReadPropSet( rSt, &rClientData );
#endif
}
else
@@ -4276,7 +4276,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtClientAnchor, SEEK_FROM_CURRENT_AND_RESTART );
if ( aObjData.bClientAnchor )
- ProcessClientAnchor2( rSt, *maShapeRecords.Current(), pClientData, aObjData );
+ ProcessClientAnchor2( rSt, *maShapeRecords.Current(), rClientData, aObjData );
if ( aObjData.bChildAnchor )
aObjData.aBoundRect = aObjData.aChildAnchor;
@@ -4856,7 +4856,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
}
pRet =
- ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
+ ProcessObj( rSt, aObjData, rClientData, aTextRect, pRet);
if ( pRet )
{
@@ -5045,40 +5045,44 @@ void SvxMSDffImportData::insert(SvxMSDffImportRec* pImpRec)
m_Records.insert(std::unique_ptr<SvxMSDffImportRec>(pImpRec));
}
-void SvxMSDffManager::NotifyFreeObj(void* pData, SdrObject* pObj)
+void SvxMSDffImportData::NotifyFreeObj(SdrObject* pObj)
+{
+ if (SvxMSDffImportRec* pRecord = find(pObj))
+ {
+ unmap(pObj);
+ pRecord->pObj = nullptr;
+ }
+}
+
+void SvxMSDffManager::NotifyFreeObj(SvxMSDffClientData& rData, SdrObject* pObj)
{
if (SdrObjGroup* pGroup = dynamic_cast<SdrObjGroup*>(pObj))
{
SdrObjList* pSubList = pGroup->GetSubList();
size_t nObjCount = pSubList->GetObjCount();
for (size_t i = 0; i < nObjCount; ++i)
- NotifyFreeObj(pData, pSubList->GetObj(i));
+ NotifyFreeObj(rData, pSubList->GetObj(i));
}
- SvxMSDffImportData& rImportData = *static_cast<SvxMSDffImportData*>(pData);
- if (SvxMSDffImportRec* pRecord = rImportData.find(pObj))
- {
- rImportData.unmap(pObj);
- pRecord->pObj = nullptr;
- }
+ rData.NotifyFreeObj(pObj);
}
-void SvxMSDffManager::FreeObj(void* pData, SdrObject* pObj)
+void SvxMSDffManager::FreeObj(SvxMSDffClientData& rData, SdrObject* pObj)
{
- NotifyFreeObj(pData, pObj);
+ NotifyFreeObj(rData, pObj);
SdrObject::Free(pObj);
}
SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
DffObjData& rObjData,
- void* pData,
+ SvxMSDffClientData& rData,
tools::Rectangle& rTextRect,
SdrObject* pObj
)
{
if( !rTextRect.IsEmpty() )
{
- SvxMSDffImportData& rImportData = *static_cast<SvxMSDffImportData*>(pData);
+ SvxMSDffImportData& rImportData = static_cast<SvxMSDffImportData&>(rData);
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
bool bDeleteImpRec = true;
SvxMSDffImportRec* pTextImpRec = pImpRec;
@@ -6316,7 +6320,7 @@ bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
if (!bSeeked || rStCtrl.GetError())
rStCtrl.ResetError();
else
- rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ rpShape = ImportObj( rStCtrl, rData, rData.aParentRect, rData.aParentRect, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
// restore old FilePos of the stream(s)
rStCtrl.Seek( nOldPosCtrl );
@@ -6631,7 +6635,7 @@ bool SvxMSDffManager::ProcessClientData(SvStream& rStData, sal_uInt32 nDatLen,
}
-void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader& /* rHd */ , void* /* pData */, DffObjData& /* rObj */ )
+void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader& /* rHd */ , SvxMSDffClientData& /* rData */, DffObjData& /* rObj */ )
{
// will be overridden by SJ in Draw
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 3aaf6c44dcba..c9818b257c3b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -557,7 +557,7 @@ bool SdrEscherImport::GetColorFromPalette(sal_uInt16 /*nNum*/, Color& /*rColor*/
return false;
}
-bool SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/, sal_uInt32 /*nId*/) const
+bool SdrEscherImport::SeekToShape( SvStream& /*rSt*/, SvxMSDffClientData* /*pClientData*/, sal_uInt32 /*nId*/) const
{
return false;
}
@@ -575,7 +575,7 @@ SdrObject* SdrEscherImport::ReadObjText( PPTTextObj* /*pTextObj*/, SdrObject* pO
return pObj;
}
-void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* /*pData*/, DffObjData& rObj )
+void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, SvxMSDffClientData& /*rData*/, DffObjData& rObj )
{
sal_Int32 l, t, r, b;
if ( rHd.nRecLen == 16 )
@@ -710,10 +710,8 @@ sal_uLong DffPropSet::SanitizeEndPos(SvStream &rIn, sal_uLong nEndRecPos)
return nEndRecPos;
}
-void SdrEscherImport::NotifyFreeObj(void* pData, SdrObject* pObj)
+void ProcessData::NotifyFreeObj(SdrObject* pObj)
{
- ProcessData& rData = *static_cast<ProcessData*>(pData);
- PptSlidePersistEntry& rPersistEntry = rData.rPersistEntry;
if (rPersistEntry.xSolverContainer)
{
for (auto & pPtr : rPersistEntry.xSolverContainer->aCList)
@@ -728,13 +726,18 @@ void SdrEscherImport::NotifyFreeObj(void* pData, SdrObject* pObj)
}
}
+void SdrEscherImport::NotifyFreeObj(SvxMSDffClientData& rData, SdrObject* pObj)
+{
+ rData.NotifyFreeObj(pObj);
+}
+
/* ProcessObject is called from ImplSdPPTImport::ProcessObj to handle all application specific things,
such as the import of text, animation effects, header footer and placeholder.
The parameter pOriginalObj is the object as it was imported by our general escher import, it must either
be deleted or it can be returned to be inserted into the sdr page.
*/
-SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, tools::Rectangle& rTextRect, SdrObject* pOriginalObj )
+SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, SvxMSDffClientData& rClientData, tools::Rectangle& rTextRect, SdrObject* pOriginalObj )
{
if ( dynamic_cast<const SdrObjCustomShape* >(pOriginalObj) != nullptr )
pOriginalObj->SetMergedItem( SdrTextFixedCellHeightItem( true ) );
@@ -742,7 +745,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
// we are initializing our return value with the object that was imported by our escher import
SdrObject* pRet = pOriginalObj;
- ProcessData& rData = *static_cast<ProcessData*>(pData);
+ ProcessData& rData = static_cast<ProcessData&>(rClientData);
PptSlidePersistEntry& rPersistEntry = rData.rPersistEntry;
if ( ! (rObjData.nSpFlags & ShapeFlag::Group) ) // sj: #114758# ...
@@ -1217,7 +1220,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
maShapeRecords.Current()->SeekToBegOfRecord( rSt );
DffPropertyReader aSecPropSet( *this );
- aSecPropSet.ReadPropSet( rSt, pData );
+ aSecPropSet.ReadPropSet( rSt, &rClientData );
sal_Int32 nTableProperties = aSecPropSet.GetPropertyValue( DFF_Prop_tableProperties, 0 );
if ( nTableProperties & 3 )
{
@@ -2594,7 +2597,7 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
return true;
}
-bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const
+bool SdrPowerPointImport::SeekToShape( SvStream& rSt, SvxMSDffClientData* pClientData, sal_uInt32 nId ) const
{
bool bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId );
if (!bRet && pClientData)
@@ -2831,7 +2834,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
// do not follow master colorscheme?
sal_uInt32 nPos = rStCtrl.Tell();
rStCtrl.Seek( pE->nBackgroundOffset );
- rSlidePersist.pBObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aPageSize, aPageSize, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ rSlidePersist.pBObj = ImportObj( rStCtrl, aProcessData, aPageSize, aPageSize, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
rStCtrl.Seek( nPos );
}
}
@@ -2847,7 +2850,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( ShapeFlag(nSpFlags) & ShapeFlag::Background )
{
aEscherObjListHd.SeekToBegOfRecord( rStCtrl );
- rSlidePersist.pBObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aPageSize, aPageSize, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ rSlidePersist.pBObj = ImportObj( rStCtrl, aProcessData, aPageSize, aPageSize, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
}
}
}
@@ -2888,7 +2891,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
aShapeHd.SeekToBegOfRecord( rStCtrl );
sal_Int32 nShapeId;
aProcessData.pTableRowProperties.reset();
- SdrObject* pObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty, 0, &nShapeId );
+ SdrObject* pObj = ImportObj( rStCtrl, aProcessData, aEmpty, aEmpty, 0, &nShapeId );
if ( pObj )
{
if ( aProcessData.pTableRowProperties )
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index 41f5ce32ae0f..2a1435e4cca0 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -72,6 +72,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;
@@ -98,9 +105,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;
@@ -264,7 +271,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 */
@@ -279,7 +286,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); }
@@ -288,6 +295,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
@@ -498,18 +506,18 @@ protected:
sal_uInt32& rBuffLen );
virtual void ProcessClientAnchor2( SvStream& rStData,
DffRecordHeader& rHd,
- void* pData, DffObjData& );
+ SvxMSDffClientData& rData, DffObjData& );
static bool 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
@@ -551,7 +559,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,
@@ -660,21 +668,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 e3be8307a185..669db8eefc75 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -478,13 +478,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
~HeaderFooterEntry();
};
-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,
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index b530e8705f7c..47a2a598104e 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3497,7 +3497,7 @@ bool XclImpDffConverter::SupportsOleObjects() const
// virtual functions ----------------------------------------------------------
void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm,
- DffRecordHeader& rHeader, void* /*pClientData*/, DffObjData& rObjData )
+ DffRecordHeader& rHeader, SvxMSDffClientData& /*rClientData*/, DffObjData& rObjData )
{
// find the OBJ record data related to the processed shape
XclImpDffConvData& rConvData = GetConvData();
@@ -3520,8 +3520,19 @@ void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm,
}
}
+struct XclImpDrawObjClientData : public SvxMSDffClientData
+{
+ const XclImpDrawObjBase* m_pTopLevelObj;
+
+ XclImpDrawObjClientData()
+ : m_pTopLevelObj(nullptr)
+ {
+ }
+ virtual void NotifyFreeObj(SdrObject*) override {}
+};
+
SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffObjData,
- void* pClientData, tools::Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
+ SvxMSDffClientData& rClientData, tools::Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
{
XclImpDffConvData& rConvData = GetConvData();
@@ -3542,10 +3553,10 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
/* Pass pointer to top-level object back to caller. If the processed
object is embedded in a group, the pointer is already set to the
top-level parent object. */
- XclImpDrawObjBase** ppTopLevelObj = static_cast< XclImpDrawObjBase** >( pClientData );
- bool bIsTopLevel = !ppTopLevelObj || !*ppTopLevelObj;
- if( ppTopLevelObj && bIsTopLevel )
- *ppTopLevelObj = xDrawObj.get();
+ XclImpDrawObjClientData& rDrawObjClientData = static_cast<XclImpDrawObjClientData&>(rClientData);
+ const bool bIsTopLevel = !rDrawObjClientData.m_pTopLevelObj;
+ if (bIsTopLevel )
+ rDrawObjClientData.m_pTopLevelObj = xDrawObj.get();
// connectors don't have to be area objects
if( dynamic_cast< SdrEdgeObj* >( xSdrObj.get() ) )
@@ -3787,16 +3798,16 @@ bool XclImpDffConverter::ProcessShContainer( SvStream& rDffStrm, const DffRecord
{
rShHeader.SeekToBegOfRecord( rDffStrm );
tools::Rectangle aDummy;
- const XclImpDrawObjBase* pDrawObj = nullptr;
+ XclImpDrawObjClientData aDrawObjClientData;
/* The call to ImportObj() creates and returns a new SdrObject for the
processed shape. We take ownership of the returned object here. If the
shape is a group object, all embedded objects are created recursively,
and the returned group object contains them all. ImportObj() calls the
virtual functions ProcessClientAnchor2() and ProcessObj() and writes
- the pointer to the related draw object data (OBJ record) into pDrawObj. */
- SdrObjectPtr xSdrObj( ImportObj( rDffStrm, &pDrawObj, aDummy, aDummy, /*nCalledByGroup*/0, /*pShapeId*/nullptr ) );
- if( pDrawObj && xSdrObj )
- InsertSdrObject( GetConvData().mrSdrPage, *pDrawObj, xSdrObj.release() );
+ the pointer to the related draw object data (OBJ record) into aDrawObjClientData. */
+ SdrObjectPtr xSdrObj( ImportObj( rDffStrm, aDrawObjClientData, aDummy, aDummy, /*nCalledByGroup*/0, /*pShapeId*/nullptr ) );
+ if (aDrawObjClientData.m_pTopLevelObj && xSdrObj )
+ InsertSdrObject( GetConvData().mrSdrPage, *aDrawObjClientData.m_pTopLevelObj, xSdrObj.release() );
return rShHeader.SeekToEndOfRecord( rDffStrm );
}
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 626d94c15bdd..015b7c745242 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -954,13 +954,13 @@ private:
virtual void ProcessClientAnchor2(
SvStream& rDffStrm,
DffRecordHeader& rHeader,
- void* pClientData,
+ SvxMSDffClientData& rClientData,
DffObjData& rObjData ) override;
/** Processes an DFF object, reads properties from DFF stream. */
virtual SdrObject* ProcessObj(
SvStream& rDffStrm,
DffObjData& rDffObjData,
- void* pClientData,
+ SvxMSDffClientData& rClientData,
tools::Rectangle& rTextRect,
SdrObject* pOldSdrObj ) override;
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 122262da6566..262abd6f399d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -805,7 +805,7 @@ bool ImplSdPPTImport::Import()
::tools::Rectangle aEmpty;
if (!aHd2.SeekToBegOfRecord(rStCtrl))
break;
- SdrObject* pImpObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/ nullptr );
+ SdrObject* pImpObj = ImportObj( rStCtrl, aProcessData, aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/ nullptr );
if ( pImpObj )
{
pImpObj->SetLayer( mnBackgroundObjectsLayerID );
@@ -1437,7 +1437,7 @@ void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlide
bVisible = false;
rStCtrl.Seek( nPosition );
ProcessData aProcessData( rSlidePersist, SdPageCapsule(pPage) );
- SdrObject* pObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ SdrObject* pObj = ImportObj( rStCtrl, aProcessData, aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
if ( pObj )
pPage->NbcInsertObject( pObj, 0 );
}
@@ -2576,9 +2576,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
return pRet;
}
-SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, ::tools::Rectangle& rTextRect, SdrObject* pRet )
+SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, SvxMSDffClientData& rData, ::tools::Rectangle& rTextRect, SdrObject* pRet )
{
- SdrObject* pObj = SdrPowerPointImport::ProcessObj( rSt, rObjData, pData, rTextRect, pRet );
+ SdrObject* pObj = SdrPowerPointImport::ProcessObj( rSt, rObjData, rData, rTextRect, pRet );
// read animation effect of object
if ( pObj )
@@ -2586,9 +2586,9 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
// further setup placeholder objects
if (dynamic_cast<const SdrPageObj*>(pObj))
{
- const ProcessData* pProcessData=static_cast<const ProcessData*>(pData);
- if( pProcessData->pPage.page )
- static_cast<SdPage *>(pProcessData->pPage.page)->InsertPresObj(
+ const ProcessData& rProcessData=static_cast<const ProcessData&>(rData);
+ if(rProcessData.pPage.page)
+ static_cast<SdPage *>(rProcessData.pPage.page)->InsertPresObj(
pObj, PRESOBJ_PAGE );
}
@@ -2723,7 +2723,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( bInhabitanceChecked || bAnimationInfoFound )
break;
bInhabitanceChecked = true;
- if ( ! ( IsProperty( DFF_Prop_hspMaster ) && SeekToShape( rSt, pData, GetPropertyValue( DFF_Prop_hspMaster, 0 ) ) ) )
+ if ( ! ( IsProperty( DFF_Prop_hspMaster ) && SeekToShape( rSt, &rData, GetPropertyValue( DFF_Prop_hspMaster, 0 ) ) ) )
break;
ReadDffRecordHeader( rSt, aMasterShapeHd );
if ( !SeekToRec( rSt, DFF_msofbtClientData, aMasterShapeHd.GetRecEndFilePos(), &aMasterShapeHd ) )
diff --git a/sd/source/filter/ppt/pptin.hxx b/sd/source/filter/ppt/pptin.hxx
index f4b6de81d752..4ede9502d149 100644
--- a/sd/source/filter/ppt/pptin.hxx
+++ b/sd/source/filter/ppt/pptin.hxx
@@ -63,7 +63,7 @@ class ImplSdPPTImport : public SdrPowerPointImport
void FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiveInfoAtom const * pIAtom, const OUString& aMacroName );
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, ::tools::Rectangle& rTextRect, SdrObject* pObj ) override;
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, SvxMSDffClientData& rClientData, ::tools::Rectangle& rTextRect, SdrObject* pObj ) override;
virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pText, SdPageCapsule pPage,
SfxStyleSheet*, SfxStyleSheet** ) const override;
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 2998c26f93f3..56de45b67cdc 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -561,7 +561,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj,
tools::Rectangle aClientRect( 0,0, aPD.nWidth, aPD.nHeight);
SvxMSDffImportData aData( aClientRect );
- pObject = m_xMSDffManager->ImportObj(*m_pDataStream, &aData, aClientRect, tools::Rectangle(), /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ pObject = m_xMSDffManager->ImportObj(*m_pDataStream, aData, aClientRect, tools::Rectangle(), /*nCalledByGroup*/0, /*pShapeId*/nullptr );
if (pObject)
{
// for the frame
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 236b4a578443..0f2206c711b1 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -557,14 +557,14 @@ void SwWW8ImplReader::SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
DffObjData& rObjData,
- void* pData,
+ SvxMSDffClientData& rData,
tools::Rectangle& rTextRect,
SdrObject* pObj
)
{
if( !rTextRect.IsEmpty() )
{
- SvxMSDffImportData& rImportData = *static_cast<SvxMSDffImportData*>(pData);
+ SvxMSDffImportData& rImportData = static_cast<SvxMSDffImportData&>(rData);
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
// fill Import Record with data
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index a3f8bb6a5745..6ef295050919 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -766,7 +766,7 @@ public:
void DisableFallbackStream();
void EnableFallbackStream();
protected:
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, tools::Rectangle& rTextRect, SdrObject* pObj ) override;
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rObjData, SvxMSDffClientData& rData, tools::Rectangle& rTextRect, SdrObject* pObj ) override;
};
class wwSection
More information about the Libreoffice-commits
mailing list