summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmlfly.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-06-29 11:39:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-13 20:38:19 +0100
commit72e54b69601dc44932d4a3c9882d24d2380ae3b7 (patch)
treedb36225f46e419198994713a2a9d25bcf1d50833 /sw/source/filter/html/htmlfly.cxx
parenta85f5b1ee0ccf5e1999f5452ce162e251191dd98 (diff)
Resolves: #i120106# implement a SwPosFlyFrms which avoids memory leaks
Use boost::shared_ptr and stl tools to implement a SwPosFlyFrms which can be used and handed over by value and cleans up it's content to avoid memory leaks. Found by: Chao Huang Patch by: Chao Huang, alg Review by: Chao Huang, alg (cherry picked from commit c26f80aa1ba65b63e313dce9c6d7e40ab8efede6) Conflicts: sw/inc/doc.hxx sw/inc/flypos.hxx sw/source/core/doc/doclay.cxx sw/source/core/layout/flypos.cxx sw/source/core/unocore/unoobj2.cxx sw/source/filter/html/htmlfly.cxx sw/source/filter/ww8/writerhelper.cxx Change-Id: If610457654b1056d799d4336cd249815f7878a96 Fix build breaker from i120106 Patch by: Chao Huang Suggested by: alg (cherry picked from commit 880aadbeba4e31049d5b7f0a34323553fb6249fb) Conflicts: sw/source/filter/ww8/writerhelper.cxx Change-Id: I516fcb6ee69944c54cc9eb76c069eb8b28749050
Diffstat (limited to 'sw/source/filter/html/htmlfly.cxx')
-rw-r--r--sw/source/filter/html/htmlfly.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index a5ae153a7e0a..47426ef81804 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -301,12 +301,11 @@ void SwHTMLWriter::CollectFlyFrms()
OSL_ENSURE( HTML_CFG_MAX+1 == MAX_BROWSERS,
"number of browser configurations has changed" );
- SwPosFlyFrms aFlyPos;
- pDoc->GetAllFlyFmts( aFlyPos, bWriteAll ? 0 : pCurPam, true );
+ SwPosFlyFrms aFlyPos(pDoc->GetAllFlyFmts(bWriteAll ? 0 : pCurPam, true));
- for(SwPosFlyFrms::iterator it = aFlyPos.begin(); it != aFlyPos.end(); ++it)
+ for(SwPosFlyFrms::const_iterator aIter(aFlyPos.begin()); aIter != aFlyPos.end(); ++aIter)
{
- const SwFrmFmt& rFrmFmt = (*it)->GetFmt();
+ const SwFrmFmt& rFrmFmt = (*aIter)->GetFmt();
const SdrObject *pSdrObj = 0;
const SwPosition *pAPos;
const SwCntntNode *pACNd;
@@ -356,8 +355,7 @@ void SwHTMLWriter::CollectFlyFrms()
if( !pHTMLPosFlyFrms )
pHTMLPosFlyFrms = new SwHTMLPosFlyFrms;
- SwHTMLPosFlyFrm *pNew =
- new SwHTMLPosFlyFrm( **it, pSdrObj, nMode );
+ SwHTMLPosFlyFrm *pNew = new SwHTMLPosFlyFrm(**aIter, pSdrObj, nMode);
pHTMLPosFlyFrms->insert( pNew );
}
}