summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/text/data/number-portion-format.odtbin8961 -> 8984 bytes
-rw-r--r--sw/qa/extras/htmlexport/xhtmlexport.cxx4
-rw-r--r--sw/qa/extras/odfexport/data/table_in_frame_to_page.fodt66
-rw-r--r--sw/qa/extras/odfexport/data/tdf160253_ordinary_numbering.fodt43
-rw-r--r--sw/qa/extras/odfexport/data/tdf160253_outline_numbering.fodt37
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx84
-rw-r--r--sw/qa/extras/odfimport/data/empty_line_in_text_box.fodt31
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx53
8 files changed, 6 insertions, 312 deletions
diff --git a/sw/qa/core/text/data/number-portion-format.odt b/sw/qa/core/text/data/number-portion-format.odt
index 70b67ee3547e..19b23ae84420 100644
--- a/sw/qa/core/text/data/number-portion-format.odt
+++ b/sw/qa/core/text/data/number-portion-format.odt
Binary files differ
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index b1c00a6f81e5..86026dbd70bd 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -176,9 +176,9 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf66305)
sal_uInt64 nLength = pStream->TellEnd();
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
CPPUNIT_ASSERT(
- aStream.indexOf("<p class=\"paragraph-P5\"><a href=\"#__RefHeading__82004_486970805\" "
+ aStream.indexOf("<p class=\"paragraph-P6\"><a href=\"#__RefHeading__82004_486970805\" "
"class=\"text-Internet_20_link\">Introduction</a></p><p "
- "class=\"paragraph-P6\"> </p>")
+ "class=\"paragraph-P7\"> </p>")
!= -1);
}
diff --git a/sw/qa/extras/odfexport/data/table_in_frame_to_page.fodt b/sw/qa/extras/odfexport/data/table_in_frame_to_page.fodt
deleted file mode 100644
index 998f7a08e590..000000000000
--- a/sw/qa/extras/odfexport/data/table_in_frame_to_page.fodt
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:automatic-styles>
- <style:style style:name="P1" style:family="paragraph">
- <style:text-properties fo:font-style="italic"/>
- </style:style>
- <style:style style:name="P2" style:family="paragraph">
- <style:text-properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="Table1" style:family="table">
- <style:table-properties style:width="8cm" table:align="margins"/>
- </style:style>
- <style:style style:name="Table1.A" style:family="table-column">
- <style:table-column-properties style:column-width="4cm" style:rel-column-width="32767*"/>
- </style:style>
- <style:style style:name="Table1.B" style:family="table-column">
- <style:table-column-properties style:column-width="4cm" style:rel-column-width="32768*"/>
- </style:style>
- <style:style style:name="Table1.A1" style:family="table-cell">
- <style:table-cell-properties fo:padding="1mm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
- </style:style>
- <style:style style:name="Table1.B1" style:family="table-cell">
- <style:table-cell-properties fo:padding="1mm" fo:border="0.5pt solid #000000"/>
- </style:style>
- <style:style style:name="Table1.A2" style:family="table-cell">
- <style:table-cell-properties fo:padding="1mm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
- </style:style>
- <style:style style:name="Table1.B2" style:family="table-cell">
- <style:table-cell-properties fo:padding="1mm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
- </style:style>
- <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
- <style:graphic-properties style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent"/>
- </style:style>
- </office:automatic-styles>
- <office:body>
- <office:text>
- <draw:frame draw:style-name="fr1" draw:name="Frame1" text:anchor-type="page" text:anchor-page-number="1" svg:x="5cm" svg:y="1cm" svg:width="8cm" draw:z-index="0">
- <draw:text-box fo:min-height="5cm">
- <table:table table:name="Table1" table:style-name="Table1">
- <table:table-column table:style-name="Table1.A"/>
- <table:table-column table:style-name="Table1.B"/>
- <table:table-row>
- <table:table-cell table:style-name="Table1.A1" office:value-type="string">
- <text:p text:style-name="P1"/>
- </table:table-cell>
- <table:table-cell table:style-name="Table1.B1" office:value-type="string">
- <text:p/>
- </table:table-cell>
- </table:table-row>
- <table:table-row>
- <table:table-cell table:style-name="Table1.A2" office:value-type="string">
- <text:p/>
- </table:table-cell>
- <table:table-cell table:style-name="Table1.B2" office:value-type="string">
- <text:p/>
- </table:table-cell>
- </table:table-row>
- </table:table>
- <text:p text:style-name="P2"/>
- </draw:text-box>
- </draw:frame>
- <text:p/>
- </office:text>
- </office:body>
-</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/odfexport/data/tdf160253_ordinary_numbering.fodt b/sw/qa/extras/odfexport/data/tdf160253_ordinary_numbering.fodt
deleted file mode 100644
index ca5c1128d1c0..000000000000
--- a/sw/qa/extras/odfexport/data/tdf160253_ordinary_numbering.fodt
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:automatic-styles>
- <text:list-style style:name="L1">
- <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="1">
- <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
- <style:list-level-label-alignment text:label-followed-by="space"/>
- </style:list-level-properties>
- </text:list-level-style-number>
- </text:list-style>
- <text:list-style style:name="L2">
- <text:list-level-style-bullet text:level="1" text:bullet-char="•">
- <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
- <style:list-level-label-alignment text:label-followed-by="space" fo:text-indent="-0.5cm" fo:margin-left="1cm"/>
- </style:list-level-properties>
- </text:list-level-style-bullet>
- </text:list-style>
- </office:automatic-styles>
- <office:body>
- <office:text>
- <text:list xml:id="list1" text:style-name="L1">
- <text:list-item>
- <text:p>a</text:p>
- </text:list-item>
- <text:list-item>
- <text:p>b</text:p>
- </text:list-item>
- </text:list>
- <text:p>c<text:note text:id="ftn1" text:note-class="endnote"><text:note-citation>i</text:note-citation><text:note-body>
- <text:list text:style-name="L2">
- <text:list-item>
- <text:p>xyz</text:p>
- </text:list-item>
- </text:list></text:note-body></text:note></text:p>
- <text:list text:continue-list="list1" text:style-name="L1">
- <text:list-item>
- <text:p>d</text:p>
- </text:list-item>
- </text:list>
- </office:text>
- </office:body>
-</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/odfexport/data/tdf160253_outline_numbering.fodt b/sw/qa/extras/odfexport/data/tdf160253_outline_numbering.fodt
deleted file mode 100644
index 2eddd6dd4593..000000000000
--- a/sw/qa/extras/odfexport/data/tdf160253_outline_numbering.fodt
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:styles>
- <style:style style:name="Heading" style:family="paragraph" style:default-outline-level="1" style:list-style-name="Numbering_20_1" style:class="text"/>
- <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:list-style-name="Outline" style:class="text">
- <style:text-properties fo:font-weight="bold"/>
- </style:style>
- <text:outline-style style:name="Outline">
- <text:outline-level-style text:level="1" style:num-format="1">
- <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
- <style:list-level-label-alignment text:label-followed-by="space"/>
- </style:list-level-properties>
- </text:outline-level-style>
- </text:outline-style>
- <text:list-style style:name="Numbering_20_1" style:display-name="Numbering 1">
- <text:list-level-style-number text:level="1" style:num-format="1"/>
- </text:list-style>
- </office:styles>
- <office:master-styles>
- <style:master-page style:name="Standard"/>
- <style:master-page style:name="Endnote"/>
- </office:master-styles>
- <office:automatic-styles>
- <text:list-style style:name="L1">
- <text:list-level-style-bullet text:level="1" text:bullet-char="•"/>
- </text:list-style>
- </office:automatic-styles>
- <office:body>
- <office:text>
- <text:h text:style-name="Heading_20_1" text:outline-level="1">foo</text:h>
- <text:p>xyz<text:note text:id="ftn1" text:note-class="endnote"><text:note-citation>i</text:note-citation><text:note-body>
- <text:list text:style-name="L1"><text:list-item><text:p>abc</text:p></text:list-item></text:list></text:note-body></text:note></text:p>
- <text:h text:style-name="Heading_20_1" text:outline-level="1">bar</text:h>
- </office:text>
- </office:body>
-</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index 51c77cba4e78..1a06a8eaf268 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -111,14 +111,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106733)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- OUString autostyle = getXPath(pXmlDoc, "//office:body/office:text/text:p[2]/text:span"_ostr,
- "style-name"_ostr);
- OString autostyle_span_xpath = "//style:style[@style:name='" + autostyle.toUtf8() + "']";
-
// keep fo:hyphenate="false" in direct formatting
assertXPath(
pXmlDoc,
- autostyle_span_xpath + "/style:text-properties",
+ "//style:style[@style:name='T3']/style:text-properties"_ostr,
"hyphenate"_ostr, "false");
// keep fo:hyphenate="false" in character style
@@ -1154,13 +1150,9 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkerMarkupRoundtrip)
loadAndReload("ParagraphMarkerMarkup.fodt");
// Test that the markup stays at save-and-reload
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- OUString autostyle
- = getXPath(pXmlDoc, "//office:body/office:text/text:p"_ostr, "marker-style-name"_ostr);
- OString style_text_properties
- = "/office:document-content/office:automatic-styles/style:style[@style:name='"
- + autostyle.toUtf8() + "']/style:text-properties";
- assertXPath(pXmlDoc, style_text_properties, "font-size"_ostr, "9pt");
- assertXPath(pXmlDoc, style_text_properties, "color"_ostr, "#ff0000");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p"_ostr, "marker-style-name"_ostr, "T2");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties"_ostr, "font-size"_ostr, "9pt");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties"_ostr, "color"_ostr, "#ff0000");
}
CPPUNIT_TEST_FIXTURE(Test, testCommentStyles)
@@ -1438,74 +1430,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160700)
assertXPath(pXmlDoc, "//office:text/text:list/text:list-item/text:p/text:bookmark"_ostr);
}
-CPPUNIT_TEST_FIXTURE(Test, testTdf160253_ordinary_numbering)
-{
- // Given a document with a list, and an out-of-the-list paragraph in the middle, having an
- // endnote, which has a paragraph in another list.
- // Before the fix, this already failed with
- // Error: "list2916587379" is referenced by an IDREF, but not defined.
- loadAndReload("tdf160253_ordinary_numbering.fodt");
-
- // Make sure that the fourth paragraph has correct number - it was "1." before the fix
- CPPUNIT_ASSERT_EQUAL(u"3."_ustr,
- getProperty<OUString>(getParagraph(4), u"ListLabelString"_ustr));
-
- // Make sure that we emit an identifier for the first list, and refer to it in the continuation
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- // This failed before the fix, because 'xml:id' attribute wasn't emitted
- OUString firstListId
- = getXPath(pXmlDoc, "//office:body/office:text/text:list[1]"_ostr, "id"_ostr);
- CPPUNIT_ASSERT(!firstListId.isEmpty());
- assertXPath(pXmlDoc, "//office:body/office:text/text:list[2]"_ostr, "continue-list"_ostr,
- firstListId);
-}
-
-CPPUNIT_TEST_FIXTURE(Test, testTdf160253_outline_numbering)
-{
- // Given a document with an outline (chapter) numbering, and a paragraph in the middle, having
- // an endnote, which has a paragraph in a list.
- // Before the fix, this already failed with
- // Error: "list2916587379" is referenced by an IDREF, but not defined.
- loadAndReload("tdf160253_outline_numbering.fodt");
-
- // Make sure that the third paragraph has correct number - it was "1" before the fix
- CPPUNIT_ASSERT_EQUAL(u"2"_ustr,
- getProperty<OUString>(getParagraph(3), u"ListLabelString"_ustr));
-
- // The difference with the ordinary numbering is that for outline numbering, the list element
- // isn't really necessary. It is a TODO to fix the output, and not export the list.
- // xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- // assertXPath(pXmlDoc, "//office:body/office:text/text:list"_ostr, 0);
-}
-
-CPPUNIT_TEST_FIXTURE(Test, testTableInFrameAnchoredToPage)
-{
- // Given a table in a frame anchored to a page:
- // it must not assert on export because of missing format for an exported table
- loadAndReload("table_in_frame_to_page.fodt");
-
- // Check also, that autostyles defined inside that frame are stored correctly. If not, then
- // these paragraphs would refer to styles in <office::styles>, not in <office:automatic-styles>,
- // without the 'italic' and 'bold' attributes.
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- OUString P1 = getXPath(
- pXmlDoc,
- "//office:body/office:text/draw:frame/draw:text-box/table:table/table:table-row[1]/"
- "table:table-cell[1]/text:p"_ostr,
- "style-name"_ostr);
- assertXPath(pXmlDoc,
- "//office:automatic-styles/style:style[@style:name='"_ostr + P1.toUtf8()
- + "']/style:text-properties",
- "font-style"_ostr, u"italic"_ustr);
- OUString P2
- = getXPath(pXmlDoc, "//office:body/office:text/draw:frame/draw:text-box/text:p"_ostr,
- "style-name"_ostr);
- assertXPath(pXmlDoc,
- "//office:automatic-styles/style:style[@style:name='"_ostr + P2.toUtf8()
- + "']/style:text-properties",
- "font-weight"_ostr, u"bold"_ustr);
-}
-
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/odfimport/data/empty_line_in_text_box.fodt b/sw/qa/extras/odfimport/data/empty_line_in_text_box.fodt
deleted file mode 100644
index 4ae36a9c5fac..000000000000
--- a/sw/qa/extras/odfimport/data/empty_line_in_text_box.fodt
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:font-face-decls>
- <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
- </office:font-face-decls>
- <office:styles>
- <style:default-style style:family="graphic">
- <style:text-properties style:font-name="Liberation Sans" fo:font-size="18pt"/>
- </style:default-style>
- </office:styles>
- <office:automatic-styles>
- <style:style style:name="T1" style:family="text">
- <style:text-properties fo:font-size="10pt"/>
- </style:style>
- <style:style style:name="gr1" style:family="graphic">
- <style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/>
- </style:style>
- </office:automatic-styles>
- <office:body>
- <office:text>
- <text:p text:style-name="Standard"><draw:frame text:anchor-type="paragraph" draw:name="TextFrame1" draw:style-name="gr1" svg:width="4cm" svg:x="4cm" svg:y="4cm">
- <draw:text-box>
- <text:p><text:span text:style-name="T1">a</text:span></text:p>
- <text:p><text:span text:style-name="T1"/></text:p>
- <text:p><text:span text:style-name="T1">c</text:span></text:p>
- </draw:text-box>
- </draw:frame></text:p>
- </office:text>
- </office:body>
-</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 0074b53f851e..70c6452e3d9f 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1561,58 +1561,5 @@ CPPUNIT_TEST_FIXTURE(Test, testBrokenPackage_Tdf159474)
CPPUNIT_ASSERT_EQUAL(u"Empty document"_ustr, getParagraph(1)->getString());
}
-CPPUNIT_TEST_FIXTURE(Test, testTdf161054)
-{
- // Similar to testTdf161023 in sd/qa/unit/import-tests2.cxx
- // Given a shape with three paragraphs (18pt), all directly assigned a smaller font (10pt)
- createSwDoc("empty_line_in_text_box.fodt");
- auto shapeText = getShape(1).queryThrow<text::XTextRange>()->getText();
-
- // 1st paragraph, not empty
- {
- auto paragraph(getParagraphOfText(1, shapeText));
- CPPUNIT_ASSERT_EQUAL(u"a"_ustr, paragraph->getString());
- auto run(getRun(paragraph, 1));
- CPPUNIT_ASSERT_EQUAL(u"a"_ustr, run->getString());
- uno::Reference<beans::XPropertySet> xPropSet(run, uno::UNO_QUERY_THROW);
- double fCharHeight = 0;
- xPropSet->getPropertyValue("CharHeight") >>= fCharHeight;
- CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight);
- // No more runs
- CPPUNIT_ASSERT_THROW(getRun(paragraph, 2), container::NoSuchElementException);
- }
-
- // Empty 2nd paragraph, consisting of a single span: this span was treated as "paragraph mark"
- {
- auto paragraph(getParagraphOfText(2, shapeText));
- CPPUNIT_ASSERT_EQUAL(u""_ustr, paragraph->getString());
- auto run(getRun(paragraph, 1));
- CPPUNIT_ASSERT_EQUAL(u""_ustr, run->getString());
- uno::Reference<beans::XPropertySet> xPropSet(run, uno::UNO_QUERY_THROW);
- double fCharHeight = 0;
- xPropSet->getPropertyValue("CharHeight") >>= fCharHeight;
- // Without the fix, this would fail with
- // - Expected: 10
- // - Actual : 18
- CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight);
- // No more runs
- CPPUNIT_ASSERT_THROW(getRun(paragraph, 2), container::NoSuchElementException);
- }
-
- // 3rd paragraph, not empty
- {
- auto paragraph(getParagraphOfText(3, shapeText));
- CPPUNIT_ASSERT_EQUAL(u"c"_ustr, paragraph->getString());
- auto run(getRun(paragraph, 1));
- CPPUNIT_ASSERT_EQUAL(u"c"_ustr, run->getString());
- uno::Reference<beans::XPropertySet> xPropSet(run, uno::UNO_QUERY_THROW);
- double fCharHeight = 0;
- xPropSet->getPropertyValue("CharHeight") >>= fCharHeight;
- CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight);
- // No more runs
- CPPUNIT_ASSERT_THROW(getRun(paragraph, 2), container::NoSuchElementException);
- }
-}
-
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */