summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-05 18:27:35 +0200
committerAndras Timar <andras.timar@collabora.com>2022-04-09 12:31:12 +0200
commit5c9bc4f119728a327f03c9a1964094be6dd1af60 (patch)
treea39035f2754dbda7e6991a6f03b092d439ab4c88 /sw/qa/extras/uiwriter
parentfb16fc44a57bce38781f6dc0c4055425b847ace9 (diff)
sw: fix expansion of SetGetExpField in headers with split table rows
The problem is that a get field in a header on page N may calculate and show values that do not take into account a set field on page N-1. This happens if a table row with multiple columns is split across the pages: SwGetExpField::ChangeExpansion() calls GetBodyTextNode(), which returns the first node in the first column that is on page N, but in the SwNodes array this node is *before* any node in columns 2..M, any of which may be on page N-1 in the layout. So try to fix this by adding a page number to SetGetExpField and using that as the highest priority in operator<(). This is a bit risky because some of the places that create SetGetExpField don't have a frame to get the page number from; try to adapt all that call into MakeFieldList(), while leaving unrelated ones such as in MakeSetList() unchanged. Change-Id: Ied2a897ad34f0faf1ef3d50baad07b23fafd49bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132641 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132645 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/data/variable-field-table-row-split-header.fodt270
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx73
2 files changed, 343 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/variable-field-table-row-split-header.fodt b/sw/qa/extras/uiwriter/data/variable-field-table-row-split-header.fodt
new file mode 100644
index 000000000000..9d3668b6b2ee
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/variable-field-table-row-split-header.fodt
@@ -0,0 +1,270 @@
+<?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:meta><meta:creation-date>2022-04-06T17:07:05.947362063</meta:creation-date><dc:date>2022-04-06T17:17:45.832216066</dc:date><meta:editing-duration>PT10M42S</meta:editing-duration><meta:editing-cycles>2</meta:editing-cycles><meta:generator>LibreOfficeDev/7.4.0.0.alpha0$Linux_X86_64 LibreOffice_project/a5b31508f860f07ec86cda3cf992fcea2bee68ef</meta:generator><meta:document-statistic meta:table-count="1" meta:image-count="0" meta:object-count="0" meta:page-count="5" meta:paragraph-count="7" meta:word-count="7" meta:character-count="15" meta:non-whitespace-character-count="15"/></office:meta>
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <draw:gradient draw:name="gradient" draw:style="linear" draw:start-color="#000000" draw:end-color="#ffffff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0deg" draw:border="0%"/>
+ <draw:hatch draw:name="hatch" draw:style="single" draw:color="#3465a4" draw:distance="0.02cm" draw:rotation="0"/>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" 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%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:orphans="2" fo:widows="2" 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="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" 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: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 fo:orphans="0" fo:widows="0" text:number-lines="false" text:line-number="0"/>
+ </style:style>
+ <style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0">
+ <style:tab-stops>
+ <style:tab-stop style:position="3.249cm" style:type="center"/>
+ <style:tab-stop style:position="6.5cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Header" style:family="paragraph" style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0">
+ <style:tab-stops>
+ <style:tab-stop style:position="3.249cm" style:type="center"/>
+ <style:tab-stop style:position="6.5cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Footer" style:family="paragraph" style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0">
+ <style:tab-stops>
+ <style:tab-stop style:position="3.249cm" style:type="center"/>
+ <style:tab-stop style:position="6.5cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <text:outline-style style:name="Outline">
+ <text:outline-level-style text:level="1" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="2" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="3" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="4" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="5" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="6" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="7" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="8" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="9" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="10" style:num-format="">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ </text:outline-style>
+ <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
+ <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
+ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table1" style:family="table">
+ <style:table-properties style:width="6.5cm" table:align="margins"/>
+ </style:style>
+ <style:style style:name="Table1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="3.251cm" style:rel-column-width="32767*"/>
+ </style:style>
+ <style:style style:name="Table1.A1" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
+ </style:style>
+ <style:style style:name="Table1.B1" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border="0.5pt solid #000000"/>
+ </style:style>
+ <style:style style:name="Table1.A2" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
+ </style:style>
+ <style:style style:name="Table1.B2" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:break-before="page"/>
+ </style:style>
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:text-properties/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="10.5cm" fo:page-height="14.801cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm" loext:margin-gutter="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:header-footer-properties fo:min-height="0cm" fo:margin-bottom="0.499cm" fo:background-color="transparent" draw:fill="none"/>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0cm" fo:margin-top="0.499cm" fo:background-color="transparent" draw:fill="none"/>
+ </style:footer-style>
+ </style:page-layout>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ <style:header>
+ <text:p text:style-name="Header"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">4</text:variable-get></text:p>
+ </style:header>
+ <style:footer>
+ <text:p text:style-name="Footer"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">4</text:variable-get></text:p>
+ </style:footer>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text text:use-soft-page-breaks="true">
+ <text:variable-decls>
+ <text:variable-decl office:value-type="float" text:name="CARRYOVER_VALUE"/>
+ </text:variable-decls>
+ <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>
+ <table:table table:name="Table1" table:style-name="Table1">
+ <table:table-column table:style-name="Table1.A" table:number-columns-repeated="2"/>
+ <table:table-row table:style-name="TableLine213872096">
+ <table:table-cell table:style-name="Table1.A1" office:value-type="string">
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"><text:soft-page-break/></text:p>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ </table:table-cell>
+ <table:table-cell table:style-name="Table1.B1" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">0</text:variable-get><text:variable-set text:name="CARRYOVER_VALUE" office:value-type="float" office:value="1" style:data-style-name="N0">1</text:variable-set><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">1</text:variable-get></text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row table:style-name="TableLine213872096">
+ <table:table-cell table:style-name="Table1.A2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"><text:soft-page-break/></text:p>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ <table:table-cell table:style-name="Table1.B2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">1</text:variable-get><text:variable-set text:name="CARRYOVER_VALUE" office:value-type="float" office:value="2" style:data-style-name="N0">2</text:variable-set><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">2</text:variable-get></text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row table:style-name="TableLine213872096">
+ <table:table-cell table:style-name="Table1.A2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"><text:soft-page-break/></text:p>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ <table:table-cell table:style-name="Table1.B2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">2</text:variable-get><text:variable-set text:name="CARRYOVER_VALUE" office:value-type="float" office:value="3" style:data-style-name="N0">3</text:variable-set><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">3</text:variable-get></text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row table:style-name="TableLine213872096">
+ <table:table-cell table:style-name="Table1.A2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ <table:table-cell table:style-name="Table1.B2" office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">3</text:variable-get><text:variable-set text:name="CARRYOVER_VALUE" office:value-type="float" office:value="4" style:data-style-name="N0">4</text:variable-set><text:variable-get text:name="CARRYOVER_VALUE" style:data-style-name="N0">4</text:variable-get></text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <text:p text:style-name="Standard"/>
+ <text:p text:style-name="Standard"/>
+ <text:p text:style-name="P1"/>
+ </office:text>
+ </office:body>
+</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 13d62a49ef58..03b2bc92b307 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -84,6 +84,79 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145731)
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader)
+{
+ SwDoc* const pDoc = createSwDoc(DATA_DIRECTORY, "variable-field-table-row-split-header.fodt");
+
+ // finish layout
+ Scheduler::ProcessEventsToIdle();
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // the fields in cell are: variable-get variable-set variable-get
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[1]", "rText", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[2]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[3]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Special[1]", "rText", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/Special[1]", "rText", "1");
+ // here the header had shown the wrong value
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[2]/header/txt[1]/Special[1]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[2]/footer/txt[1]/Special[1]", "rText", "2");
+
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[3]/header/txt[1]/Special[1]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[3]/footer/txt[1]/Special[1]", "rText", "3");
+
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[4]/header/txt[1]/Special[1]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[4]/footer/txt[1]/Special[1]", "rText", "4");
+
+ assertXPath(pXmlDoc, "/root/page[5]/header/txt[1]/Special[1]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[5]/footer/txt[1]/Special[1]", "rText", "4");
+
+ discardDumpedLayout();
+ // update and check again
+ pDoc->getIDocumentFieldsAccess().UpdateFields(true);
+ Scheduler::ProcessEventsToIdle();
+ pXmlDoc = parseLayoutDump();
+
+ // the fields in cell are: variable-get variable-set variable-get
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[1]", "rText", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[2]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/Special[3]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Special[1]", "rText", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/Special[1]", "rText", "1");
+ // here the header had shown the wrong value
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[2]/header/txt[1]/Special[1]", "rText", "1");
+ assertXPath(pXmlDoc, "/root/page[2]/footer/txt[1]/Special[1]", "rText", "2");
+
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[3]/header/txt[1]/Special[1]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[3]/footer/txt[1]/Special[1]", "rText", "3");
+
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[1]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[2]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/Special[3]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[4]/header/txt[1]/Special[1]", "rText", "3");
+ assertXPath(pXmlDoc, "/root/page[4]/footer/txt[1]/Special[1]", "rText", "4");
+
+ assertXPath(pXmlDoc, "/root/page[5]/header/txt[1]/Special[1]", "rText", "4");
+ assertXPath(pXmlDoc, "/root/page[5]/footer/txt[1]/Special[1]", "rText", "4");
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
{
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129382.docx");