diff options
author | Vinaya Mandke <vinaya.mandke@synerzip.com> | 2014-07-08 15:32:29 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-15 11:52:58 +0200 |
commit | 0d5b053436eebac00948e95d64a87e150d195c07 (patch) | |
tree | c0c6a514c0121e65cf6e7894f25c99a630613dde /sw | |
parent | 51add78184c7c5facdf98e7edf52c023522c3525 (diff) |
DOCX FILEOPEN VML Shape (image) is lost on import fdo#81031
ShapeContextHandler::getDrawingShapeContext mxDrawingShapeContext is set once and never reset.
So in a file which has numPicBullets and vml shapes in document.xml there is a problem.
First the fragment path is set as word/numbering.xml.
But when msRelationFragmentPath changes to word/document.xml,
mxDrawingShapeContext is not reset and hence the relationships are not resolved.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/10180
Change-Id: I4a1401103797972731257145430f2048b94a04bc
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo81031.docx | bin | 0 -> 25264 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
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: */ |