summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-10-28 15:24:51 +0000
committerTamás Zolnai <tamas.zolnai@collabora.com>2016-10-28 14:10:41 +0000
commitb927c1f4b334f80d2c2965e5b7327d6b6a685105 (patch)
tree81c858f4a49ac09608294088bb2ecab77b93be5a /sw/qa
parent8a22bc93e0988188a87c0a787a9b32a7f74da84d (diff)
tdf#103544: DOCX exp.: Image loss when have a frame anchored to the same para.
Regression from: 83d51e5e52688c4c9bc0ad70a511458bb06a242d Partly revert the commit causes this regression. I checked the related bugs (tdf#78590,tdf#80748) intended to be fixed by this commit and reverting this part does not bring back the corruption. I guess something changed in frames' and text boxes' import in the meantime, because this MergeMarks::IGNORE is useless now. Change-Id: If17776e8628561961c7ce2a2994e3fc609f75639 Reviewed-on: https://gerrit.libreoffice.org/30351 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf103544.docxbin0 -> 15012 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx15
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx4
3 files changed, 17 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103544.docx b/sw/qa/extras/ooxmlexport/data/tdf103544.docx
new file mode 100644
index 000000000000..2e18f21213ea
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf103544.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 7800cd37fab4..5ee0ff47884f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -17,6 +17,7 @@
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
class Test : public SwModelTestBase
{
@@ -68,6 +69,20 @@ DECLARE_OOXMLEXPORT_TEST(testTdf84678, "tdf84678.docx")
// This was 0, left margin inside a shape+text wasn't imported from DOCX.
// 360000 EMU, but layout uses twips.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(567), parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds", "left").toInt32());
+
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf103544, "tdf103544.docx")
+{
+ // We have two shapes: a frame and an image
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xDrawPage->getCount());
+
+ // Image was lost because of the frame export
+ uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY);
+ auto xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic");
+ CPPUNIT_ASSERT(xGraphic.is());
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 39a227423d45..fa5f9dfc19b1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -498,8 +498,8 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78590, "FDO78590.docx")
return;
// This is to ensure that the fld starts and ends inside a hyperlink...
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "w", "9851" );
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", "1669" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "w", "9851" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "h", "1669" );
}
DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx")