sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt |  334 +++++++++++++++++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx       |  102 +++++++
 sw/source/filter/ww8/wrtw8nds.cxx                |    8 
 3 files changed, 442 insertions(+), 2 deletions(-)

New commits:
commit 3885348e2cbd4170f6c183927d01b1934e4d4fa0
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Thu Feb 27 14:59:50 2020 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Mar 10 11:35:15 2020 +0100

    sw: DOCX export: fix first-line indent of list items
    
    The problem is that since CVS import, if a SwTextNode has a first-line
    indent and is in a list or outline that has LABEL_WIDTH_AND_POSITION
    mode, then MSWordExportBase::OutputTextNode() will throw away the node's
    first-line indent and overwrite it with the numbering's.
    
    Experiments indicate that adding the numbering's value to the node's
    value fixes most cases, but RTL still doesn't work in many cases.
    
    Change-Id: I9707f475dac4e501642ebaf51c0117107fd34a3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89634
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 74e3c95b9b628a0b326790b62b4e378a12d02997)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89642
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt 
b/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt
new file mode 100644
index 000000000000..715fbcde8bfc
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
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: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:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
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:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xm
 lns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:officeooo="http://openoffice.org/2009/office"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+  <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" 
style:font-charset="x-symbol"/>
+  <style:font-face style:name="Arial" svg:font-family="Arial"/>
+  <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+  <style:font-face style:name="Lucida Sans Unicode" 
svg:font-family="&apos;Lucida Sans Unicode&apos;" style:font-pitch="variable"/>
+  <style:font-face style:name="Tahoma" svg:font-family="Tahoma" 
style:font-pitch="variable"/>
+  <style:font-face style:name="Arial1" svg:font-family="Arial" 
style:font-family-generic="swiss" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#000000" 
draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:writing-mode="lr-tb" 
style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:font-name-asian="Lucida Sans Unicode" 
style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" 
style:font-name-complex="Tahoma" style:font-size-complex="12pt" 
style:language-complex="de" style:country-complex="DE"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" 
style:line-break="strict" style:tab-stop-distance="1.251cm" 
style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:font-name-asian="Lucida Sans Unicode" 
style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" 
style:font-name-complex="Tahoma" style:font-size-complex="12pt" 
style:language-complex="de" style:country-complex="DE" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false"/>
+  </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 fo:font-size="11pt"/>
+  </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="0cm" 
loext:contextual-spacing="false" style:line-height-at-least="0.46cm"/>
+  </style:style>
+  <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" loext:contextual-spacing="false" 
fo:keep-with-next="always"/>
+   <style:text-properties style:font-name="Arial1" fo:font-family="Arial" 
style:font-family-generic="swiss" style:font-pitch="variable" 
fo:font-size="14pt" style:font-name-asian="Lucida Sans Unicode" 
style:font-family-asian="&apos;Lucida Sans Unicode&apos;" 
style:font-pitch-asian="variable" style:font-size-asian="14pt" 
style:font-name-complex="Tahoma" style:font-family-complex="Tahoma" 
style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
+  </style:style>
+  <style:style style:name="List" style:family="paragraph" 
style:parent-style-name="Text_20_body" style:class="list">
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
style:font-name-complex="Tahoma1" style:font-family-complex="Tahoma"/>
+  </style:style>
+  <style:style style:name="Table_20_Contents" style:display-name="Table 
Contents" style:family="paragraph" style:parent-style-name="Standard" 
style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+  </style:style>
+  <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:class="text">
+   <style:text-properties fo:font-size="115%" fo:font-weight="bold" 
style:font-size-asian="115%" style:font-weight-asian="bold" 
style:font-size-complex="115%" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Heading_20_2" style:display-name="Heading 2" 
style:family="paragraph" style:parent-style-name="Heading" 
style:next-style-name="Text_20_body" style:default-outline-level="2" 
style:class="text">
+   <style:text-properties fo:font-size="14pt" fo:font-style="italic" 
fo:font-weight="bold" style:font-size-asian="14pt" 
style:font-style-asian="italic" style:font-weight-asian="bold" 
style:font-size-complex="14pt" style:font-style-complex="italic" 
style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Heading_20_3" style:display-name="Heading 3" 
style:family="paragraph" style:parent-style-name="Heading" 
style:next-style-name="Text_20_body" style:default-outline-level="3" 
style:class="text">
+   <style:text-properties fo:font-size="14pt" fo:font-weight="bold" 
style:font-size-asian="14pt" style:font-weight-asian="bold" 
style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering 
Symbols" style:family="text"/>
+  <style:style style:name="Frame" style:family="graphic">
+   <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" 
svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" 
fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" 
style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" 
style:vertical-pos="top" style:vertical-rel="paragraph-content" 
style:horizontal-pos="center" style:horizontal-rel="paragraph-content" 
fo:padding="0.15cm" fo:border="0.06pt solid #000000"/>
+  </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-level-style text:level="2" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+  </text:outline-style>
+  <text:list-style style:name="Numbering_20_123" style:display-name="Numbering 
123">
+   <text:list-level-style-number text:level="1" 
text:style-name="Numbering_20_Symbols" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="2" 
text:style-name="Numbering_20_Symbols" style:num-format="">
+    <style:list-level-properties text:min-label-width="1cm" 
text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="3" 
text:style-name="Numbering_20_Symbols" style:num-format="">
+    <style:list-level-properties text:space-before="1cm" 
text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="4" 
text:style-name="Numbering_20_Symbols" style:num-format="">
+    <style:list-level-properties text:space-before="1cm" 
text:min-label-width="1cm" text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="5" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="6" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:min-label-width="1cm" 
text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="7" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:space-before="1cm" 
text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="8" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:space-before="1cm" 
text:min-label-width="1cm" text:min-label-distance="0.381cm"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="9" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:min-label-distance="0.381cm" 
fo:text-align="end"/>
+   </text:list-level-style-number>
+   <text:list-level-style-number text:level="10" 
text:style-name="Numbering_20_Symbols" style:num-suffix="." 
style:num-format="1">
+    <style:list-level-properties text:min-label-distance="0.381cm" 
fo:text-align="end"/>
+   </text:list-level-style-number>
+  </text:list-style>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Table_20_Contents">
+  </style:style>
+  <style:style style:name="P2" style:family="paragraph" 
style:parent-style-name="List" style:list-style-name="Numbering_20_123">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-indent="-0.704cm" style:auto-text-indent="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+  </style:style>
+  <style:style style:name="P6" style:family="paragraph" 
style:parent-style-name="List" style:list-style-name="Numbering_20_123">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-align="end" style:justify-single-word="false" fo:text-indent="-0.704cm" 
style:auto-text-indent="false" style:writing-mode="rl-tb">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+  </style:style>
+  <style:style style:name="P8" style:family="paragraph" 
style:parent-style-name="List" style:list-style-name="Numbering_20_123">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-indent="0.741cm" style:auto-text-indent="false"/>
+  </style:style>
+  <style:style style:name="P11" style:family="paragraph" 
style:parent-style-name="List" style:list-style-name="Numbering_20_123">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-align="end" style:justify-single-word="false" fo:text-indent="0.741cm" 
style:auto-text-indent="false" style:writing-mode="rl-tb"/>
+  </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.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" 
fo:margin-right="2.221cm" style:shadow="none" fo:background-color="transparent" 
style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" 
style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" 
style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" 
style:layout-grid-ruby-below="false" style:layout-grid-print="false" 
style:layout-grid-display="false" draw:fill="none" draw:fill-color="#99ccff" 
style:footnote-max-height="0cm">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="none" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style>
+    <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" 
fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+   </style:header-style>
+   <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" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" 
fo:margin-right="2.221cm" style:shadow="none" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" 
style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" 
style:layout-grid-mode="none" style:layout-grid-ruby-below="false" 
style:layout-grid-print="false" style:layout-grid-display="false" 
style:footnote-max-height="0cm">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="none" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style>
+    <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" 
fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+   </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:master-page>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
+   <text:sequence-decls>
+    <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+   </text:sequence-decls>
+   <text:list xml:id="list2248535956" text:style-name="Numbering_20_123">
+    <text:list-item>
+     <text:p text:style-name="P2">III.<text:tab/>Level 1</text:p>
+     <text:list>
+      <text:list-item>
+       <text:p text:style-name="P2">level 2 has width</text:p>
+       <text:list>
+        <text:list-item>
+         <text:p text:style-name="P2">level 3 has indent</text:p>
+         <text:list>
+          <text:list-item>
+           <text:p text:style-name="P2">level 4 has width + indent</text:p>
+          </text:list-item>
+         </text:list>
+        </text:list-item>
+       </text:list>
+      </text:list-item>
+     </text:list>
+    </text:list-item>
+    <text:list-item>
+     <text:p text:style-name="P8">level 1 with positive on para</text:p>
+     <text:list>
+      <text:list-item>
+       <text:p text:style-name="P8">level 2</text:p>
+       <text:list>
+        <text:list-item>
+         <text:p text:style-name="P8">level 3</text:p>
+         <text:list>
+          <text:list-item>
+           <text:p text:style-name="P8">level 4</text:p>
+           <text:list>
+            <text:list-item>
+             <text:p text:style-name="P2">III.<text:tab/>Level 5</text:p>
+             <text:list>
+              <text:list-item>
+               <text:p text:style-name="P2">level 6 has width</text:p>
+               <text:list>
+                <text:list-item>
+                 <text:p text:style-name="P2">level 7 has indent</text:p>
+                 <text:list>
+                  <text:list-item>
+                   <text:p text:style-name="P2">level 8 has width + 
indent</text:p>
+                  </text:list-item>
+                 </text:list>
+                </text:list-item>
+               </text:list>
+              </text:list-item>
+             </text:list>
+            </text:list-item>
+            <text:list-item>
+             <text:p text:style-name="P8">level 5 with positive on 
para</text:p>
+             <text:list>
+              <text:list-item>
+               <text:p text:style-name="P8">level 6</text:p>
+               <text:list>
+                <text:list-item>
+                 <text:p text:style-name="P8">level 7</text:p>
+                 <text:list>
+                  <text:list-item>
+                   <text:p text:style-name="P8">level 8</text:p>
+                  </text:list-item>
+                 </text:list>
+                </text:list-item>
+               </text:list>
+              </text:list-item>
+             </text:list>
+            </text:list-item>
+           </text:list>
+          </text:list-item>
+         </text:list>
+        </text:list-item>
+       </text:list>
+      </text:list-item>
+     </text:list>
+    </text:list-item>
+   </text:list>
+   <text:p text:style-name="P1"/>
+   <text:list xml:id="list131919252068408" text:continue-numbering="true" 
text:style-name="Numbering_20_123">
+    <text:list-item>
+     <text:p text:style-name="P6">III.<text:tab/>Level 1</text:p>
+     <text:list>
+      <text:list-item>
+       <text:p text:style-name="P6">level 2 has width</text:p>
+       <text:list>
+        <text:list-item>
+         <text:p text:style-name="P6">level 3 has indent</text:p>
+         <text:list>
+          <text:list-item>
+           <text:p text:style-name="P6">level 4 has width + indent</text:p>
+          </text:list-item>
+         </text:list>
+        </text:list-item>
+       </text:list>
+      </text:list-item>
+     </text:list>
+    </text:list-item>
+    <text:list-item>
+     <text:p text:style-name="P11">level 1 with positive on para</text:p>
+     <text:list>
+      <text:list-item>
+       <text:p text:style-name="P11">level 2</text:p>
+       <text:list>
+        <text:list-item>
+         <text:p text:style-name="P11">level 3</text:p>
+         <text:list>
+          <text:list-item>
+           <text:p text:style-name="P11">level 4</text:p>
+           <text:list>
+            <text:list-item>
+             <text:p text:style-name="P6">III.<text:tab/>Level 5</text:p>
+             <text:list>
+              <text:list-item>
+               <text:p text:style-name="P6">level 6 has width</text:p>
+               <text:list>
+                <text:list-item>
+                 <text:p text:style-name="P6">level 7 has indent</text:p>
+                 <text:list>
+                  <text:list-item>
+                   <text:p text:style-name="P6">level 8 has width + 
indent</text:p>
+                  </text:list-item>
+                 </text:list>
+                </text:list-item>
+               </text:list>
+              </text:list-item>
+             </text:list>
+            </text:list-item>
+            <text:list-item>
+             <text:p text:style-name="P11">level 5 with positive on 
para</text:p>
+             <text:list>
+              <text:list-item>
+               <text:p text:style-name="P11">level 6</text:p>
+               <text:list>
+                <text:list-item>
+                 <text:p text:style-name="P11">level 7</text:p>
+                 <text:list>
+                  <text:list-item>
+                   <text:p text:style-name="P11">level 8</text:p>
+                  </text:list-item>
+                 </text:list>
+                </text:list-item>
+               </text:list>
+              </text:list-item>
+             </text:list>
+            </text:list-item>
+           </text:list>
+          </text:list-item>
+         </text:list>
+        </text:list-item>
+       </text:list>
+      </text:list-item>
+     </text:list>
+    </text:list-item>
+   </text:list>
+   <text:p text:style-name="P1"/>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index d4aa8d886626..7ec5da49be9f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -934,6 +934,108 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125546, 
"tdf125546.docx")
     assertXPath(pXmlDoc, "//w:rPrChange", 2);
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLabelWidthAndPosition_Left_FirstLineIndent,
 "Hau_min_list2.fodt")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    // list is LABEL_WIDTH_AND_POSITION with SvxAdjust::Left
+    // I) LTR
+    // a) all LTR cases with no number text look good in Word
+    // 1) negative first line indent on paragraph:
+    // no list width/indent: this one was 0 previously; this looks good
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "end", "0");
+    // list width:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "hanging", 
"966");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "end", "0");
+    // list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "end", "0");
+    // list width + list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "start", 
"1134");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "hanging", 
"966");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "end", "0");
+    // 2) positive first line indent on paragraph:
+    // no list width/indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "firstLine", 
"420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "end", "0");
+    // list width:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "hanging", 
"147");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "end", "0");
+    // list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "firstLine", 
"420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "end", "0");
+    // list width + list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "start", 
"1134");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "hanging", 
"147");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "end", "0");
+    // b) all LTR cases with number text: the indent looks good but some tabs 
are wrong
+    // 1) negative first line indent on paragraph:
+    // no list width/indent: this one was 0 previously; this looks good
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "end", "0");
+    // list width:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "hanging", 
"966");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "end", "0");
+    // list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "end", "0");
+    // list width + list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "start", 
"1134");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "hanging", 
"966");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "end", "0");
+    // 2) positive first line indent on paragraph:
+    // no list width/indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", 
"firstLine", "420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "end", "0");
+    // list width:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "hanging", 
"147");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "end", "0");
+    // list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "start", 
"567");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", 
"firstLine", "420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "end", "0");
+    // list width + list indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "start", 
"1134");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "hanging", 
"147");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "end", "0");
+    // (w:p[17] is empty)
+    // I) RTL
+    // a) only RTL cases with no number text and no width/indent look good in 
Word
+    // 1) negative first line indent on paragraph:
+    // no list width/indent
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "end", "0");
+    // 2) positive first line indent on paragraph:
+    // no list width/indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", 
"firstLine", "420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "end", "0");
+    // b) RTL cases with number text: the indent looks good but some tabs are 
wrong
+    // 1) negative first line indent on paragraph:
+    // no list width/indent
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "hanging", 
"399");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "end", "0");
+    // 2) positive first line indent on paragraph:
+    // no list width/indent:
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "start", 
"0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", 
"firstLine", "420");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "end", "0");
+    // TODO: other cases
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124604, "tdf124604.docx")
 {
     xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index cac4cdf247e1..05a50e7f8b68 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2816,9 +2816,13 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode 
)
                                             
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
                     {
                         if (bParaRTL)
-                            
aLR.SetTextFirstLineOfstValue(pFormat->GetAbsLSpace() - 
pFormat->GetFirstLineOffset()); //TODO: overflow
+                        {
+                            
aLR.SetTextFirstLineOfstValue(aLR.GetTextFirstLineOfst() + 
pFormat->GetAbsLSpace() - pFormat->GetFirstLineOffset()); //TODO: overflow
+                        }
                         else
-                            
aLR.SetTextFirstLineOfst(GetWordFirstLineOffset(*pFormat));
+                        {
+                            
aLR.SetTextFirstLineOfst(aLR.GetTextFirstLineOfst() + 
GetWordFirstLineOffset(*pFormat));
+                        }
                     }
 
                     // correct fix for issue i94187
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to