diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-07-12 13:41:19 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-12 14:12:32 +0200 |
commit | 8edb5996089a24c6eb0509a7ee4d108a23203752 (patch) | |
tree | df6c8507a01f1795ff2ec4498bfd8141d05b1e2d /sw | |
parent | c98829262fdfcd86e8e8c233319ece566af0b9c0 (diff) |
fix previous STL conversion commit:
the MSDffImportRecords now leaks memory, so use a boost::ptr_set
instead, that also doesn't seem to need a special comparator class.
Change-Id: I52935205a57cfb03f439d83401b80b1bf69ede47
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 21 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf2.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 4 |
4 files changed, 17 insertions, 15 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 48cf3f294d97..60c3357696b3 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2016,7 +2016,8 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord, } } -void SwWW8ImplReader::SetAttributesAtGrfNode( SvxMSDffImportRec* pRecord, +void +SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord, SwFrmFmt *pFlyFmt, WW8_FSPA *pF ) { const SwNodeIndex* pIdx = pFlyFmt->GetCntnt(false).GetCntntIdx(); @@ -2560,13 +2561,14 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) Get the record for top level object, so we can get the word anchoring and wrapping information for it. */ - for (MSDffImportRecords::const_iterator it = aData.begin(); it != aData.end(); ++it ) + for (MSDffImportRecords::iterator it = aData.begin(); + it != aData.end(); ++it) { - pRecord = *it; - if (pRecord && pRecord->pObj == pObject) + if (it->pObj == pObject) + { + pRecord = &*it; break; - else - pRecord = 0; + } } OSL_ENSURE(pRecord, "how did that happen?"); @@ -2661,10 +2663,11 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) */ if (!aData.empty()) { - for (MSDffImportRecords::const_iterator it = aData.begin(); it != aData.end(); ++it) + for (MSDffImportRecords::iterator it = aData.begin(); + it != aData.end(); ++it) { - pRecord = *it; - if (pRecord && pRecord->pObj && pRecord->aTextId.nTxBxS) + pRecord = &*it; + if (pRecord->pObj && pRecord->aTextId.nTxBxS) { // #i52825# pRetFrmFmt can be NULL pRetFrmFmt = MungeTextIntoDrawBox(pRecord->pObj, pRecord, nGrafAnchorCp, pRetFrmFmt); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index d4565a4343e6..0bafbd21cdc7 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -562,7 +562,8 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, SfxItemSet aAttrSet( rDoc.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - SvxMSDffImportRec *pRecord = (1 == aData.size()) ? *aData.begin() : 0; + SvxMSDffImportRec const*const pRecord = (1 == aData.size()) + ? &*aData.begin() : 0; if( pRecord ) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7e9de09b9599..ee8219c65b4e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3680,10 +3680,8 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, SdrObject* pObject = 0; if (mrReader.pMSDffManager->GetShape(0x401, pObject, aData)) { - SvxMSDffImportRec * pRec = *aData.begin(); - // Only handle shape if it is a background shape - if ((pRec->nFlags & 0x400) != 0) + if ((aData.begin()->nFlags & 0x400) != 0) { SfxItemSet aSet(rFmt.GetAttrSet()); mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple, diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index e2cc68053ebb..dde6d15ece1c 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1322,8 +1322,8 @@ private: SvxULSpaceItem &rUL); void MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord, SwFrmFmt* pFlyFmt); - void SetAttributesAtGrfNode( SvxMSDffImportRec* pRecord, SwFrmFmt *pFlyFmt, - WW8_FSPA *pF ); + void SetAttributesAtGrfNode(SvxMSDffImportRec const* pRecord, + SwFrmFmt *pFlyFmt, WW8_FSPA *pF); bool IsDropCap(); bool IsListOrDropcap() { return (!pAktItemSet || bDropCap); }; |