sw: fix fallback for OLE object output.
OLE objects could be written as graphics as a fallback for unsupported formats, but it happened in a wrong position of the document (inside w:rPr). Added two extra fields to the PostponedGraphic structure to be able to postpone the writing of OLE graphics. Change-Id: If36a0aed11bcac2115ef0322cc83efccd6ef1204
This commit is contained in:
@@ -1231,7 +1231,7 @@ void DocxAttributeOutput::WritePostponedGraphic()
|
|||||||
for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin();
|
for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin();
|
||||||
it != m_postponedGraphic->end();
|
it != m_postponedGraphic->end();
|
||||||
++it )
|
++it )
|
||||||
FlyFrameGraphic( it->grfNode, it->size, 0, 0, it->pSdrObj );
|
FlyFrameGraphic( it->grfNode, it->size, it->mOLEFrmFmt, it->mOLENode, it->pSdrObj );
|
||||||
delete m_postponedGraphic;
|
delete m_postponedGraphic;
|
||||||
m_postponedGraphic = NULL;
|
m_postponedGraphic = NULL;
|
||||||
}
|
}
|
||||||
@@ -3091,7 +3091,11 @@ void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rOL
|
|||||||
if( WriteOLEMath( pSdrObj, rOLENode, rSize ))
|
if( WriteOLEMath( pSdrObj, rOLENode, rSize ))
|
||||||
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.
|
||||||
FlyFrameGraphic( 0, rSize, pFlyFrmFmt, &rOLENode );
|
if( m_postponedGraphic == NULL )
|
||||||
|
FlyFrameGraphic( 0, rSize, pFlyFrmFmt, &rOLENode );
|
||||||
|
else
|
||||||
|
// w:drawing should not be inside w:rPr, so write it out later
|
||||||
|
m_postponedGraphic->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 )
|
||||||
@@ -3272,7 +3276,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
|
|||||||
FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj);
|
FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj);
|
||||||
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_postponedGraphic->push_back( PostponedGraphic( pGrfNode, rFrame.GetLayoutSize(), pSdrObj));
|
m_postponedGraphic->push_back( PostponedGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -752,9 +752,13 @@ private:
|
|||||||
|
|
||||||
struct PostponedGraphic
|
struct PostponedGraphic
|
||||||
{
|
{
|
||||||
PostponedGraphic( const SwGrfNode* n, Size s, const SdrObject* sObj ) : grfNode( n ), size( s ), pSdrObj(sObj) {};
|
PostponedGraphic( const SwGrfNode* n, Size s, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode, const SdrObject* sObj )
|
||||||
|
: grfNode( n ), size( s ), mOLEFrmFmt( pOLEFrmFmt ), mOLENode( pOLENode ), pSdrObj(sObj) {};
|
||||||
|
|
||||||
const SwGrfNode* grfNode;
|
const SwGrfNode* grfNode;
|
||||||
Size size;
|
Size size;
|
||||||
|
const SwFlyFrmFmt* mOLEFrmFmt;
|
||||||
|
SwOLENode* mOLENode;
|
||||||
const SdrObject* pSdrObj;
|
const SdrObject* pSdrObj;
|
||||||
};
|
};
|
||||||
std::list< PostponedGraphic >* m_postponedGraphic;
|
std::list< PostponedGraphic >* m_postponedGraphic;
|
||||||
|
Reference in New Issue
Block a user