summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-04-22 09:48:36 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-22 09:53:39 +0200
commit9406ab47a92386d676038e467e555c3c80b46f62 (patch)
treef727f575b6de0684b14ca610ae662d9d1a0bc3c8
parent1ba8a901c4e6f70c109f29ab715715eac159ab1a (diff)
DocxAttributeOutput::m_postponedDMLDrawing: use std::unique_ptr<>
Change-Id: I0125467bad9be48ce8daa1fda32c731d8ee96b40
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx19
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
2 files changed, 9 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a88a5b2d28f6..c9cd83db9839 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1639,8 +1639,8 @@ void DocxAttributeOutput::StartRunProperties()
OSL_ASSERT( !m_pPostponedVMLDrawings );
m_pPostponedVMLDrawings.reset(new std::list<PostponedDrawing>());
- assert(!m_postponedDMLDrawing);
- m_postponedDMLDrawing = new std::list< PostponedDrawing >;
+ assert(!m_pPostponedDMLDrawings);
+ m_pPostponedDMLDrawings.reset(new std::list<PostponedDrawing>());
assert( !m_pPostponedOLEs );
m_pPostponedOLEs.reset(new std::list<PostponedOLE>());
@@ -4785,17 +4785,16 @@ void DocxAttributeOutput::WritePostponedCustomShape()
void DocxAttributeOutput::WritePostponedDMLDrawing()
{
- if(m_postponedDMLDrawing == NULL)
+ if (!m_pPostponedDMLDrawings)
return;
// Clear the list early, this method may be called recursively.
- std::list<PostponedDrawing>* postponedDMLDrawing = m_postponedDMLDrawing;
- m_postponedDMLDrawing = NULL;
+ std::unique_ptr< std::list<PostponedDrawing> > pPostponedDMLDrawings(m_pPostponedDMLDrawings.release());
std::unique_ptr< std::list<PostponedOLE> > pPostponedOLEs(m_pPostponedOLEs.release());
bool bStartedParaSdt = m_bStartedParaSdt;
- for( std::list< PostponedDrawing >::iterator it = postponedDMLDrawing->begin();
- it != postponedDMLDrawing->end();
+ for( std::list< PostponedDrawing >::iterator it = pPostponedDMLDrawings->begin();
+ it != pPostponedDMLDrawings->end();
++it )
{
// Avoid w:drawing within another w:drawing.
@@ -4806,7 +4805,6 @@ void DocxAttributeOutput::WritePostponedDMLDrawing()
}
m_bStartedParaSdt = bStartedParaSdt;
- delete postponedDMLDrawing;
m_pPostponedOLEs.reset(pPostponedOLEs.release());
}
@@ -4856,7 +4854,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
}
else
{
- if ( m_postponedDMLDrawing == NULL )
+ if (!m_pPostponedDMLDrawings)
{
bool bStartedParaSdt = m_bStartedParaSdt;
if ( IsAlternateContentChoiceOpen() )
@@ -4881,7 +4879,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
{
// we are writing out attributes, but w:drawing should not be inside w:rPr, so write it out later
m_bPostponedProcessingFly = true ;
- m_postponedDMLDrawing->push_back(PostponedDrawing(pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft));
+ m_pPostponedDMLDrawings->push_back(PostponedDrawing(pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft));
}
}
}
@@ -8323,7 +8321,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_startedHyperlink( false ),
m_nHyperLinkCount(0),
m_nFieldsInHyperlink( 0 ),
- m_postponedDMLDrawing(NULL),
m_postponedChart( NULL ),
pendingPlaceholder( NULL ),
m_postitFieldsMaxId( 0 ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 70f5cc37fe90..7ec178477215 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -848,7 +848,7 @@ private:
const Point* point;
};
std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedVMLDrawings;
- std::list< PostponedDrawing >* m_postponedDMLDrawing;
+ std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedDMLDrawings;
std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedCustomShape;
struct PostponedOLE