diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 048a547169b9..b24985e3ebf1 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2849,9 +2849,6 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags ); } - if ( !pOleMap) - pOleMap = new WW8OleMaps; - if ( !pOCXExp && pDoc->GetDocShell() ) pOCXExp = new SwMSConvertControls( pDoc->GetDocShell(), pCurPam ); @@ -3266,7 +3263,7 @@ sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed, MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ) : aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0), - pBmpPal(0), pOLEExp(0), pOCXExp(0), pOleMap(0), + pBmpPal(0), pOLEExp(0), pOCXExp(0), mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0), mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0), pStyles( NULL ), @@ -3284,7 +3281,6 @@ MSWordExportBase::~MSWordExportBase() delete pBmpPal; delete pOLEExp; delete pOCXExp; - delete pOleMap; } WW8Export::WW8Export( SwWW8Writer *pWriter, diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index a1827bf41264..f466fcc8874c 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -117,7 +117,7 @@ class WW8_WrtBookmarks; class WW8_WrtRedlineAuthor; class SvxMSExportOLEObjects; class SwMSConvertControls; -class WW8OleMaps; +typedef std::set WW8OleSet; class SvStorageRef; struct WW8_PdAttrDesc; class SvxBrushItem; @@ -461,7 +461,7 @@ public: boost::shared_ptr pKeyMap; SvxMSExportOLEObjects* pOLEExp; SwMSConvertControls* pOCXExp; - WW8OleMaps* pOleMap; + WW8OleSet m_aOleSet; // To remember all already exported ole objects ww8::WW8TableInfo::Pointer_t mpTableInfo; sal_uInt16 nCharFmtStart; @@ -968,7 +968,7 @@ public: SvxMSExportOLEObjects& GetOLEExp() { return *pOLEExp; } SwMSConvertControls& GetOCXExp() { return *pOCXExp; } - WW8OleMaps& GetOLEMap() { return *pOleMap; } + WW8OleSet& GetOLESet() { return m_aOleSet; } void ExportDopTypography(WW8DopTypography &rTypo); sal_uInt16 AddRedlineAuthor( sal_uInt16 nId ); diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 6524abc348d0..f8614f9b2675 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -241,22 +241,11 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) uno::Reference < embed::XEmbeddedObject > xObj(const_cast(rOLENode).GetOLEObj().GetOleRef()); if( xObj.is() ) { - embed::XEmbeddedObject *pObj = xObj.get(); + const embed::XEmbeddedObject *pObj = xObj.get(); sal_uInt32 nPictureId = (sal_uInt32)(sal_uIntPtr)pObj; + //.second is false when element already existed + bool bIsNotDuplicate = GetOLESet().insert(nPictureId).second; Set_UInt32(pDataAdr, nPictureId); - - WW8OleMap *pMap = new WW8OleMap(nPictureId); - bool bDuplicate = false; - WW8OleMaps &rOleMap = GetOLEMap(); - sal_uInt16 nPos; - if ( rOleMap.Seek_Entry(pMap, &nPos) ) - { - bDuplicate = true; - delete pMap; - } - else if( 0 == rOleMap.Insert( pMap) ) - delete pMap; - String sStorageName( '_' ); sStorageName += String::CreateFromInt32( nPictureId ); SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName, @@ -267,7 +256,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) If this object storage has been written already don't waste time rewriting it */ - if (!bDuplicate) + if (bIsNotDuplicate) { sal_Int64 nAspect = rOLENode.GetAspect(); svt::EmbeddedObjectRef aObjRef( xObj, nAspect ); diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index a19b50ca036b..0c7001c8568a 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -143,12 +143,7 @@ namespace com{namespace sun {namespace star{ struct WW8LFOInfo; typedef WW8LFOInfo* WW8LFOInfo_Ptr; -// Redlining: match WinWord author ids to StarWriter author ids -struct WW8OleMap; -typedef WW8OleMap* WW8OleMap_Ptr; - SV_DECL_PTRARR_DEL(WW8LFOInfos,WW8LFOInfo_Ptr,16) -SV_DECL_PTRARR_SORT_DEL(WW8OleMaps, WW8OleMap_Ptr,16) class WW8Reader : public StgReader { @@ -161,28 +156,6 @@ public: virtual sal_Bool ReadGlossaries( SwTextBlocks&, sal_Bool bSaveRelFiles ) const; }; -struct WW8OleMap -{ - sal_uInt32 mnWWid; - String msStorageName; - - WW8OleMap(sal_uInt32 nWWid) - : mnWWid(nWWid) {} - - WW8OleMap(sal_uInt32 nWWid, String sStorageName) - : mnWWid(nWWid), msStorageName(sStorageName) {} - - bool operator==(const WW8OleMap & rEntry) const - { - return (mnWWid == rEntry.mnWWid); - } - bool operator<(const WW8OleMap & rEntry) const - { - return (mnWWid < rEntry.mnWWid); - } -}; - - class SwWW8ImplReader; struct WW8LSTInfo; class WW8ListManager diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 0447a73528e0..6b44d824c560 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -72,8 +72,6 @@ struct OLE_MFP using namespace ::com::sun::star; -SV_IMPL_OP_PTRARR_SORT(WW8OleMaps, WW8OleMap_Ptr) - static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1) { // Skalierungsfaktoren holen: diff --git a/unusedcode.easy b/unusedcode.easy index b80fef4636e0..fbdf2a40e69e 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -371,11 +371,6 @@ WPXPropertyList::Iter::last() WPXPropertyListVector::Iter::last() WPXString::Iter::last() WPXSubDocument::WPXSubDocument() -WW8OleMaps::Insert(WW8OleMap* const&, unsigned short&) -WW8OleMaps::Insert(WW8OleMap* const*, unsigned short) -WW8OleMaps::Insert(WW8OleMaps const*, unsigned short, unsigned short) -WW8OleMaps::Remove(WW8OleMap* const&, unsigned short) -WW8OleMaps::Remove(unsigned short, unsigned short) WinMtfOutput::DrawLine(Point const&, Point const&) WinMtfOutput::GetTextLayoutMode() const WinMtfOutput::SetFont(Font const&)