From 36ddb44e08c4d1c1a474149891e6887a2c12f5a6 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 5 Jul 2011 23:42:18 +0200 Subject: [PATCH] so far a customshape is always enough --- .../source/rtftok/rtfdocumentimpl.cxx | 43 ++++--------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 8f5a2f8dd5af..46ea5a82c757 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2420,6 +2420,11 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair xShape; + xShape.set(m_xModelFactory->createInstance(aService), uno::UNO_QUERY); + for (std::vector< std::pair >::iterator i = rShapeProperties.begin(); i != rShapeProperties.end(); ++i) { if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("shapeType"))) @@ -2455,40 +2460,10 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair mso_sptMin && nType < mso_sptMax) - { - aService = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")); - bCustomShape = true; - } - else - { - OSL_TRACE("%s: TODO handle shape type '%d'", OSL_THIS_FUNC, nType); - return; - } - break; - } - - uno::Reference xShape; - xShape.set(m_xModelFactory->createInstance(aService), uno::UNO_QUERY); - - if (bCustomShape) - { - // createCustomShapeDefaults() will crash without adding the shape to the draw page. - m_xDrawPage->add(xShape); - uno::Reference xDefaulter(xShape, uno::UNO_QUERY); - xDefaulter->createCustomShapeDefaults(OUString::valueOf(sal_Int32(nType))); - } + // createCustomShapeDefaults() needs shape added to a draw page. + m_xDrawPage->add(xShape); + uno::Reference xDefaulter(xShape, uno::UNO_QUERY); + xDefaulter->createCustomShapeDefaults(OUString::valueOf(sal_Int32(nType))); xShape->setPosition(awt::Point(m_aStates.top().aShape.nLeft, m_aStates.top().aShape.nTop)); xShape->setSize(awt::Size(m_aStates.top().aShape.nRight - m_aStates.top().aShape.nLeft,