summaryrefslogtreecommitdiffstats
path: root/sw/qa/core/text
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/core/text')
-rw-r--r--sw/qa/core/text/data/clearing-break-header.fodt31
-rw-r--r--sw/qa/core/text/data/clearing-break-start.fodt28
-rw-r--r--sw/qa/core/text/data/clearing-break.fodt28
-rw-r--r--sw/qa/core/text/data/empty-numbering-page-split.fodt62
-rw-r--r--sw/qa/core/text/data/firstLineIndent-withFlag.fodt31
-rw-r--r--sw/qa/core/text/data/footnote-connect.fodt132
-rw-r--r--sw/qa/core/text/data/image.pngbin0 -> 3148 bytes
-rw-r--r--sw/qa/core/text/data/line-height.fodt32
-rw-r--r--sw/qa/core/text/data/line-width.fodt32
-rw-r--r--sw/qa/core/text/data/number-portion-format.odtbin0 -> 8984 bytes
-rw-r--r--sw/qa/core/text/data/number-portion-noformat.docxbin0 -> 13230 bytes
-rw-r--r--sw/qa/core/text/data/ruby.fodt25
-rw-r--r--sw/qa/core/text/data/tabovermargin-section.fodt50
-rw-r--r--sw/qa/core/text/text.cxx596
14 files changed, 1047 insertions, 0 deletions
diff --git a/sw/qa/core/text/data/clearing-break-header.fodt b/sw/qa/core/text/data/clearing-break-header.fodt
new file mode 100644
index 000000000..2bdbcd3c7
--- /dev/null
+++ b/sw/qa/core/text/data/clearing-break-header.fodt
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties fo:margin-left="0.318cm" fo:margin-right="0.318cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:run-through="background" style:wrap="run-through" 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" loext:allow-overlap="true" style:flow-with-text="false"/>
+ </style:style>
+ <style:style style:name="gr2" style:family="graphic">
+ <style:graphic-properties draw:stroke="none" svg:stroke-width="0cm" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="bottom" draw:auto-grow-height="false" style:run-through="background"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" fo:margin-top="1.251cm" fo:margin-bottom="2.54cm" fo:margin-left="2.501cm" fo:margin-right="2.501cm">
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="1.289cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="1.189cm" style:dynamic-spacing="true"/>
+ </style:header-style>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ <style:header>
+ <text:p><draw:g text:anchor-type="char" draw:z-index="1" draw:style-name="gr1"><draw:rect draw:style-name="gr2" svg:width="8.347cm" svg:height="8.908cm" svg:x="11.871cm" svg:y="21.243cm"><text:p/></draw:rect></draw:g></text:p>
+ <text:p/>
+ </style:header>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p><text:line-break loext:clear="all"/></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/clearing-break-start.fodt b/sw/qa/core/text/data/clearing-break-start.fodt
new file mode 100644
index 000000000..f2df00fad
--- /dev/null
+++ b/sw/qa/core/text/data/clearing-break-start.fodt
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="fr1" style:family="graphic">
+ <style:graphic-properties fo:margin-left="0.318cm" fo:margin-right="0.318cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="parallel" 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><draw:frame draw:style-name="fr1" draw:name="Picture 1" text:anchor-type="char" svg:x="0cm" svg:y="0cm" svg:width="1.806cm" svg:height="1.806cm" draw:z-index="0"><draw:image draw:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
+ UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+ AAJiS0dEAACqjSMyAAAACW9GRnMAAAAGAAAAAAAMc1XTAAAACXBIWXMAAA3XAAAN1wFCKJt4
+ AAAACXZwQWcAAABMAAAAQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+ BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+ cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+ /878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+ QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+ YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+ 2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+ cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+ AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+ hOCNQr34oD4AAAAldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+ 5RscAAAAJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+ AABJRU5ErkJggg==
+ </office:binary-data></draw:image></draw:frame>X</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/clearing-break.fodt b/sw/qa/core/text/data/clearing-break.fodt
new file mode 100644
index 000000000..a2f128506
--- /dev/null
+++ b/sw/qa/core/text/data/clearing-break.fodt
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="fr1" style:family="graphic">
+ <style:graphic-properties fo:margin-left="0.318cm" fo:margin-right="0.318cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="parallel" 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><draw:frame draw:style-name="fr1" draw:name="Picture 1" text:anchor-type="char" svg:x="0cm" svg:y="0cm" svg:width="1.806cm" svg:height="1.806cm" draw:z-index="0"><draw:image draw:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
+ UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+ AAJiS0dEAACqjSMyAAAACW9GRnMAAAAGAAAAAAAMc1XTAAAACXBIWXMAAA3XAAAN1wFCKJt4
+ AAAACXZwQWcAAABMAAAAQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+ BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+ cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+ /878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+ QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+ YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+ 2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+ cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+ AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+ hOCNQr34oD4AAAAldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+ 5RscAAAAJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+ AABJRU5ErkJggg==
+ </office:binary-data></draw:image></draw:frame>AB</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/empty-numbering-page-split.fodt b/sw/qa/core/text/data/empty-numbering-page-split.fodt
new file mode 100644
index 000000000..517ad2e0f
--- /dev/null
+++ b/sw/qa/core/text/data/empty-numbering-page-split.fodt
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ <style:text-properties fo:font-size="12pt"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" fo:keep-with-next="always"/>
+ <style:text-properties fo:font-size="14pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:break-before="page"/>
+ </style:style>
+ <text:outline-style style:name="Outline">
+ <text:outline-level-style text:level="1" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ </text:outline-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="Intro">
+ <style:paragraph-properties style:page-number="1"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0cm"/>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1" style:next-style-name="Intro">
+ <style:header>
+ <text:p/>
+ </style:header>
+ <style:footer>
+ <text:p/>
+ </style:footer>
+ </style:master-page>
+ <style:master-page style:name="Intro" style:page-layout-name="pm2"/>
+ </office:master-styles>
+ <office:body>
+ <office:text text:use-soft-page-breaks="true">
+ <text:h text:style-name="Heading_20_1" text:outline-level="1"/>
+ <text:p text:style-name="P1"/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/firstLineIndent-withFlag.fodt b/sw/qa/core/text/data/firstLineIndent-withFlag.fodt
new file mode 100644
index 000000000..069b960b9
--- /dev/null
+++ b/sw/qa/core/text/data/firstLineIndent-withFlag.fodt
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" config:type="boolean">true</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ <style:text-properties style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" fo:hyphenate="false"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="5.5mm" fo:line-height="100%" fo:text-indent="0cm" style:auto-text-indent="true"/>
+ </style:style>
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:line-height="200%" fo:text-indent="0cm" style:auto-text-indent="true"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:text>
+ <text:p text:style-name="P1">LibreOffice is a free and powerful office suite, and a successor to OpenOffice.org (commonly known as OpenOffice). Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity. LibreOffice is one of the friendliest and fastest-growing projects in the free and open source software world.</text:p>
+ <text:p text:style-name="P2">LibreOffice is a free and powerful office suite, and a successor to OpenOffice.org (commonly known as OpenOffice). Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity. LibreOffice is one of the friendliest and fastest-growing projects in the free and open source software world.</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/footnote-connect.fodt b/sw/qa/core/text/data/footnote-connect.fodt
new file mode 100644
index 000000000..dd26db98c
--- /dev/null
+++ b/sw/qa/core/text/data/footnote-connect.fodt
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ooo="http://openoffice.org/2004/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ContinuousEndnotes" config:type="boolean">true</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:text-properties style:font-name="Liberation Sans" fo:font-size="12pt"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text">
+ <style:text-properties style:font-name="Liberation Sans" fo:font-size="12pt"/>
+ </style:style>
+ <style:style style:name="Endnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt"/>
+ </style:style>
+ <style:style style:name="Frame" style:family="graphic">
+ </style:style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table6" style:family="table">
+ <style:table-properties style:width="15.983cm" table:align="margins" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="Table6.A" style:family="table-column">
+ <style:table-column-properties style:column-width="15.983cm" style:rel-column-width="65535*"/>
+ </style:style>
+ <style:style style:name="Table6.1" style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:style>
+ <style:style style:name="Table6.A1" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:padding-left="0cm" fo:padding-right="0cm" fo:padding-top="0cm" fo:padding-bottom="0.199cm" fo:border="none" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="Standard">
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:break-before="page"/>
+ </style:style>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="left" style:horizontal-rel="page-content" fo:background-color="#ffffff" style:background-transparency="100%" draw:fill="solid" draw:fill-color="#ffffff" draw:opacity="0%" fo:padding="0cm" fo:border="none" style:writing-mode="lr-tb" draw:wrap-influence-on-position="once-successive" loext:allow-overlap="true"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.27cm" fo:margin-bottom="3.071cm" fo:margin-left="3cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="39" style:layout-grid-base-height="0.635cm" style:layout-grid-ruby-height="0cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:layout-grid-base-width="0.423cm" style:layout-grid-snap-to="true" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.653cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.554cm" style:dynamic-spacing="true"/>
+ </style:footer-style>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ <style:footer>
+ <text:p></text:p>
+ </style:footer>
+ <loext:footer-first>
+ <text:p text:style-name="Footer"><draw:frame draw:style-name="fr1" draw:name="Frame1" text:anchor-type="paragraph" svg:y="25.506cm" svg:width="15.983cm" draw:z-index="0"><draw:text-box fo:min-height="0.058cm"><table:table table:name="Table6" table:style-name="Table6"><table:table-column table:style-name="Table6.A"/><table:table-row table:style-name="Table6.1"><table:table-cell table:style-name="Table6.A1" office:value-type="string"><text:p text:style-name="Standard">A1</text:p></table:table-cell></table:table-row></table:table></draw:text-box></draw:frame></text:p>
+ </loext:footer-first>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text text:use-soft-page-breaks="true">
+ <text:p text:style-name="P1">P01</text:p>
+ <text:p text:style-name="Standard">P02</text:p>
+ <text:p text:style-name="Standard">P03</text:p>
+ <text:p text:style-name="Standard">P04</text:p>
+ <text:p text:style-name="Standard">P05</text:p>
+ <text:p text:style-name="Standard">P06</text:p>
+ <text:p text:style-name="Standard">P07</text:p>
+ <text:p text:style-name="Standard">P08</text:p>
+ <text:p text:style-name="Standard">P09</text:p>
+ <text:p text:style-name="Standard">P10</text:p>
+ <text:p text:style-name="Standard">P11</text:p>
+ <text:p text:style-name="Standard">P12</text:p>
+ <text:p text:style-name="Standard">P13</text:p>
+ <text:p text:style-name="Standard">P14</text:p>
+ <text:p text:style-name="Standard">P15</text:p>
+ <text:p text:style-name="Standard">P16</text:p>
+ <text:p text:style-name="Standard">P17</text:p>
+ <text:p text:style-name="Standard">P18</text:p>
+ <text:p text:style-name="Standard">P19</text:p>
+ <text:p text:style-name="Standard">P20</text:p>
+ <text:p text:style-name="Standard">P21</text:p>
+ <text:p text:style-name="Standard">P22</text:p>
+ <text:p text:style-name="Standard">P23</text:p>
+ <text:p text:style-name="Standard">P24</text:p>
+ <text:p text:style-name="Standard">P25</text:p>
+ <text:p text:style-name="Standard">P26</text:p>
+ <text:p text:style-name="Standard">P27</text:p>
+ <text:p text:style-name="Standard">P28</text:p>
+ <text:p text:style-name="Standard">P29</text:p>
+ <text:p text:style-name="Standard">P30</text:p>
+ <text:p text:style-name="Standard">P31</text:p>
+ <text:p text:style-name="Standard">P32</text:p>
+ <text:p text:style-name="Standard">P33</text:p>
+ <text:p text:style-name="Standard">P34</text:p>
+ <text:p text:style-name="Standard">P35</text:p>
+ <text:p text:style-name="Standard">P36</text:p>
+ <text:p text:style-name="Standard">P37</text:p>
+ <text:p text:style-name="Standard">P38</text:p>
+ <text:p text:style-name="Standard"/>
+ <text:p text:style-name="Standard"/>
+ <text:p text:style-name="Standard"/>
+ <text:p text:style-name="P3">P2P01</text:p>
+ <text:p text:style-name="Standard">P2P02</text:p>
+ <text:p text:style-name="Standard">P2P03</text:p>
+ <text:p text:style-name="Standard">P2P04</text:p>
+ <text:p text:style-name="Standard">P2P05</text:p>
+ <text:p text:style-name="Standard">P2P06</text:p>
+ <text:p text:style-name="Standard">P2P07</text:p>
+ <text:p text:style-name="Standard">P2P08</text:p>
+ <text:p text:style-name="Standard">P2P09</text:p>
+ <text:p text:style-name="Standard">P2P10</text:p>
+ <text:p text:style-name="Standard">P2P11</text:p>
+ <text:p text:style-name="Standard">P2P12<text:note text:id="ftn1" text:note-class="endnote"><text:note-citation>1</text:note-citation><text:note-body></text:note-body></text:note> First line<text:line-break/>second line</text:p>
+ <text:p text:style-name="P3"/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/image.png b/sw/qa/core/text/data/image.png
new file mode 100644
index 000000000..49e71b07a
--- /dev/null
+++ b/sw/qa/core/text/data/image.png
Binary files differ
diff --git a/sw/qa/core/text/data/line-height.fodt b/sw/qa/core/text/data/line-height.fodt
new file mode 100644
index 000000000..d784ec241
--- /dev/null
+++ b/sw/qa/core/text/data/line-height.fodt
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"/>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="84.1cm" fo:page-height="118.9cm" fo:margin-top="0cm" fo:margin-bottom="0cm" fo:margin-left="0cm" fo:margin-right="0cm"/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char" svg:width="84.1cm" svg:height="118.9cm" draw:z-index="0"><draw:image draw:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
+ UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+ AAJiS0dEAACqjSMyAAAACW9GRnMAAAAGAAAAAAAMc1XTAAAACXBIWXMAAA3XAAAN1wFCKJt4
+ AAAACXZwQWcAAABMAAAAQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+ BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+ cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+ /878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+ QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+ YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+ 2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+ cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+ AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+ hOCNQr34oD4AAAAldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+ 5RscAAAAJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+ AABJRU5ErkJggg==
+ </office:binary-data></draw:image></draw:frame></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/line-width.fodt b/sw/qa/core/text/data/line-width.fodt
new file mode 100644
index 000000000..a6b2b2f5c
--- /dev/null
+++ b/sw/qa/core/text/data/line-width.fodt
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"/>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-height="84.1cm" fo:page-width="118.9cm" fo:margin-top="0cm" fo:margin-bottom="0cm" fo:margin-left="0cm" fo:margin-right="0cm"/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char" svg:height="84.1cm" svg:width="118.9cm" draw:z-index="0"><draw:image draw:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
+ UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+ AAJiS0dEAACqjSMyAAAACW9GRnMAAAAGAAAAAAAMc1XTAAAACXBIWXMAAA3XAAAN1wFCKJt4
+ AAAACXZwQWcAAABMAAAAQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+ BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+ cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+ /878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+ QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+ YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+ 2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+ cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+ AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+ hOCNQr34oD4AAAAldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+ 5RscAAAAJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+ AABJRU5ErkJggg==
+ </office:binary-data></draw:image></draw:frame></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/number-portion-format.odt b/sw/qa/core/text/data/number-portion-format.odt
new file mode 100644
index 000000000..19b23ae84
--- /dev/null
+++ b/sw/qa/core/text/data/number-portion-format.odt
Binary files differ
diff --git a/sw/qa/core/text/data/number-portion-noformat.docx b/sw/qa/core/text/data/number-portion-noformat.docx
new file mode 100644
index 000000000..b289b9c69
--- /dev/null
+++ b/sw/qa/core/text/data/number-portion-noformat.docx
Binary files differ
diff --git a/sw/qa/core/text/data/ruby.fodt b/sw/qa/core/text/data/ruby.fodt
new file mode 100644
index 000000000..b5a0e23d2
--- /dev/null
+++ b/sw/qa/core/text/data/ruby.fodt
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ </office:font-face-decls>
+ <office:styles>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Ru1" style:family="ruby">
+ <style:ruby-properties style:ruby-align="left" style:ruby-position="above" loext:ruby-position="above"/>
+ </style:style>
+ <style:style style:name="Ru2" style:family="ruby">
+ <style:ruby-properties style:ruby-align="center" style:ruby-position="above" loext:ruby-position="above"/>
+ </style:style>
+ <style:style style:name="Ru3" style:family="ruby">
+ <style:ruby-properties style:ruby-align="right" style:ruby-position="above" loext:ruby-position="above"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p text:style-name="P1">Ruby test: <text:ruby text:style-name="Ru1"><text:ruby-base>base text</text:ruby-base><text:ruby-text text:style-name="Rubies">ruby (left)</text:ruby-text></text:ruby> <text:ruby text:style-name="Ru2"><text:ruby-base>base text</text:ruby-base><text:ruby-text>ruby (center)</text:ruby-text></text:ruby> <text:ruby text:style-name="Ru3"><text:ruby-base>base text</text:ruby-base><text:ruby-text>ruby (right)</text:ruby-text></text:ruby></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/data/tabovermargin-section.fodt b/sw/qa/core/text/data/tabovermargin-section.fodt
new file mode 100644
index 000000000..6fd39c471
--- /dev/null
+++ b/sw/qa/core/text/data/tabovermargin-section.fodt
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="TabOverMargin" config:type="boolean">true</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ </style:default-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Index_20_1">
+ <style:paragraph-properties>
+ <style:tab-stops>
+ <style:tab-stop style:position="17.59cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Sect1" style:family="section">
+ <style:section-properties style:editable="false">
+ <style:columns fo:column-count="2" fo:column-gap="0cm">
+ <style:column style:rel-width="32767*" fo:start-indent="0cm" fo:end-indent="0cm"/>
+ <style:column style:rel-width="32768*" fo:start-indent="0cm" fo:end-indent="0cm"/>
+ </style:columns>
+ </style:section-properties>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.59cm" fo:page-height="27.94cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" fo:background-color="#ffffff" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="37" style:layout-grid-base-height="0.635cm" style:layout-grid-ruby-height="0cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:layout-grid-base-width="0.423cm" style:layout-grid-snap-to="true" draw:fill="solid" draw:fill-color="#ffffff" draw:opacity="0%" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:style style:name="dp1" style:family="drawing-page">
+ <style:drawing-page-properties draw:fill="solid" draw:background-size="full" draw:fill-color="#ffffff" draw:opacity="0%"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1" draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p>before</text:p>
+ <text:section text:style-name="Sect1" text:name="Section1">
+ <text:p text:style-name="P1">hello<text:tab/>1</text:p>
+ </text:section>
+ <text:p>after</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
new file mode 100644
index 000000000..eaf5cce31
--- /dev/null
+++ b/sw/qa/core/text/text.cxx
@@ -0,0 +1,596 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <memory>
+
+#include <com/sun/star/text/BibliographyDataType.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
+
+#include <vcl/gdimtf.hxx>
+#include <vcl/filter/PDFiumLibrary.hxx>
+#include <comphelper/propertyvalue.hxx>
+#include <unotools/mediadescriptor.hxx>
+
+#include <docsh.hxx>
+#include <unotxdoc.hxx>
+#include <wrtsh.hxx>
+#include <IDocumentLayoutAccess.hxx>
+#include <rootfrm.hxx>
+#include <txtfrm.hxx>
+#include <porlay.hxx>
+#include <pormulti.hxx>
+#include <formatlinebreak.hxx>
+#include <sortedobjs.hxx>
+#include <anchoredobject.hxx>
+#include <fmtcntnt.hxx>
+#include <fmtfsize.hxx>
+#include <IDocumentRedlineAccess.hxx>
+
+constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
+
+/// Covers sw/source/core/text/ fixes.
+class SwCoreTextTest : public SwModelTestBase
+{
+};
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testFootnoteConnect)
+{
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "footnote-connect.fodt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ // Jump to the start of the next page.
+ pWrtShell->SttNxtPg();
+ // Remove the page break.
+ pWrtShell->DelLeft();
+ // Split the multi-line text frame, containing an endnote.
+ pWrtShell->DelLeft();
+ // Join the split text frame.
+ pWrtShell->DelLeft();
+ // Turn the 3 page document into a 2 page one, so the endnote frame is moved.
+ // Without the accompanying fix in place, this test would have crashed due to a use-after-free
+ // in SwFootnoteFrame::GetRef().
+ pWrtShell->DelLeft();
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testSemiTransparentText)
+{
+ // Create an in-memory empty document.
+ loadURL("private:factory/swriter", nullptr);
+
+ // Set text to half-transparent and type a character.
+ uno::Reference<beans::XPropertySet> xParagraph(getParagraph(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xParagraph.is());
+ sal_Int16 nTransparence = 50;
+ xParagraph->setPropertyValue("CharTransparence", uno::Any(nTransparence));
+ uno::Reference<text::XTextRange> xTextRange(xParagraph, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xTextRange.is());
+ xTextRange->setString("x");
+
+ // Render the document to a metafile.
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDocShell* pDocShell = pTextDoc->GetDocShell();
+ CPPUNIT_ASSERT(pDocShell);
+ std::shared_ptr<GDIMetaFile> xMetaFile = pDocShell->GetPreviewMetaFile();
+ CPPUNIT_ASSERT(xMetaFile);
+
+ // Make sure that DrawTransparent() was used during rendering.
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "//floattransparent");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport)
+{
+ // Given a document with a bibliography entry field:
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPDFium)
+ {
+ return;
+ }
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::Any(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // When exporting to PDF:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ // Then make sure the field links the source.
+ SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+ SvMemoryStream aMemory;
+ aMemory.WriteStream(aFile);
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+ = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString());
+ CPPUNIT_ASSERT(pPdfDocument);
+ std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/0);
+ // Without the accompanying fix in place, this test would have failed, the field was not
+ // clickable (while it was clickable on the UI).
+ CPPUNIT_ASSERT(pPdfPage->hasLinks());
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection)
+{
+ createSwDoc(DATA_DIRECTORY, "tabovermargin-section.fodt");
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nWidth
+ = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabRight']", "nWidth").toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected less than: 5000
+ // - Actual : 9372
+ // i.e. the tab portion width was not the expected 4386, but much larger, so the number after
+ // the tab portion was not visible.
+ CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(5000), nWidth);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight)
+{
+ // Given a document with an as-char image, height in twips not fitting into sal_uInt16:
+ createSwDoc(DATA_DIRECTORY, "line-height.fodt");
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure its top is the top of the page:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 284
+ // - Actual : -65252
+ // due to various unsigned integer truncations.
+ assertXPath(pXmlDoc, "//fly/infos/bounds", "top", OUString::number(DOCUMENTBORDER));
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineWidth)
+{
+ // Given a document with an as-char image, width in twips not fitting into sal_uInt16:
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "line-width.fodt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ sal_Int32 nOldLeft = pWrtShell->GetCharRect().Left();
+
+ // When moving the cursor to the right:
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
+
+ // Then make sure we move to the right by the image width:
+ sal_Int32 nNewLeft = pWrtShell->GetCharRect().Left();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected greater than: 65536
+ // - Actual : 1872
+ // i.e. the width (around 67408 twips) was truncated.
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(65536), nNewLeft - nOldLeft);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent)
+{
+ // The test document contains two simple multi-line paragraph. For both paragraphs, the first line indent
+ // is set to 'auto'. Line spacing is 100% for the 1st paragraph and 200% for the 2nd paragraph.
+ // Also, there is a "AutoFirstLineIndentDisregardLineSpace" capability flag set in the document.
+ createSwDoc(DATA_DIRECTORY, "firstLineIndent-withFlag.fodt");
+
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Get the line width of the first line for the 1st paragraph.
+ sal_Int32 nFirstLineWidth
+ = getXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout[1]", "width").toInt32();
+ // Get the line width of the first line for the 2nd paragraph.
+ sal_Int32 nSecondLineWidth
+ = getXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout[1]", "width").toInt32();
+
+ // Tdf#129448: the changing of line-height should not affect the auto first line indent.
+ // As a result, the first line width of the two paragraphs should be the same.
+ CPPUNIT_ASSERT_EQUAL(nSecondLineWidth, nFirstLineWidth);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRuby)
+{
+ // Given a document with multiple ruby portions:
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "ruby.fodt");
+
+ // When laying out that document:
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+
+ // Then make sure that no unwanted margin portions are created, making the actual text
+ // invisible:
+ SwFrame* pPageFrame = pLayout->GetLower();
+ SwFrame* pBodyFrame = pPageFrame->GetLower();
+ SwFrame* pFrame = pBodyFrame->GetLower();
+ CPPUNIT_ASSERT(pFrame->IsTextFrame());
+ auto pTextFrame = static_cast<SwTextFrame*>(pFrame);
+ SwParaPortion* pPara = pTextFrame->GetPara();
+ bool bFirst = true;
+ for (SwLinePortion* pPor = pPara->GetFirstPortion(); pPor; pPor = pPor->GetNextPortion())
+ {
+ // Look for multi-portions in the only paragraph of the document.
+ if (pPor->GetWhichPor() != PortionType::Multi)
+ {
+ continue;
+ }
+
+ if (bFirst)
+ {
+ bFirst = false;
+ continue;
+ }
+
+ // The second multi-portion has two lines, check the start of the second line.
+ auto pMulti = static_cast<SwMultiPortion*>(pPor);
+ // Without the accompanying fix in place, this test would have failed, as the portion was a
+ // margin portion, not a text portion. The margin was so large that the actual text portion was
+ // hidden. No margin is needed here at all.
+ CPPUNIT_ASSERT(pMulti->GetRoot().GetNext()->GetFirstPortion()->IsTextPortion());
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testEmptyNumberingPageSplit)
+{
+ // Given a document with 2 pages: the only para on page 1 is a numbering without a number
+ // portion:
+ createSwDoc(DATA_DIRECTORY, "empty-numbering-page-split.fodt");
+
+ // When inserting an image that doesn't fit the body frame:
+ // Then make sure that the layout update after insertion finishes:
+ uno::Sequence<beans::PropertyValue> aArgs = {
+ comphelper::makePropertyValue("FileName",
+ m_directories.getURLFromSrc(DATA_DIRECTORY) + "image.png"),
+ };
+ // Without the accompanying fix in place, this never finished.
+ dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak)
+{
+ // Given a document with a fly frame and two characters wrapped around it:
+ createSwDoc(DATA_DIRECTORY, "clearing-break.fodt");
+ // Insert a clearing break between "A" and "B":
+ uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ xCursor->gotoEnd(/*bSelect=*/false);
+ xCursor->goLeft(/*nCount=*/1, /*bSelect=*/false);
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextContent> xLineBreak(
+ xFactory->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xLineBreakProps(xLineBreak, uno::UNO_QUERY);
+ auto eClear = static_cast<sal_Int16>(SwLineBreakClear::ALL);
+ xLineBreakProps->setPropertyValue("Clear", uno::Any(eClear));
+ xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure that the second line "jumps down", below the fly frame:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1024
+ // - Actual : 276
+ // i.e. the line height wasn't the twips value of the 1.806 cm from the file, but was based on
+ // the font size of the text, which is only correct for non-clearing breaks.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart)
+{
+ // Given a document with a fly frame and a character wrapped around it:
+ createSwDoc(DATA_DIRECTORY, "clearing-break-start.fodt");
+ // Insert a clearing break before "X":
+ uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ xCursor->gotoEnd(/*bSelect=*/false);
+ xCursor->goLeft(/*nCount=*/1, /*bSelect=*/false);
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextContent> xLineBreak(
+ xFactory->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xLineBreakProps(xLineBreak, uno::UNO_QUERY);
+ auto eClear = static_cast<sal_Int16>(SwLineBreakClear::ALL);
+ xLineBreakProps->setPropertyValue("Clear", uno::Any(eClear));
+ xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure that the second line "jumps down", below the fly frame:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1024
+ // - Actual : 276
+ // i.e. the line height was too small, but only in case the full line was a fly and a break
+ // portion, without any real content.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeft)
+{
+ // Given a document with two anchored objects (left height is 5cm, right height is 7.5cm) and a
+ // clearing break (type=left):
+ loadURL("private:factory/swriter", nullptr);
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ {
+ uno::Reference<drawing::XShape> xShape(
+ xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
+ xShape->setSize(awt::Size(5000, 5000));
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ xShapeProps->setPropertyValue("AnchorType",
+ uno::Any(text::TextContentAnchorType_AT_CHARACTER));
+ uno::Reference<text::XTextContent> xShapeContent(xShape, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xShapeContent, /*bAbsorb=*/false);
+ }
+ {
+ uno::Reference<drawing::XShape> xShape(
+ xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
+ xShape->setSize(awt::Size(5000, 7500));
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ xShapeProps->setPropertyValue("AnchorType",
+ uno::Any(text::TextContentAnchorType_AT_CHARACTER));
+ xShapeProps->setPropertyValue("HoriOrientPosition", uno::Any(sal_Int32(10000)));
+ uno::Reference<text::XTextContent> xShapeContent2(xShape, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xShapeContent2, /*bAbsorb=*/false);
+ }
+ uno::Reference<text::XTextContent> xLineBreak(
+ xFactory->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xLineBreakProps(xLineBreak, uno::UNO_QUERY);
+ auto eClear = static_cast<sal_Int16>(SwLineBreakClear::LEFT);
+ xLineBreakProps->setPropertyValue("Clear", uno::Any(eClear));
+ xText->insertString(xCursor, "foo", /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+ xText->insertString(xCursor, "bar", /*bAbsorb=*/false);
+
+ // When laying out that document:
+ calcLayout();
+
+ // Then make sure the "bar" jumps down below the left shape, but not below the right shape (due
+ // to type=left):
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2837
+ // - Actual : 4254
+ // i.e. any non-none type was handled as type=all, and this was jumping below both shapes.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "2837");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeftRTL)
+{
+ // Given a document with an anchored object in an RTL para and a clearing break (type=left):
+ loadURL("private:factory/swriter", nullptr);
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<beans::XPropertySet> xCursorProps(xCursor, uno::UNO_QUERY);
+ xCursorProps->setPropertyValue("WritingMode", uno::Any(text::WritingMode2::RL_TB));
+ {
+ uno::Reference<drawing::XShape> xShape(
+ xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
+ xShape->setSize(awt::Size(5000, 5000));
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ xShapeProps->setPropertyValue("AnchorType",
+ uno::Any(text::TextContentAnchorType_AT_CHARACTER));
+ uno::Reference<text::XTextContent> xShapeContent(xShape, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xShapeContent, /*bAbsorb=*/false);
+ }
+ uno::Reference<text::XTextContent> xLineBreak(
+ xFactory->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xLineBreakProps(xLineBreak, uno::UNO_QUERY);
+ auto eClear = static_cast<sal_Int16>(SwLineBreakClear::RIGHT);
+ xLineBreakProps->setPropertyValue("Clear", uno::Any(eClear));
+ xText->insertString(xCursor, "foo", /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+ xText->insertString(xCursor, "bar", /*bAbsorb=*/false);
+
+ // When laying out that document:
+ calcLayout();
+
+ // Then make sure the "bar" does not jump down (due to type=left && RTL):
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 276
+ // - Actual : 2837
+ // i.e. left/right was not ignored in the RTL case.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "276");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakVertical)
+{
+ // Given a document with an anchored object in a vertical page and a clearing break (type=all):
+ loadURL("private:factory/swriter", nullptr);
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ xStandard->setPropertyValue("WritingMode", uno::Any(text::WritingMode2::TB_RL));
+ {
+ uno::Reference<drawing::XShape> xShape(
+ xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
+ xShape->setSize(awt::Size(5000, 5000));
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ xShapeProps->setPropertyValue("AnchorType",
+ uno::Any(text::TextContentAnchorType_AT_CHARACTER));
+ uno::Reference<text::XTextContent> xShapeContent(xShape, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xShapeContent, /*bAbsorb=*/false);
+ }
+ uno::Reference<text::XTextContent> xLineBreak(
+ xFactory->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xLineBreakProps(xLineBreak, uno::UNO_QUERY);
+ auto eClear = static_cast<sal_Int16>(SwLineBreakClear::ALL);
+ xLineBreakProps->setPropertyValue("Clear", uno::Any(eClear));
+ xText->insertString(xCursor, "foo", /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+ xText->insertString(xCursor, "bar", /*bAbsorb=*/false);
+
+ // When laying out that document:
+ calcLayout();
+
+ // Then make sure the "bar" does jump (logic) down the correct amount:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2837
+ // - Actual : 7135
+ // i.e. the expected break height is the twips value of the 5cm rectangle size, it was much
+ // more.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]/SwBreakPortion", "height", "2837");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakHeader)
+{
+ // Given a document with a shape in the header and a clearing break in the body text:
+ createSwDoc(DATA_DIRECTORY, "clearing-break-header.fodt");
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure that the shape from the header is ignored while calculating the line height:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 276
+ // - Actual : 15398
+ // i.e. the shape was in the background, but we failed to ignore it for the break portion.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "276");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testAsCharImageDocModelFromViewPoint)
+{
+ // Given a document with an as-char image:
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xTextGraphic(
+ xFactory->createInstance("com.sun.star.text.TextGraphicObject"), uno::UNO_QUERY);
+ // Only set the anchor type, the actual bitmap content is not interesting.
+ xTextGraphic->setPropertyValue("AnchorType",
+ uno::Any(text::TextContentAnchorType_AS_CHARACTER));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xBodyText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor(xBodyText->createTextCursor());
+ uno::Reference<text::XTextContent> xTextContent(xTextGraphic, uno::UNO_QUERY);
+ xBodyText->insertTextContent(xCursor, xTextContent, false);
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ SwRootFrame* pRootFrame = pWrtShell->GetLayout();
+ SwFrame* pPageFrame = pRootFrame->GetLower();
+ SwFrame* pBodyFrame = pPageFrame->GetLower();
+ SwFrame* pTextFrame = pBodyFrame->GetLower();
+ const SwSortedObjs& rSortedObjs = *pTextFrame->GetDrawObjs();
+ const SwAnchoredObject* pAnchoredObject = rSortedObjs[0];
+ // The content points to the start node, the next node is the graphic node.
+ SwNodeIndex aGraphicNode = *pAnchoredObject->GetFrameFormat().GetContent().GetContentIdx();
+ ++aGraphicNode;
+ tools::Rectangle aFlyFrame = pAnchoredObject->GetDrawObj()->GetLastBoundRect();
+ Point aDocPos = aFlyFrame.Center();
+
+ // When translating the view point to the model position:
+ pWrtShell->SttCursorMove();
+ pWrtShell->CallSetCursor(&aDocPos, /*bOnlyText=*/false);
+ pWrtShell->EndCursorMove();
+
+ // Then make sure that we find the graphic node, and not its anchor:
+ SwShellCursor* pShellCursor = pWrtShell->getShellCursor(/*bBlock=*/false);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: SwNodeIndex (node 6)
+ // - Actual : SwNodeIndex (node 12)
+ // i.e. the cursor position was the text node hosting the as-char image, not the graphic node of
+ // the image.
+ CPPUNIT_ASSERT_EQUAL(aGraphicNode, pShellCursor->GetMark()->nNode);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
+{
+ // Given a document with A4 paper size, some text, redlining on, but hidden:
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ {
+ // Set page size to A4.
+ size_t nCurIdx = pWrtShell->GetCurPageDesc();
+ SwPageDesc aPageDesc(pWrtShell->GetPageDesc(nCurIdx));
+ SwFrameFormat& rMaster = aPageDesc.GetMaster();
+ SwFormatFrameSize aSize(SwFrameSize::Fixed);
+ aSize.SetSize(Size(11906, 16838));
+ rMaster.SetFormatAttr(aSize);
+ pWrtShell->ChgPageDesc(nCurIdx, aPageDesc);
+ }
+ OUString aBefore("aaaaaaaaa aaaaaaaaaa aa aa aa ");
+ OUString aDelete("delete eeeeeeeeeee ee eeeeeeeeeee ee eeeeee");
+ pWrtShell->Insert(aBefore + " " + aDelete
+ + " zz zzz zzzzzzzzz zzz zzzz zzzz zzzzzzzzz zzzzzz zzz zzzzzzzzzzz zzz");
+ // Enable redlining.
+ pDocShell->SetChangeRecording(/*bActivate=*/true);
+ // Hide redlining.
+ pWrtShell->StartAllAction();
+ pWrtShell->GetLayout()->SetHideRedlines(true);
+ pWrtShell->EndAllAction();
+
+ // When deleting content in the middle of the paragraph:
+ pWrtShell->SttEndDoc(/*bStt=*/true);
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/aBefore.getLength(),
+ /*bBasicCall=*/false);
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, /*nCount=*/aDelete.getLength(),
+ /*bBasicCall=*/false);
+ // Without the accompanying fix in place, this test would have crashed:
+ pWrtShell->Delete();
+
+ // Then make sure that the redline is created:
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1),
+ pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionFormat)
+{
+ // Given a document with a single paragraph, direct formatting asks 24pt font size for the
+ // numbering and the text portion:
+ createSwDoc(DATA_DIRECTORY, "number-portion-format.odt");
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure that the numbering portion has the correct font size:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 480
+ // - Actual : 240
+ // i.e. the numbering portion font size was 12pt, not 24pt (but only when the doc had a
+ // bookmark).
+ assertXPath(pXmlDoc, "//Special[@nType='PortionType::Number']", "nHeight", "480");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionNoformat)
+{
+ // Given a document with a numbering and a single paragraph, the entire run is red:
+ createSwDoc(DATA_DIRECTORY, "number-portion-noformat.docx");
+
+ // When laying out that document:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Then make sure that just because the entire run is red, the numbering portion is not red:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: ffffffff (COL_AUTO)
+ // - Actual : 00ff0000 (COL_LIGHTRED)
+ // i.e. the run color affected the color of the number portion in Writer, but not in Word.
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("ffffffff"),
+ getXPath(pXmlDoc, "//Special[@nType='PortionType::Number']/SwFont", "color"));
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */