sw/qa/extras/layout/data/tdf161718.docx  |binary
 sw/qa/extras/layout/layout3.cxx          |   17 +++++++++++++++++
 sw/source/core/text/txtftn.cxx           |    7 +++++++
 sw/source/core/unocore/unostyle.cxx      |    7 +++++++
 vcl/source/filter/png/PngImageReader.cxx |    4 ++--
 5 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 711ba22147f7538e562db397b97527416d0834da
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jun 25 18:47:15 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Jun 26 19:57:31 2024 +0200

    tdf#161718 sw: fix background flys blocking footnotes
    
    The problem is that the document has an unwanted page break on the
    paragraph with the footnote.
    
    The reason is that lcl_GetFootnoteLower() tries to evade flys, but
    doesn't take into account that background flys (Wrap Through) should be
    ignored.
    
    (somehow regression from commit c303981cfd95ce1c3881366023d5495ae2edce97)
    
    Change-Id: I02578f14644e232fac127142fe12801101f87f86
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169530
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 3e845b10be7ae7f2ac91e37fe6404dd390aaa49d)

diff --git a/sw/qa/extras/layout/data/tdf161718.docx 
b/sw/qa/extras/layout/data/tdf161718.docx
new file mode 100644
index 000000000000..240192e07a71
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf161718.docx differ
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index cda801c4334c..4af21b71f964 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -172,6 +172,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128966)
     xmlXPathFreeObject(pXmlObj);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161718)
+{
+    createSwDoc("tdf161718.docx");
+
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+    // everything on one page
+    assertXPath(pXmlDoc, "/root/page/header", 1);
+    assertXPath(pXmlDoc, "/root/page/header/txt/anchored", 1);
+    assertXPath(pXmlDoc, "/root/page/footer", 1);
+    assertXPath(pXmlDoc, "/root/page/ftncont/ftn", 1);
+    assertXPath(pXmlDoc, "/root/page/ftncont/ftn/txt", 1);
+    assertXPath(pXmlDoc, "/root/page/body/txt", 27);
+    assertXPath(pXmlDoc, "/root/page/body/txt/anchored", 1);
+    assertXPath(pXmlDoc, "/root/page", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234)
 {
     createSwDoc("tdf106234.fodt");
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 035158e2bd25..63ac63818083 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -32,6 +32,7 @@
 #include <txtftn.hxx>
 #include <flyfrm.hxx>
 #include <fmtftn.hxx>
+#include <fmtsrnd.hxx>
 #include <ftninfo.hxx>
 #include <charfmt.hxx>
 #include <rowfrm.hxx>
@@ -246,6 +247,12 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* 
pFrame, SwTwips nLower )
             const SwSortedObjs &rObjs = *pStartFrame->GetDrawObjs();
             for (SwAnchoredObject* pAnchoredObj : rObjs)
             {
+                if (pAnchoredObj->GetFrameFormat()->GetSurround().GetSurround()
+                        == text::WrapTextMode_THROUGH)
+                {
+                    continue; // tdf#161718 no effect on text flow, skip
+                }
+
                 SwRect aRect( pAnchoredObj->GetObjRect() );
 
                 auto pFlyFrame = pAnchoredObj->DynCastFlyFrame();
commit 282413c7c74fddd13ed6aff33cefa5ff7fb0336d
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jun 26 19:51:45 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Jun 26 19:51:45 2024 +0200

    vcl,sw: workaround gcc 13 warnings...
    
    Change-Id: Idce5a24e55ab9f41de0da81e86f37aec63336825

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index aaa7b62f8aa3..b90157ddca97 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -717,6 +717,10 @@ public:
     }
 };
 
+#if defined __GNUC__ && !defined __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
 template<SfxStyleFamily eFamily>
 css::uno::Reference<css::style::XStyle> 
StyleFamilyEntry::CreateStyle(SfxStyleSheetBasePool* pBasePool, SwDocShell* 
pDocShell, const OUString& sStyleName)
 {
@@ -746,6 +750,9 @@ css::uno::Reference<css::style::XStyle> 
StyleFamilyEntry::CreateStyle<SfxStyleFa
 {
     return SwXTextCellStyle::CreateXTextCellStyle(pDocShell, sStyleName);
 }
+#if defined __GNUC__ && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
 
 class XStyleFamily : public cppu::WeakImplHelper
 <
diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index 5b92c351d8d2..c90fe40514b9 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -67,7 +67,7 @@ struct PngDestructor
     png_infop pInfo;
 };
 
-#if defined __GNUC__ && __GNUC__ == 8 && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wclobbered"
 #endif
@@ -475,7 +475,7 @@ BinaryDataContainer getMsGifChunk(SvStream& rStream)
             return {};
     }
 }
-#if defined __GNUC__ && __GNUC__ == 8 && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
 

Reply via email to