diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/text/data/number-portion-format.odt | bin | 8961 -> 8984 bytes | |||
-rw-r--r-- | sw/qa/extras/htmlexport/xhtmlexport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/table_in_frame_to_page.fodt | 66 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf160253_ordinary_numbering.fodt | 43 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf160253_outline_numbering.fodt | 37 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport2.cxx | 84 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/data/empty_line_in_text_box.fodt | 31 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 53 | ||||
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfmte.cxx | 2 |
15 files changed, 43 insertions, 330 deletions
diff --git a/sw/qa/core/text/data/number-portion-format.odt b/sw/qa/core/text/data/number-portion-format.odt Binary files differindex 70b67ee3547e..19b23ae84420 100644 --- a/sw/qa/core/text/data/number-portion-format.odt +++ b/sw/qa/core/text/data/number-portion-format.odt 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="'Liberation Sans'" 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: */ diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 2d721fd3b112..84f32e30971f 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -657,6 +657,28 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con // Build a new numbering font basing on the current paragraph font: std::unique_ptr<SwFont> pNumFnt(new SwFont( &rInf.GetCharAttr(), pIDSA )); + const SwTextNode& rTextNode = *rInf.GetTextFrame()->GetTextNodeForParaProps(); + if (const SwpHints* pHints = rTextNode.GetpSwpHints()) + { + // Also look for an empty character hint that sits at the paragraph end: + for (size_t i = 0; i < pHints->Count(); ++i) + { + const SwTextAttr* pHint = pHints->GetSortedByEnd(i); + if (pHint->Which() == RES_TXTATR_AUTOFMT && pHint->GetEnd() + && pHint->GetStart() == *pHint->GetEnd() + && pHint->GetStart() == rTextNode.GetText().getLength()) + { + std::shared_ptr<SfxItemSet> pSet + = pHint->GetAutoFormat().GetStyleHandle(); + if (pSet) + { + pNumFnt->SetDiffFnt(pSet.get(), pIDSA); + break; + } + } + } + } + // #i53199# if ( !pIDSA->get(DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT) ) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 27d6032dd4d2..a2d959d7d3f7 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2478,7 +2478,7 @@ void wwSectionManager::SetHdFt(wwSection const &rSection, int nSect, } -void SwWW8ImplReader::FinalizeTextNode(SwPosition& rPos, bool bAddNew) +void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) { SwTextNode* pText = m_pPaM->GetPointNode().GetTextNode(); @@ -2565,8 +2565,7 @@ void SwWW8ImplReader::FinalizeTextNode(SwPosition& rPos, bool bAddNew) m_bFirstPara = false; - if (bAddNew) - m_rDoc.getIDocumentContentOperations().AppendTextNode(rPos); + m_rDoc.getIDocumentContentOperations().AppendTextNode(rPos); // We can flush all anchored graphics at the end of a paragraph. m_xAnchorStck->Flush(); @@ -3482,13 +3481,13 @@ void SwWW8ImplReader::simpleAddTextToParagraph(std::u16string_view aAddString) else { m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString.copy(0, nCharsLeft)); - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString.copy(nCharsLeft)); } } else { - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString); } @@ -3559,7 +3558,7 @@ bool SwWW8ImplReader::HandlePageBreakChar() && (m_bFirstPara || m_bFirstParaOfPage)) { IsTemp = false; - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); pTemp->SetAttr(*GetDfltAttr(RES_PARATR_NUMRULE)); } @@ -3638,7 +3637,7 @@ bool SwWW8ImplReader::ReadChar(tools::Long nPosCp, tools::Long nCpOfs) // Always insert a txtnode for a column break, e.g. ## SwContentNode *pCntNd=m_pPaM->GetPointContentNode(); if (pCntNd!=nullptr && pCntNd->Len()>0) // if par is empty not break is needed - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK)); } break; @@ -4107,7 +4106,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) } if (bSplit) { - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); } } @@ -4222,7 +4221,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) // to insert a text node. if (!bStartLine && !m_xAnchorStck->empty()) { - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); } m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK)); @@ -4235,7 +4234,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) m_xPreviousNode.reset(); if (m_pPaM->GetPoint()->GetContentIndex()) - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); if (!m_bInHyperlink) bJoined = JoinNode(*m_pPaM); diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index ca5b34f8e033..f98bcc2ff58e 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1421,7 +1421,7 @@ private: bool StyleExists(unsigned int nColl) const { return (nColl < m_vColl.size()); } SwWW8StyInf *GetStyle(sal_uInt16 nColl) const; - void FinalizeTextNode(SwPosition& rPos, bool bAddNew = true); + void AppendTextNode(SwPosition& rPos); void Read_HdFt(int nSect, const SwPageDesc *pPrev, const wwSection &rSection); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 07348ff888d3..602256428563 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2402,7 +2402,7 @@ void WW8TabDesc::CreateSwTable() } if (bInsNode) - m_pIo->FinalizeTextNode(*pPoint); + m_pIo->AppendTextNode(*pPoint); m_xTmpPos = m_pIo->m_rDoc.CreateUnoCursor(*m_pIo->m_pPaM->GetPoint()); @@ -3497,8 +3497,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) void SwWW8ImplReader::TabCellEnd() { - FinalizeTextNode(*m_pPaM->GetPoint(), false); - if (m_nInTable && m_xTableDesc) m_xTableDesc->TableCellEnd(); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 975280376800..6750fa21ae76 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -3478,7 +3478,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) } if (m_pPaM->GetPoint()->GetContentIndex()) - FinalizeTextNode(*m_pPaM->GetPoint()); + AppendTextNode(*m_pPaM->GetPoint()); const SwPosition* pPos = m_pPaM->GetPoint(); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index b8272f55ccd0..13270b28c144 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -881,7 +881,7 @@ void wwSectionManager::CreateSep(const tools::Long nTextPos) if( txtNode->Len() == 0 ) insert = false; if( insert ) - mrReader.FinalizeTextNode(*mrReader.m_pPaM->GetPoint()); + mrReader.AppendTextNode(*mrReader.m_pPaM->GetPoint()); } ww::WordVersion eVer = mrReader.GetFib().GetFIBVersion(); @@ -2528,7 +2528,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p { // The two fly frames would have the same anchor position, leading to // potentially overlapping text, prevent that. - FinalizeTextNode(*pPoint); + AppendTextNode(*pPoint); } } } diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 0999076212c1..8e20f46e4299 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -250,7 +250,7 @@ void SwXMLExport::collectAutoStyles() GetFormExport()->examineForms(xPage); } - GetTextParagraphExport()->collectTextAutoStylesAndNodeExportOrder(m_bShowProgress); + GetTextParagraphExport()->collectTextAutoStylesOptimized( m_bShowProgress ); } mbAutoStylesCollected = true; |