Kaydet (Commit) 6124ad4c authored tarafından Miklos Vajna's avatar Miklos Vajna

DocxAttributeOutput::m_pPostponedGraphic: use std::unique_ptr<>

Change-Id: I033cc6fce66203ad2967064211f9144b0edf8d1e
üst 4cca0169
...@@ -1596,8 +1596,8 @@ void DocxAttributeOutput::StartRunProperties() ...@@ -1596,8 +1596,8 @@ void DocxAttributeOutput::StartRunProperties()
} }
InitCollectedRunProperties(); InitCollectedRunProperties();
OSL_ASSERT( m_postponedGraphic == NULL ); OSL_ASSERT( !m_pPostponedGraphic );
m_postponedGraphic = new std::list< PostponedGraphic >; m_pPostponedGraphic.reset(new std::list<PostponedGraphic>());
OSL_ASSERT( m_postponedDiagram == NULL ); OSL_ASSERT( m_postponedDiagram == NULL );
m_postponedDiagram = new std::list< PostponedDiagram >; m_postponedDiagram = new std::list< PostponedDiagram >;
...@@ -1962,12 +1962,11 @@ void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) ...@@ -1962,12 +1962,11 @@ void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj)
void DocxAttributeOutput::WritePostponedGraphic() void DocxAttributeOutput::WritePostponedGraphic()
{ {
for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin(); for( std::list< PostponedGraphic >::const_iterator it = m_pPostponedGraphic->begin();
it != m_postponedGraphic->end(); it != m_pPostponedGraphic->end();
++it ) ++it )
FlyFrameGraphic( it->grfNode, it->size, it->mOLEFrmFmt, it->mOLENode, it->pSdrObj ); FlyFrameGraphic( it->grfNode, it->size, it->mOLEFrmFmt, it->mOLENode, it->pSdrObj );
delete m_postponedGraphic; m_pPostponedGraphic.reset(0);
m_postponedGraphic = NULL;
} }
void DocxAttributeOutput::WritePostponedDiagram() void DocxAttributeOutput::WritePostponedDiagram()
...@@ -4211,11 +4210,11 @@ void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rOL ...@@ -4211,11 +4210,11 @@ void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rOL
if( PostponeOLE( pSdrObj, rOLENode, rSize, pFlyFrmFmt )) if( PostponeOLE( pSdrObj, rOLENode, rSize, pFlyFrmFmt ))
return; return;
// Then we fall back to just export the object as a graphic. // Then we fall back to just export the object as a graphic.
if( m_postponedGraphic == NULL ) if( !m_pPostponedGraphic )
FlyFrameGraphic( 0, rSize, pFlyFrmFmt, &rOLENode ); FlyFrameGraphic( 0, rSize, pFlyFrmFmt, &rOLENode );
else else
// w:drawing should not be inside w:rPr, so write it out later // w:drawing should not be inside w:rPr, so write it out later
m_postponedGraphic->push_back( PostponedGraphic( 0, rSize, pFlyFrmFmt, &rOLENode, 0 ) ); m_pPostponedGraphic->push_back(PostponedGraphic(0, rSize, pFlyFrmFmt, &rOLENode, 0));
} }
bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize ) bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize )
...@@ -4786,7 +4785,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po ...@@ -4786,7 +4785,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0; const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0;
if ( pGrfNode ) if ( pGrfNode )
{ {
if( m_postponedGraphic == NULL ) if (!m_pPostponedGraphic)
{ {
m_bPostponedProcessingFly = false ; m_bPostponedProcessingFly = false ;
FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj); FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj);
...@@ -4794,7 +4793,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po ...@@ -4794,7 +4793,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
else // we are writing out attributes, but w:drawing should not be inside w:rPr, else // we are writing out attributes, but w:drawing should not be inside w:rPr,
{ // so write it out later { // so write it out later
m_bPostponedProcessingFly = true ; m_bPostponedProcessingFly = true ;
m_postponedGraphic->push_back( PostponedGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj)); m_pPostponedGraphic->push_back(PostponedGraphic(pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj));
} }
} }
} }
...@@ -8279,7 +8278,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri ...@@ -8279,7 +8278,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_startedHyperlink( false ), m_startedHyperlink( false ),
m_nHyperLinkCount(0), m_nHyperLinkCount(0),
m_nFieldsInHyperlink( 0 ), m_nFieldsInHyperlink( 0 ),
m_postponedGraphic( NULL ),
m_postponedDiagram( NULL ), m_postponedDiagram( NULL ),
m_postponedVMLDrawing(NULL), m_postponedVMLDrawing(NULL),
m_postponedDMLDrawing(NULL), m_postponedDMLDrawing(NULL),
......
...@@ -832,7 +832,7 @@ private: ...@@ -832,7 +832,7 @@ private:
SwOLENode* mOLENode; SwOLENode* mOLENode;
const SdrObject* pSdrObj; const SdrObject* pSdrObj;
}; };
std::list< PostponedGraphic >* m_postponedGraphic; std::unique_ptr< std::list<PostponedGraphic> > m_pPostponedGraphic;
struct PostponedDiagram struct PostponedDiagram
{ {
PostponedDiagram( const SdrObject* o, const SwFrmFmt* frm ) : object( o ), frame( frm ) {}; PostponedDiagram( const SdrObject* o, const SwFrmFmt* frm ) : object( o ), frame( frm ) {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment