summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport/odfexport.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/odfexport/odfexport.cxx')
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx388
1 files changed, 385 insertions, 3 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 15704c8eeaad..6dc67ca58a1d 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -10,7 +10,6 @@
#include <algorithm>
#include <memory>
#include <swmodeltestbase.hxx>
-#include <config_features.h>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/Gradient.hpp>
@@ -50,6 +49,7 @@
#include <unotools/streamwrap.hxx>
#include <svl/PasswordHelper.hxx>
#include <comphelper/sequenceashashmap.hxx>
+#include <vcl/filter/PDFiumLibrary.hxx>
#include <docufld.hxx> // for SwHiddenTextField::ParseIfFieldDefinition() method call
#include <unoprnms.hxx>
@@ -232,6 +232,32 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx")
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ // shape in background has lowest index
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "background");
+ // shape in foreground, previously index 1
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[1]/draw:custom-shape", "z-index", "2");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[1]/draw:custom-shape[@draw:z-index = '2']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ // shape in foreground, previously index 0
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[3]/draw:custom-shape", "z-index", "1");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[3]/draw:custom-shape[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf141467, "Formcontrol needs high z-index.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ // shape in foreground has lowest index
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ // form control, previously index 0
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:control", "z-index", "1");
+ // no run-through on form's style
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:control[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties/attribute::run-through", 0);
+}
+
DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -249,6 +275,23 @@ DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
CPPUNIT_ASSERT_EQUAL(OUString("** Expression is faulty **"), xE2->getString());
}
+DECLARE_ODFEXPORT_TEST(testTdf125877, "tdf95806.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+
+ // This was 0 (lost table during ODT export in footnotes)
+ // Note: fix also tdf#95806: painting table layout is correct
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+
+ // floating table: there is a frame now
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());
@@ -490,6 +533,19 @@ DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
+DECLARE_ODFEXPORT_TEST(testTdf140437, "tdf140437.odt")
+{
+ // Without the fix in place, the document would have failed to load
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+
+ // at least one field should be detected
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf131621, "tdf131621.ott")
{
CPPUNIT_ASSERT_EQUAL(12, getShapes());
@@ -767,6 +823,45 @@ DECLARE_ODFEXPORT_TEST(testFdo60769, "fdo60769.odt")
}
}
+DECLARE_ODFEXPORT_TEST(testTdf115815, "tdf115815.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ // Test comment range feature on tracked deletion.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ bool bAnnotationStart = false;
+ bool bBeforeAnnotation = true;
+ OUString sTextBeforeAnnotation;
+ while (xRunEnum->hasMoreElements())
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ OUString aType = getProperty<OUString>(xPropertySet, "TextPortionType");
+ // there is no AnnotationEnd with preceding AnnotationStart,
+ // i.e. annotation with lost range
+ CPPUNIT_ASSERT(aType != "AnnotationEnd" || !bAnnotationStart);
+
+ bAnnotationStart = (aType == "Annotation");
+
+ // collect paragraph text before the first annotation
+ if (bBeforeAnnotation)
+ {
+ if (bAnnotationStart)
+ bBeforeAnnotation = false;
+ else if (aType == "Text")
+ {
+ uno::Reference<text::XTextRange> xRun(xPropertySet, uno::UNO_QUERY);
+ sTextBeforeAnnotation += xRun->getString();
+ }
+ }
+ }
+
+ // This was "Lorem ipsum" (collapsed annotation range)
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem "), sTextBeforeAnnotation);
+}
+
DECLARE_ODFEXPORT_TEST(testFdo58949, "fdo58949.docx")
{
/*
@@ -1821,6 +1916,276 @@ DECLARE_ODFEXPORT_TEST(testMasterPageWithDrawingPage, "sw_hatch.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence"));
}
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeOOo, "pagestyle_background_ooo33.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO64, "pagestyle_background_lo64.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Landscape
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "no-repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Index
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "gradient");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "gradient-step-count", "0");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // First Page
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "hatch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO70, "pagestyle_background_lo70.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Landscape
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "no-repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Index
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "gradient");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "gradient-step-count", "0");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // First Page
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "hatch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+}
+
DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -1833,9 +2198,14 @@ DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3");
}
-#if HAVE_FEATURE_PDFIUM
DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
{
+ auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPdfium)
+ {
+ return;
+ }
+
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
uno::Reference<drawing::XShape> xShape = getShape(1);
@@ -1867,7 +2237,6 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
CPPUNIT_ASSERT(bHasBitmap);
}
}
-#endif
DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt")
{
@@ -2686,5 +3055,18 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(tdf135942, "nestedTableInFooter.odt")
assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2);
}
+DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */