diff options
-rw-r--r-- | oox/source/shape/ShapeContextHandler.cxx | 14 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo81031.docx | bin | 0 -> 25264 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 |
3 files changed, 29 insertions, 1 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 53a692774e19..4ed6298e36fa 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -205,7 +205,19 @@ ShapeContextHandler::getDrawingShapeContext() (new oox::vml::DrawingFragment ( *mxFilterBase, msRelationFragmentPath, *mpDrawing ))); } - + else + { + // Reset the handler if fragment path has changed + OUString sHandlerFragmentPath = dynamic_cast<ContextHandler *>(mxDrawingFragmentHandler.get())->getFragmentPath(); + if ( !msRelationFragmentPath.equals(sHandlerFragmentPath) ) + { + mxDrawingFragmentHandler.clear(); + mxDrawingFragmentHandler.set + (dynamic_cast<ContextHandler *> + (new oox::vml::DrawingFragment + ( *mxFilterBase, msRelationFragmentPath, *mpDrawing ))); + } + } return mxDrawingFragmentHandler; } diff --git a/sw/qa/extras/ooxmlexport/data/fdo81031.docx b/sw/qa/extras/ooxmlexport/data/fdo81031.docx Binary files differnew file mode 100644 index 000000000000..d80111dec584 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81031.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 0c530fba0b2b..7dd37a2d04d9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -9,6 +9,8 @@ #include <swmodeltestbase.hxx> +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/LineJoint.hpp> @@ -3783,6 +3785,20 @@ DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); } +DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx") +{ + // vml image was not rendered + // As there are also numPicBullets in the file, + // the fragmentPath was not changed hence relationships were not resolved. + + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> xImage(image, uno::UNO_QUERY); + uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic"); + uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(381), xBitmap->getSize().Width ); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(148), xBitmap->getSize().Height ); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |