diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-25 09:25:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-25 09:26:14 +0100 |
commit | 306159d8ff9ef91cf8d4c92198157b7fad46211e (patch) | |
tree | 4deb90cae6be5a8b2539b8a72d919fb3e05457ab /filter | |
parent | WaE: return value of fwrite unchecked (diff) | |
download | core-306159d8ff9ef91cf8d4c92198157b7fad46211e.tar.gz core-306159d8ff9ef91cf8d4c92198157b7fad46211e.zip |
convert mpFidcls to a vector
Change-Id: I41d24c8d14a781e4100813ebce136d563f8c36b8
Diffstat (limited to 'filter')
-rw-r--r-- | filter/inc/filter/msfilter/msdffimp.hxx | 2 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 19 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 4 |
3 files changed, 8 insertions, 17 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx index 3366a9c88431..ad2e55ae8c7c 100644 --- a/filter/inc/filter/msfilter/msdffimp.hxx +++ b/filter/inc/filter/msfilter/msdffimp.hxx @@ -478,7 +478,7 @@ typedef std::map<sal_uInt32, sal_uInt32> OffsetMap; sal_uInt32 mnCurMaxShapeId; // we need this information to sal_uInt32 mnDrawingsSaved; // access the right drawing sal_uInt32 mnIdClusters; // while only knowing the shapeid - FIDCL* mpFidcls; + std::vector<FIDCL> maFidcls; OffsetMap maDgOffsetTable; // array of fileoffsets friend class DffPropertyReader; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index c4a6bca55771..4c105308c828 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3316,13 +3316,13 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale) sal_Bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_uInt32 nId ) const { sal_Bool bRet = sal_False; - if ( mpFidcls ) + if ( !maFidcls.empty() ) { sal_uInt32 nMerk = rSt.Tell(); sal_uInt32 nShapeId, nSec = ( nId >> 10 ) - 1; if ( nSec < mnIdClusters ) { - OffsetMap::const_iterator it = maDgOffsetTable.find( mpFidcls[ nSec ].dgid ); + OffsetMap::const_iterator it = maDgOffsetTable.find( maFidcls[ nSec ].dgid ); if ( it != maDgOffsetTable.end() ) { sal_IntPtr nOfs = it->second; @@ -5747,7 +5747,6 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, nGroupShapeFlags(0), //ensure initialization here, as some corrupted //files may yield to this being unitialized maBaseURL( rBaseURL ), - mpFidcls( NULL ), rStCtrl( rStCtrl_ ), pStData( pStData_ ), pStData2( pStData2_ ), @@ -5792,7 +5791,6 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const String& rBaseURL ) nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen, nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt maBaseURL( rBaseURL ), - mpFidcls( NULL ), rStCtrl( rStCtrl_ ), pStData( 0 ), pStData2( 0 ), @@ -5810,7 +5808,6 @@ SvxMSDffManager::~SvxMSDffManager() delete pShapeInfos; delete pShapeOrders; delete pFormModel; - delete[] mpFidcls; } void SvxMSDffManager::InitSvxMSDffManager( sal_uInt32 nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags ) @@ -5884,17 +5881,11 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) "escher", "FIDCL list longer than remaining bytes, ppt or parser is wrong"); mnIdClusters = std::min(nMaxEntriesPossible, static_cast<sal_Size>(mnIdClusters)); - sal_Size nMaxEntriesAllocatable = SAL_MAX_UINT32 / sizeof(FIDCL); - SAL_WARN_IF(nMaxEntriesAllocatable < mnIdClusters, - "escher", "FIDCL list longer than can be allocated"); - mnIdClusters = std::min(nMaxEntriesAllocatable, static_cast<sal_Size>(mnIdClusters)); - - mpFidcls = new FIDCL[ mnIdClusters ]; - memset(mpFidcls, 0, mnIdClusters * sizeof(FIDCL)); + maFidcls.resize(mnIdClusters); for (sal_uInt32 i = 0; i < mnIdClusters; ++i) { - rStCtrl >> mpFidcls[ i ].dgid - >> mpFidcls[ i ].cspidCur; + rStCtrl >> maFidcls[ i ].dgid + >> maFidcls[ i ].cspidCur; } } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 8e24fcf489c9..dfe44003ab08 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1250,8 +1250,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi if ( rPersistEntry.nDrawingDgId != 0xffffffff ) { sal_uInt32 nSec = ( rObjData.nShapeId >> 10 ) - 1; - if ( mpFidcls && ( nSec < mnIdClusters ) ) - mpFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // insert the correct drawing id; + if ( !maFidcls.empty() && ( nSec < mnIdClusters ) ) + maFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // insert the correct drawing id; } } if ( GetPropertyValue( DFF_Prop_fNoFillHitTest ) & 0x10 ) |