[Libreoffice-commits] core.git: filter/source include/filter sd/source
Stephan Bergmann
sbergman at redhat.com
Fri Dec 5 07:09:35 PST 2014
filter/source/msfilter/svdfppt.cxx | 10 +++++-----
include/filter/msfilter/svdfppt.hxx | 18 +++++++++++++-----
sd/source/filter/ppt/pptin.cxx | 14 ++++++++------
sd/source/filter/ppt/pptin.hxx | 2 +-
4 files changed, 27 insertions(+), 17 deletions(-)
New commits:
commit e9a3d259c71ceddb88c92a0c17dfe3d8d03fb5a4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Dec 5 16:08:25 2014 +0100
loplugin:cstylecast, involving pointer to incomplete type
Change-Id: If8d2be68a75e69226f2a5a1d2936a257fa032c23
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 6a80926..0400f5b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -576,7 +576,7 @@ PptFontEntityAtom* SdrEscherImport::GetFontEnityAtom( sal_uInt32 nNum ) const
return pRetValue;
}
-SdrObject* SdrEscherImport::ReadObjText( PPTTextObj* /*pTextObj*/, SdrObject* pObj, SdPage* /*pPage*/) const
+SdrObject* SdrEscherImport::ReadObjText( PPTTextObj* /*pTextObj*/, SdrObject* pObj, SdPageCapsule /*pPage*/) const
{
return pObj;
}
@@ -1211,7 +1211,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
if ( rObjData.nSpFlags & SP_FBACKGROUND )
{
- pRet->NbcSetSnapRect( Rectangle( Point(), ((SdrPage*)rData.pPage)->GetSize() ) ); // set size
+ pRet->NbcSetSnapRect( Rectangle( Point(), rData.pPage.page->GetSize() ) ); // set size
}
if ( rPersistEntry.pSolverContainer )
{
@@ -2176,7 +2176,7 @@ SdrOutliner* SdrPowerPointImport::GetDrawOutliner( SdrTextObj* pSdrText ) const
}
-SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pSdrObj, SdPage* pPage ) const
+SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pSdrObj, SdPageCapsule pPage ) const
{
SdrTextObj* pText = PTR_CAST( SdrTextObj, pSdrObj );
if ( pText )
@@ -2188,7 +2188,7 @@ SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pS
}
-SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pSdrText, SdPage* /*pPage*/,
+SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pSdrText, SdPageCapsule /*pPage*/,
SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const
{
SdrTextObj* pText = pSdrText;
@@ -2706,7 +2706,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( SeekToAktPage( &aPageHd ) )
{
rSlidePersist.pHeaderFooterEntry = new HeaderFooterEntry( pMasterPersist );
- ProcessData aProcessData( rSlidePersist, (SdPage*)pRet );
+ ProcessData aProcessData( rSlidePersist, SdPageCapsule(pRet) );
while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
{
DffRecordHeader aHd;
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
index 6bbe818..c7a1912 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -404,6 +404,14 @@ public:
friend SvStream& ReadPptExOleObjAtom( SvStream& rIn, PptExOleObjAtom& rAtom );
};
+// SdPage derives from SdrPage, is only known inside sd, and needs to be carried
+// around as an opaque pointer here:
+struct SdPageCapsule {
+ explicit SdPageCapsule(SdrPage * thePage): page(thePage) {}
+
+ SdrPage * page;
+};
+
typedef ::std::vector< PPTOleEntry* > PPTOleEntryList;
class PPTExtParaProv;
class MSFILTER_DLLPUBLIC SdrEscherImport : public SvxMSDffManager
@@ -449,7 +457,7 @@ public:
virtual bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const SAL_OVERRIDE;
PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
- virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPageCapsule pPage ) const;
virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj ) SAL_OVERRIDE;
virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj ) SAL_OVERRIDE;
void ImportHeaderFooterContainer( DffRecordHeader& rHeader, HeaderFooterEntry& rEntry );
@@ -506,11 +514,11 @@ struct MSFILTER_DLLPUBLIC HeaderFooterEntry
struct ProcessData
{
PptSlidePersistEntry& rPersistEntry;
- SdPage* pPage;
+ SdPageCapsule pPage;
::std::vector< SdrObject* > aBackgroundColoredObjects;
sal_uInt32* pTableRowProperties;
- ProcessData( PptSlidePersistEntry& rP, SdPage* pP ) :
+ ProcessData( PptSlidePersistEntry& rP, SdPageCapsule pP ) :
rPersistEntry ( rP ),
pPage ( pP ),
pTableRowProperties ( NULL ) {};
@@ -565,11 +573,11 @@ protected:
virtual SdrObject* ApplyTextObj(
PPTTextObj* pTextObj,
SdrTextObj* pText,
- SdPage* pPage,
+ SdPageCapsule pPage,
SfxStyleSheet*,
SfxStyleSheet** )
const;
- virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const SAL_OVERRIDE;
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPageCapsule pPage ) const SAL_OVERRIDE;
// #i32596# - new parameter <_nCalledByGroup>, which
// indicates, if the OLE object is imported inside a group object.
virtual SdrObject* ImportOLE(
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 731fb65..099a88f 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -737,7 +737,7 @@ bool ImplSdPPTImport::Import()
pMPage->NbcInsertObject( pObj );
bool bNewAnimationsUsed = false;
- ProcessData aProcessData( (*pList)[ nAktPageNum ], (SdPage*)pMPage );
+ ProcessData aProcessData( (*pList)[ nAktPageNum ], SdPageCapsule(pMPage) );
sal_uInt32 nFPosMerk = rStCtrl.Tell();
DffRecordHeader aPageHd;
if ( SeekToAktPage( &aPageHd ) )
@@ -1394,7 +1394,7 @@ void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlide
Rectangle aEmpty;
bVisible = false;
rStCtrl.Seek( nPosition );
- ProcessData aProcessData( rSlidePersist, (SdPage*)pPage );
+ ProcessData aProcessData( rSlidePersist, SdPageCapsule(pPage) );
SdrObject* pObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
if ( pObj )
pPage->NbcInsertObject( pObj, 0 );
@@ -2104,9 +2104,10 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv
}
}
-SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj, SdPage* pPage,
+SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj, SdPageCapsule pPageCapsule,
SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const
{
+ SdPage * pPage = static_cast<SdPage *>(pPageCapsule.page);
SfxStyleSheet* pStyleSheetAry[ 9 ];
SdrTextObj* pText = pObj;
SdrObject* pRet = pText;
@@ -2227,7 +2228,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
}
break;
}
- pText = static_cast<SdrTextObj*>(SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPage, pSheet, ppStyleSheetAry ));
+ pText = static_cast<SdrTextObj*>(SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPageCapsule, pSheet, ppStyleSheetAry ));
if ( pPlaceHolder && pPlaceHolder->nPlaceholderId )
{
if ( eAktPageKind == PPT_MASTERPAGE )
@@ -2517,8 +2518,9 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if( pObj->ISA(SdrPageObj) && pData )
{
const ProcessData* pProcessData=(const ProcessData*)pData;
- if( pProcessData->pPage )
- pProcessData->pPage->InsertPresObj( pObj, PRESOBJ_PAGE );
+ if( pProcessData->pPage.page )
+ static_cast<SdPage *>(pProcessData->pPage.page)->InsertPresObj(
+ pObj, PRESOBJ_PAGE );
}
bool bInhabitanceChecked = false;
diff --git a/sd/source/filter/ppt/pptin.hxx b/sd/source/filter/ppt/pptin.hxx
index 49c7e64..d9c0382 100644
--- a/sd/source/filter/ppt/pptin.hxx
+++ b/sd/source/filter/ppt/pptin.hxx
@@ -66,7 +66,7 @@ class ImplSdPPTImport : public SdrPowerPointImport
void FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiveInfoAtom* pIAtom, const OUString& aMacroName );
virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj ) SAL_OVERRIDE;
- virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pText, SdPage* pPage,
+ virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pText, SdPageCapsule pPage,
SfxStyleSheet*, SfxStyleSheet** ) const SAL_OVERRIDE;
public:
More information about the Libreoffice-commits
mailing list