writerfilter07: OOXMLFastContexHandlerShape: Only call endShape when startShape has been called

This commit is contained in:
Henning Brinkmann[hbrinkm] 2010-01-06 17:02:47 +01:00
parent 657b0466be
commit 884ebc79f3
2 changed files with 7 additions and 2 deletions

View file

@ -2027,7 +2027,8 @@ void SAL_CALL ShapesNoAdd::remove(const uno::Reference< drawing::XShape > & xSha
OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape
(OOXMLFastContextHandler * pContext)
: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false )
: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false ),
m_bShapeStarted(false)
{
uno::Reference<uno::XComponentContext> xContext(getComponentContext());
if (xContext.is())
@ -2119,7 +2120,10 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
// Notify the dmapper that the shape is ready to use
if ( !bIsPicture )
{
mpStream->startShape( xShape );
m_bShapeStarted = true;
}
}
}
}
@ -2138,7 +2142,7 @@ void OOXMLFastContextHandlerShape::lcl_endFastElement
// Ending the shape should be the last thing to do
bool bIsPicture = Element == ( NS_picture | OOXML_pic );
if ( !bIsPicture )
if ( !bIsPicture && m_bShapeStarted)
mpStream->endShape( );
}

View file

@ -517,6 +517,7 @@ class OOXMLFastContextHandlerShape: public OOXMLFastContextHandlerProperties
{
private:
bool m_bShapeSent;
bool m_bShapeStarted;
public:
explicit OOXMLFastContextHandlerShape