summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-29 18:54:53 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-09-29 18:56:29 +0200
commite5bbc721d6bd5536bdd34f33fc79933a379f2919 (patch)
tree1249e1e691f26ae60d67908ea0c2ec154a3e7d28 /sw
parent16dba68cf1eff65b81fbc75d1138604acc8abd08 (diff)
test for mso-position-(horizontal|vertical)(-relative) (bnc#884615)
Change-Id: I692de6c6d3cf2b932ba96cd9978cf56f75b8cb3e
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docxbin0 -> 7751 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx
new file mode 100644
index 000000000000..2fb28ecfb3fd
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fc12ff13c742..207970d65c2e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -337,6 +337,43 @@ DECLARE_OOXMLEXPORT_TEST(testRot270Flipv, "rot270-flipv.docx")
}
}
+DECLARE_OOXMLEXPORT_TEST(testMsoPosition, "bnc884615-mso-position.docx")
+{
+ if(xmlDocPtr doc = parseExport("word/footer1.xml"))
+ {
+ // We write the frames out in different order than they were read, so check it's the correct
+ // textbox first by checking width. These tests may need reordering if that gets fixed.
+ OUString style1 = getXPath(doc, "/w:ftr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style1.indexOf( ";width:531pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
+ CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
+ OUString style2 = getXPath(doc, "/w:ftr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style2.indexOf( ";width:549pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:text" ) >= 0 );
+ CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal:center" ) >= 0 );
+ CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 );
+ OUString style3 = getXPath(doc, "/w:ftr/w:p/w:r[5]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style3.indexOf( ";width:36pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 );
+ CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:text" ) >= 0 );
+ }
+ if(xmlDocPtr doc = parseExport("word/header1.xml"))
+ {
+ OUString style1 = getXPath(doc, "/w:hdr/w:p/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style1.indexOf( ";width:335.75pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
+ CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
+ OUString style2 = getXPath(doc, "/w:hdr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style2.indexOf( ";width:138.15pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
+ CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
+ OUString style3 = getXPath(doc, "/w:hdr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ CPPUNIT_ASSERT( style3.indexOf( ";width:163.8pt;" ) >= 0 );
+ CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
+ CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */