configure.ac                                     |    2 
 sw/qa/extras/layout/data/table_cell_overlap.fodt |  161 +++++++++++++++++++++++
 sw/qa/extras/layout/layout.cxx                   |   56 ++++++++
 sw/source/core/layout/tabfrm.cxx                 |    7 -
 sw/source/core/layout/wsfrm.cxx                  |    4 
 5 files changed, 228 insertions(+), 2 deletions(-)

New commits:
commit 99e5f8c636a3ece69e8cc6620696c33b3b80d95e
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Feb 11 18:28:42 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Feb 14 18:25:59 2022 +0100

    sw: layout: fix overlapped table rows in --convert-to pdf
    
    If the document is loaded via UI, the first layout action is triggered
    from resizing the Window and the table is positioned properly on the
    first try.
    
    If the document is loaded via --convert-to, only getRendererCount()
    formats the content of the table, and positioning goes wrong.
    
    Somehow the 2 rows of the table in the fly end up on the same Y
    position, because when the text frame in the 1st row is formatted
    and grows from 0 to 230, the already-valid position of the cell
    frame in the 2nd row is not invalidated.
    
    This happens since the earliest version checked, OOo 3.4 beta.
    
    This fix is somewhat similar to commit
    068c133ac41c97652909b88c432e3b73010efc3e
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129851
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit e7874c936dd1ff9b3423eb7477cbee2494535176)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129845
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    (cherry picked from commit 06bb600ce3445abe095b8011ec7e66b33badb4ef)
    
    Change-Id: I3259c440265cfe40dc7731cb4830bfe2487acf38

diff --git a/sw/qa/extras/layout/data/table_cell_overlap.fodt 
b/sw/qa/extras/layout/data/table_cell_overlap.fodt
new file mode 100644
index 000000000000..e9565054de88
--- /dev/null
+++ b/sw/qa/extras/layout/data/table_cell_overlap.fodt
@@ -0,0 +1,161 @@
+<?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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta: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:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:dc="http://purl.org/dc/eleme
 nts/1.1/" xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office: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:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext: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"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
<office:meta><meta:creation-date>2022-02-11T15:45:44.525015226</meta:creation-date><dc:date>2022-02-11T15:51:17.840027874</dc:date><meta:editing-duration>PT5M32S</meta:editing-duration><meta:editing-cycles>4</meta:editing-cycles><meta:generator>LibreOfficeDev/6.3.6.11$Linux_X86_64
 
LibreOffice_project/798c41960be08155f4f9734c6307615ab45c134e</meta:generator><meta:document-statistic
 meta:table-count="1" meta:image-count="0" meta:object-count="0" 
meta:page-count="1" meta:paragraph-count="2" meta:word-count="2" 
meta:character-count="8" meta:non-whitespace-character-count="8"/></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 Devanagari" 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>
+  <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" 
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 Devanagari" 
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" 
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 Devanagari" 
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"/>
+  </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="Boooo" style:family="paragraph" 
style:parent-style-name="Standard" style:master-page-name="">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" 
loext:contextual-spacing="false" fo:line-height="100%" fo:text-align="start" 
style:justify-single-word="false" style:page-number="auto">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties fo:font-size="10pt"/>
+  </style:style>
+  <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: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="16.198cm" table:align="margins"/>
+  </style:style>
+  <style:style style:name="Table1.A" style:family="table-column">
+   <style:table-column-properties style:column-width="16.198cm" 
style:rel-column-width="65535*"/>
+  </style:style>
+  <style:style style:name="Table1.A1" style:family="table-cell">
+   <style:table-cell-properties fo:background-color="transparent" 
fo:padding="0cm" fo:border="none">
+    <style:background-image/>
+   </style:table-cell-properties>
+  </style:style>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Boooo">
+   <style:text-properties fo:font-size="11pt" style:font-size-asian="11pt" 
style:font-size-complex="11pt"/>
+  </style:style>
+  <style:style style:name="T3" style:family="text">
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" 
style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="T4" style:family="text">
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" 
style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="T5" style:family="text">
+   <style:text-properties fo:font-size="10pt" fo:font-weight="bold" 
style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+  </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:protect="position" 
style:vertical-pos="from-top" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="page" 
fo:background-color="#e6e6e6" style:background-transparency="0%" 
draw:fill="solid" draw:fill-color="#e6e6e6" draw:opacity="100%" 
fo:padding="0.199cm" fo:border="0.06pt solid #ffffff" style:shadow="none" 
draw:shadow-opacity="100%"/>
+  </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="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" 
fo:margin-right="2cm" style:writing-mode="lr-tb" 
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: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>
+   <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><draw:frame draw:style-name="fr1" draw:name="Boooo" 
text:anchor-type="page" text:anchor-page-number="1" svg:x="2.2cm" 
svg:y="11.591cm" svg:width="16.6cm" draw:z-index="0">
+    <draw:text-box fo:min-height="2.147cm">
+     <table:table table:name="Table1" table:style-name="Table1">
+      <table:table-column table:style-name="Table1.A"/>
+      <table:table-row>
+       <table:table-cell table:style-name="Table1.A1" 
office:value-type="string">
+        <text:p text:style-name="Boooo"><text:span 
text:style-name="T5">ONE</text:span><text:span 
text:style-name="T3">:</text:span></text:p>
+       </table:table-cell>
+      </table:table-row>
+      <table:table-row>
+       <table:table-cell table:style-name="Table1.A1" 
office:value-type="string">
+        <text:p text:style-name="Boooo"><text:span 
text:style-name="T5">TWO</text:span><text:span 
text:style-name="T4">:</text:span></text:p>
+       </table:table-cell>
+      </table:table-row>
+     </table:table>
+     <text:p text:style-name="P1"/>
+    </draw:text-box>
+   </draw:frame>
+   <text:p text:style-name="Standard"/>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 8760640d86bf..e311e09b6b25 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2993,6 +2993,62 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607)
                 "Portion", "Fax:");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableCellInvalidate)
+{
+    discardDumpedLayout();
+    if (mxComponent.is())
+        mxComponent->dispose();
+
+    OUString const pName("table_cell_overlap.fodt");
+
+    OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + pName);
+
+    // note: must set Hidden property, so that 
SfxFrameViewWindow_Impl::Resize()
+    // does *not* forward initial VCL Window Resize and thereby triggers a
+    // layout which does not happen on soffice --convert-to pdf.
+    std::vector<beans::PropertyValue> aFilterOptions = {
+        { beans::PropertyValue("Hidden", -1, uno::Any(true), 
beans::PropertyState_DIRECT_VALUE) },
+    };
+
+    std::cout << pName << ":\n";
+
+    // inline the loading because currently properties can't be passed...
+    mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument",
+                                  
comphelper::containerToSequence(aFilterOptions));
+    uno::Sequence<beans::PropertyValue> 
props(comphelper::InitPropertySequence({
+        { "FilterName", uno::Any(OUString("writer_pdf_Export")) },
+    }));
+    utl::TempFile aTempFile;
+    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+    xStorable->storeToURL(aTempFile.GetURL(), props);
+
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "top", "6969");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "height", "231");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "top",
+                "6969");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "height",
+                "231");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds",
+                "top", "6969");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds",
+                "height", "231");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "top", "7200");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "height", "231");
+    // this was 6969, causing the overlap
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "top",
+                "7200");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "height",
+                "231");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds",
+                "top", "7200");
+    assertXPath(pXmlDoc, 
"/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds",
+                "height", "231");
+
+    aTempFile.EnableKillingFile();
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607_regression)
 {
     discardDumpedLayout();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 1e496df41395..da38361f596d 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2720,6 +2720,10 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool 
bTst, bool bInfo )
             if ( GetNext() )
             {
                 GetNext()->InvalidatePos_();
+                if (GetNext()->IsRowFrame())
+                {   // also invalidate first cell
+                    
static_cast<SwLayoutFrame*>(GetNext())->Lower()->InvalidatePos_();
+                }
                 if ( GetNext()->IsContentFrame() )
                     GetNext()->InvalidatePage( pPage );
             }
commit 99a2affa40d0bad3b855a3a4d1d4c0d83ff9af07
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Feb 10 19:43:08 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Feb 14 18:25:59 2022 +0100

    sw: fix layout loop on soffice --convert-to pdf ooo95698-1.odt
    
    For unknown reasons, this loops since commit
    32902f66e7749b2d06d13f50416be5323a0c0ea9a
    "sw_redlinehide: make layout based Show/Hide mode the default"
    
    The problem is that when page 1 is layouted for the first time, it
    splits into 6 pages, and then the SwTabFrame 47 decides that it wants
    to move its follow flow line because it fits onto page 1.
    
    Then splitting the SwTabFrame again fails, but for this
    RemoveFollowFlowLine() was called a 2nd time and removed the one on
    page 3.
    
    The result is a layout with content on page 1, nothing on page 2, 3
    and again content on page 4.  This seems to reoccur every time page 1
    is formatted.
    
    But the first RemoveFollowFlowLine() was wrong because
    CalcHeightOfFirstContentLine() returns 0 because
    lcl_CalcHeightOfFirstContentLine() didn't handle the case of
    SwSectionFrame containing SwTabFrame.
    
    This is similar to commit e024cad7c1365da6a198656c3ca0c32b28938e87
    doing the same thing for text frames in section.
    
    Change-Id: I23fb4d1d56622039f461bb2d357a9c88db140605
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129800
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit b4271e028686d729189afc5e42a9c310f81144f3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129828
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 60811f97c753360393f52aa747837db15a722162)

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index a27b7d3c1c22..49d7441dae06 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5517,9 +5517,12 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const 
SwRowFrame& rSourceLine )
                 const SwRowFrame* pTmpSourceRow = static_cast<const 
SwRowFrame*>(pCurrSourceCell->Lower());
                 nTmpHeight = lcl_CalcHeightOfFirstContentLine( *pTmpSourceRow 
);
             }
-            else if ( pTmp->IsTabFrame() )
+            else if (pTmp->IsTabFrame() || (pTmp->IsSctFrame() && 
pTmp->GetLower() && pTmp->GetLower()->IsTabFrame()))
             {
-                nTmpHeight = static_cast<const 
SwTabFrame*>(pTmp)->CalcHeightOfFirstContentLine();
+                SwTabFrame const*const pTabFrame(pTmp->IsTabFrame()
+                        ? static_cast<SwTabFrame const*>(pTmp)
+                        : static_cast<SwTabFrame const*>(pTmp->GetLower()));
+                nTmpHeight = pTabFrame->CalcHeightOfFirstContentLine();
             }
             else if (pTmp->IsTextFrame() || (pTmp->IsSctFrame() && 
pTmp->GetLower() && pTmp->GetLower()->IsTextFrame()))
             {
commit a7ad317cd5e77d7eefb9dd48d878fd0556cd80bc
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon May 31 13:30:37 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Feb 14 18:25:59 2022 +0100

    Adapt to hamcrest-2.2-3.fc35.noarch.rpm
    
    Change-Id: Ibddfc30a5f0828ab77235ec1155f1c2e1eef24ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116506
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit e6c25186c8584f68b5f8074004556bd855200fff)

diff --git a/configure.ac b/configure.ac
index f10da12b60d3..6022e38b04a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12064,6 +12064,8 @@ if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; 
then
                 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
             elif test -e /usr/share/java/hamcrest/core.jar; then
                 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
+            elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
+                HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
             else
                 HAMCREST_JAR=/usr/share/java/hamcrest.jar
             fi

Reply via email to