[Libreoffice-commits] core.git: Branch 'refs/tags/cib-6.4-20' - 740 commits - basctl/source basctl/uiconfig bin/check-elf-dynamic-objects bin/distro-install-file-lists bin/symstore.sh brand/cib canvas/source chart2/source chart2/uiconfig comphelper/source compilerplugins/clang config_host/config_global.h.in config_host.mk.in configmgr/source configure.ac connectivity/Library_mysqlc.mk connectivity/source cui/inc cui/source cui/uiconfig dbaccess/source dbaccess/uiconfig desktop/Executable_soffice_safe.mk desktop/Module_desktop.mk desktop/scripts desktop/source desktop/uiconfig desktop/win32 distro-configs/LibreOfficeFlatpak.conf download.lst drawinglayer/source dtrans/Library_dnd.mk dtrans/Library_dtrans.mk dtrans/Library_ftransl.mk dtrans/Library_sysdtrans.mk dtrans/Module_dtrans.mk dtrans/README dtrans/source dtrans/StaticLibrary_dtobj.mk dtrans/test dtrans/util editeng/inc editeng/qa editeng/source embeddedobj/source extensions/uiconfig external/apache-commons external/breakpad external/coinmp external/curl external/expat external/gpgmepp external/harfbuzz external/hsqldb external/icu external/jfreereport external/libassuan external/libffi external/libgpg-error external/libjpeg-turbo external/liblangtag external/libmwaw external/libnumbertext external/libodfgen external/liborcus external/libwpd external/libxml2 external/libxslt external/mariadb-connector-c external/Module_external.mk external/neon external/nss external/openssl external/pdfium external/poppler external/postgresql external/python3 external/redland external/xmlsec external/zlib filter/source forms/source formula/source fpicker/source framework/source framework/uiconfig g .gitreview helpcontent2 hwpfilter/source i18npool/source icon-themes/breeze icon-themes/cib icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/karasa_jaga icon-themes/karasa_jaga_svg icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg icon-themes/tango i nclude/default.rc include/editeng include/jvmfwk include/o3tl include/sal include/sfx2 include/svl include/svtools include/svx include/vcl include/xmloff instsetoo_native/CustomTarget_install.mk instsetoo_native/CustomTarget_setup.mk instsetoo_native/inc_common instsetoo_native/inc_ooohelppack instsetoo_native/util io/source jvmfwk/plugins jvmfwk/source librelogo/source libreofficekit/qa lotuswordpro/qa lotuswordpro/source Makefile.fetch o3tl/CppunitTest_o3tl_tests.mk o3tl/qa odk/build-examples_common.mk offapi/com officecfg/Configuration_officecfg.mk officecfg/files.mk officecfg/registry oox/source postprocess/CustomTarget_registry.mk postprocess/Rdb_services.mk pyuno/source readlicense_oo/license reportbuilder/Jar_reportbuilder.mk reportbuilder/java reportdesign/uiconfig RepositoryExternal.mk Repository.mk RepositoryModule_host.mk sal/osl sc/inc scp2/AutoInstall.mk scp2/inc scp2/InstallModule_python.mk scp2/source sc/qa scripting/Jar_ScriptFramework.mk scripting/java scripting/sou rce sc/source sc/uiconfig sdext/Executable_xpdfimport.mk sdext/source sd/qa sd/source sd/uiconfig setup_native/source sfx2/Library_sfx.mk sfx2/qa sfx2/sdi sfx2/source sfx2/uiconfig shell/source solenv/bin solenv/clang-format solenv/flatpak-manifest.in solenv/gbuild solenv/gdb sot/source starmath/CppunitTest_starmath_qa_cppunit.mk starmath/qa starmath/source starmath/uiconfig svl/source svtools/inc svtools/source svx/source svx/uiconfig sw/CppunitTest_sw_core_attr.mk sw/CppunitTest_sw_core_edit.mk sw/CppunitTest_sw_core_text.mk swext/mediawiki sw/inc sw/Module_sw.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/desktop sysui/productlist.mk test/source toolkit/source tools/source translations ucb/CppunitTest_ucb_webdav_core.mk ucb/CppunitTest_ucb_webdav_local_neon.mk ucb/CppunitTest_ucb_webdav_neon_opts.mk ucb/CppunitTest_ucb_webdav_propfindcache.mk ucb/CppunitTest_ucb_webdav_res_access.mk ucb/Library_ucpdav1.mk ucb/Module_ucb.mk ucb/qa ucb/source unoxml/source uui/s ource vcl/CppunitTest_vcl_filter_ipdf.mk vcl/inc vcl/Library_vclplug_win.mk vcl/Module_vcl.mk vcl/osx vcl/qa vcl/source vcl/unx vcl/vclplug_win.component vcl/win vcl/workben winaccessibility/inc winaccessibility/source wizards/source writerfilter/source xmloff/qa xmloff/source xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk xmlsecurity/inc xmlsecurity/qa xmlsecurity/source xmlsecurity/workben

Tue, 05 Sep 2023 10:48:38 -0700

Rebased ref, commits from common ancestor:
commit ebbcd3d6024203d3c457089fbfda3b9c8132cb5f
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Aug 28 10:13:28 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Aug 28 17:33:12 2023 +0200

    python3: upgrade to release 3.8.18
    
    Fixes CVE-2023-40217
    
    Change-Id: Ie08af471009b7f5c42aa6875dd4f9d886ad1d617
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156183
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit c1586ef57b5770f80ef200ab38ff4538c2dfb145)

diff --git a/configure.ac b/configure.ac
index ec3bdb6e3a19..5e8904798988 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8796,7 +8796,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.17
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.18
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index 8b5d876b4f4e..9b8e9fc07e15 100644
--- a/download.lst
+++ b/download.lst
@@ -480,8 +480,8 @@ POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-PYTHON_SHA256SUM := 
2e54b0c68191f16552f6de2e97a2396540572a219f6bbb28591a137cecc490a9
-PYTHON_TARBALL := Python-3.8.17.tar.xz
+PYTHON_SHA256SUM := 
3ffb71cd349a326ba7b2fadc7e7df86ba577dd9c4917e52a8401adbda7405e3f
+PYTHON_TARBALL := Python-3.8.18.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit 8a21b8d923b8c899675588e14c9b4c9763eb486c
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Aug 28 17:33:01 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Aug 28 17:33:12 2023 +0200

    svx: fix build
    
    Change-Id: I900db1675c110568bc33e4e21babae55a941a626

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 7191743188e1..db9498a726ad 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -38,6 +38,7 @@
 #include <svx/svdoole2.hxx>
 #include <sdr/contact/viewcontactofsdrole2obj.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <sal/log.hxx>
 
 using namespace com::sun::star;
 
commit bfafc863bbe7a4cd576f36db24bf5744f983c025
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Wed Aug 23 16:55:07 2023 +0200
Commit:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
CommitDate: Thu Aug 24 12:40:58 2023 +0200

    Reset buffered GridOffset(s) for suspicious values
    
    Huge offsets of GridOffset(s) are a hint for error -> usually the
    conditions for calculation have changed. E.g. - I saw errors with
    +/-5740, that was in the environment of massive external UNO API
    using LO as target.
    If condtions for this calculation change, it is usually required to
    call
    - ViewObjectContact::resetGridOffset(), or
    - ObjectContact::resetAllGridOffsets() or
    - ScDrawView::resetGridOffsetsForAllSdrPageViews()
    as it is done e.g. when zoom changes (see ScDrawView::RecalcScale()).
    Theoretically these resets have to be done for any precondition
    changed that is used in the calculation of that value (see
    ScDrawView::calculateGridOffsetForSdrObject).
    This is not complete and would be hard to do so. Since it is just a
    buffered value and re-calculation is not expensive (linear O(n)) we
    can just reset suspicious values here  what fixes the problem.
    Hopefully - when that non-linear ViewTransformation problem for the
    calc-view gets solved one day - all this can be removed again. For
    now, let's just reset here and force re-calculation.
    Added a SAL_WARN to inform about this, too.
    
    Change-Id: I09137f7703fd00c2351a288a40bf87a2691ba6e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155983
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index d15ba27dd9f9..7191743188e1 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -461,10 +461,39 @@ drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::getPrimitive2
 // (->View) that has then all needed information
 const basegfx::B2DVector& ViewObjectContact::getGridOffset() const
 {
-    if(0.0 == maGridOffset.getX() && 0.0 == maGridOffset.getY() && 
GetObjectContact().supportsGridOffsets())
+    if (GetObjectContact().supportsGridOffsets())
     {
-        // create on-demand
-        
GetObjectContact().calculateGridOffsetForViewOjectContact(const_cast<ViewObjectContact*>(this)->maGridOffset,
 *this);
+        if (fabs(maGridOffset.getX()) > 1000.0)
+        {
+            // Huge offsets are a hint for error -> usually the conditions for
+            // calculation have changed. E.g. - I saw errors with +/-5740, that
+            // was in the environment of massive external UNO API using LO as
+            // target.
+            // If condtions for this calculation change, it is usually 
required to call
+            // - ViewObjectContact::resetGridOffset(), or
+            // - ObjectContact::resetAllGridOffsets() or
+            // - ScDrawView::resetGridOffsetsForAllSdrPageViews()
+            // as it is done e.g. when zoom changes (see 
ScDrawView::RecalcScale()).
+            // Theoretically these resets have to be done for any precondition
+            // changed that is used in the calculation of that value (see
+            // ScDrawView::calculateGridOffsetForSdrObject).
+            // This is not complete and would be hard to do so.
+            // Since it is just a buffered value and re-calculation is not
+            // expensive (linear O(n)) we can just reset suspicious values 
here.
+            // Hopefully - when that non-linear ViewTransformation problem for
+            // the calc-view gets solved one day - all this can be removed
+            // again. For now, let's just reset here and force re-calculation.
+            // Add a SAL_WARN to inform about this.
+            SAL_WARN("svx", "Suspicious GridOffset value resetted (!)");
+            const_cast<ViewObjectContact*>(this)->maGridOffset.setX(0.0);
+            const_cast<ViewObjectContact*>(this)->maGridOffset.setY(0.0);
+        }
+
+        if(0.0 == maGridOffset.getX() && 0.0 == maGridOffset.getY() && 
GetObjectContact().supportsGridOffsets())
+        {
+            // create on-demand
+            
GetObjectContact().calculateGridOffsetForViewOjectContact(const_cast<ViewObjectContact*>(this)->maGridOffset,
 *this);
+        }
     }
 
     return maGridOffset;
commit e43f09bec7bc1d7f367a9b6f6a8ec001a102645d
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Aug 2 13:26:39 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Aug 3 11:58:03 2023 +0200

    tdf#156546 sw: fix infinite loop in SwUndoInsert::RedoImpl()
    
    The problem is that SwUndoSaveContent::MovePtBackward() sets the point
    of a shell cursor to the document body's start node, which is not a
    valid position for a shell cursor; FindParentText() then loops forever.
    
    The purpose of this appears to be to move the point temporarily
    somewhere where subsequent inserting operations won't move it further,
    so that it can be restored to the start of the inserted stuff.
    
    Refactor a bit to use a temporary SwNodeIndex instead, which should work
    as nothing should delete the node it's pointing to.
    
    (regression from commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda)
    
    Change-Id: I471bcced1741c77c07239ed124d4fd39ff7a7515
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155227
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 2d96d69322ac18f53668b75397c8587f94cd043b)

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 71d9c511591d..42b14f7859e5 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -21,6 +21,7 @@
 
 #include <vector>
 #include <memory>
+#include <optional>
 
 #include <svl/undo.hxx>
 #include <tools/solar.h>
@@ -177,12 +178,11 @@ protected:
                           const sal_uLong* pEndNdIdx = nullptr,
                           bool bForceCreateFrames = false);
 
-    // These two methods move the SPoint back/forth from PaM. With it
-    // a range can be spanned for Undo/Redo. (In this case the SPoint
-    // is before the manipulated range!!)
-    // The flag indicates if there is content before the SPoint.
-    static bool MovePtBackward( SwPaM& rPam );
-    static void MovePtForward( SwPaM& rPam, bool bMvBkwrd );
+    // These two methods save and restore the Point of PaM.
+    // If the point cannot be moved, a "backup" is created on the previous 
node.
+    // Either way, it will not be moved by inserting at its original position.
+    static ::std::optional<SwNodeIndex> MovePtBackward(SwPaM& rPam);
+    static void MovePtForward(SwPaM& rPam, ::std::optional<SwNodeIndex> && 
oMvBkwrd);
 
     // Before moving stuff into UndoNodes-Array care has to be taken that
     // the content-bearing attributes are removed from the nodes-array.
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 098c277d9155..b1ed15e3124d 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -798,30 +798,26 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, 
sal_uLong nNodeIdx,
     }
 }
 
-// These two methods move the Point of Pam backwards/forwards. With that, one
-// can span an area for a Undo/Redo. (The Point is then positioned in front of
-// the area to manipulate!)
-// The flag indicates if there is still content in front of Point.
-bool SwUndoSaveContent::MovePtBackward( SwPaM& rPam )
+// These two methods save and restore the Point of PaM.
+// If the point cannot be moved, a "backup" is created on the previous node.
+// Either way, returned, inserting at its original position will not move it.
+::std::optional<SwNodeIndex> SwUndoSaveContent::MovePtBackward(SwPaM & rPam)
 {
     rPam.SetMark();
     if( rPam.Move( fnMoveBackward ))
-        return true;
+        return {};
 
-    // If there is no content onwards, set Point simply to the previous 
position
-    // (Node and Content, so that Content will be detached!)
-    --rPam.GetPoint()->nNode;
-    rPam.GetPoint()->nContent.Assign( nullptr, 0 );
-    return false;
+    return { SwNodeIndex(rPam.GetPoint()->nNode, -1) };
 }
 
-void SwUndoSaveContent::MovePtForward( SwPaM& rPam, bool bMvBkwrd )
+void SwUndoSaveContent::MovePtForward(SwPaM& rPam, 
::std::optional<SwNodeIndex> && oMvBkwrd)
 {
     // Was there content before this position?
-    if( bMvBkwrd )
+    if (!oMvBkwrd)
         rPam.Move( fnMoveForward );
     else
     {
+        *rPam.GetPoint() = SwPosition(*oMvBkwrd);
         ++rPam.GetPoint()->nNode;
         SwContentNode* pCNd = rPam.GetContentNode();
         if( pCNd )
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index f1f7f48188aa..ff3f4777329c 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -328,7 +328,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & 
rContext)
 
         if( nLen )
         {
-            const bool bMvBkwrd = MovePtBackward( *pPam );
+            ::std::optional<SwNodeIndex> oMvBkwrd = MovePtBackward(*pPam);
 
             if (maText)
             {
@@ -355,7 +355,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & 
rContext)
             nNode = pPam->GetMark()->nNode.GetIndex();
             nContent = pPam->GetMark()->nContent.GetIndex();
 
-            MovePtForward( *pPam, bMvBkwrd );
+            MovePtForward(*pPam, ::std::move(oMvBkwrd));
             pPam->Exchange();
             if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( 
GetRedlineFlags() ))
             {
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 449f41795697..01561018ec56 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -357,15 +357,15 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & 
rContext)
         auto const pFlysAtInsPos(sw::GetFlysAnchoredAt(*pDoc,
             rPam.GetPoint()->nNode.GetIndex()));
 
-        const bool bMvBkwrd = MovePtBackward(rPam);
+        ::std::optional<SwNodeIndex> oMvBkwrd = MovePtBackward(rPam);
 
         // re-insert content again (first detach m_pUndoNodeIndex!)
         sal_uLong const nMvNd = m_pUndoNodeIndex->GetIndex();
         m_pUndoNodeIndex.reset();
         MoveFromUndoNds(*pDoc, nMvNd, *rPam.GetMark());
-        if (m_nDeleteTextNodes != 0)
+        if (m_nDeleteTextNodes != 0 || oMvBkwrd)
         {
-            MovePtForward(rPam, bMvBkwrd);
+            MovePtForward(rPam, ::std::move(oMvBkwrd));
         }
         rPam.Exchange();
 
commit ba44f7c2f4ee0c24bafa388e0c3885986e75c9a3
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jul 18 16:58:34 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Aug 3 11:58:02 2023 +0200

    tdf#146258 sw: invalidate section frame for new text frame at start
    
    SwFlowFrame::CalcUpperSpace() uses the first text frame inside to
    compute the upper margin of section frames.
    
    Before commit 69d2d24b3579ad21fb1ba2746f81a02f8bbfb984 this was
    working because a temporary SwTextFrame for the new SwTextNode was
    created and then deleted again, but while it was alive the SvULSpace
    item was copied and then it invalidated the section frame:
    
    1  SwFrame::InvalidatePrt_()
    2  SwContentFrame::Modify()
        at libreoffice-6-1/sw/source/core/layout/wsfrm.cxx:2336
    3  SwTextFrame::SwClientNotify()
    ...
    7  SwTextNode::Modify()
    8  SwContentNode::SetAttr()
    9  SwTextNode::SetAttr()
    10 SwAttrSet::CopyToModify()
    11 SwTextNode::CopyText()
    12 SwTextNode::CopyText()
    13 SwTextNode::MakeCopy()
    14 SwNodes::CopyNodes()
    15 sw::DocumentContentOperationsManager::CopyWithFlyInFly()
    16 SwIntrnlSectRefLink::DataChanged()
    
    Now however nothing invalidates the section frame, so do it in
    InsertCnt_(), hopefully it works for columned sections too.
    
    (regression from commit 166b5010b402a41b192b1659093a25acf9065fd9)
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154594
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 34b607bb455bd30d3adf8e3f72182c7cc4d062ee)
    [commit 34b607bb455bd30d3adf8e3f72182c7cc4d062ee used wrong issue id]
    
    Change-Id: I339286ac37c9ee9a0bef730a73215bc139386514
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154614
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit b81829dc7aa94e92818d2545cd28f1ef6c298395)

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index d425af7b8b64..764ce58c0098 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1557,6 +1557,16 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
                 pPageMaker->CheckInsert( nIndex );
 
             pFrame->InsertBehind( pLay, pPrv );
+            if (!pPrv)
+            {
+                if (SwSectionFrame *const pSection = pLay->FindSctFrame())
+                {
+                    if (pSection && pSection->ContainsAny() == pFrame)
+                    {   // tdf#146258 section PrtArea depends on paragraph 
upper margin
+                        pSection->InvalidatePrt();
+                    }
+                }
+            }
             // #i27138#
             // notify accessibility paragraphs objects about changed
             // CONTENT_FLOWS_FROM/_TO relation.
commit 580e405f6fac9931c6d6e1ada37fd1ee9d576111
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Jul 17 21:37:07 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Aug 3 11:58:02 2023 +0200

    tdf#153319 sw: don't move footnotes to follow if portions in master
    
    SwTextFrameBreak::IsInside() may be called in different situations,
    during formatting it should be possible to move the footnotes, but when
    called from SwTextFrame::CalcPreps() this is problematic as it does not
    format the lines, it iterates over existing lines.
    
    The problem is that the footnote frame is moved to the follow's page,
    but the footnote portion remains on the master, and then the follow is
    joined while the footnote frame's mpReference still points to it.
    
    (regression from commit 391613785ae6fbb735cf7a86ea2f6a93161a8769)
    
    Change-Id: I4290dcd242a7f5292ad4f50c1407c9cd88e80a6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154557
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 7e9b2b71db72b8c4c9c6ca83d08d3b6b05775ac8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154545
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit f70f822532d96feebd24645009f0368405dac9e4)

diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index df0c779d6dbb..43afbd1e45e6 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -138,6 +138,8 @@ bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine 
) const
         bFit = nDiff >= 0;
 
         if (!bFit && rLine.MaybeHasHints() && m_pFrame->GetFollow()
+            // tdf#153319 RemoveFootnote only works if this frame doesn't
+            && !rLine.GetNext() // contain the footnote portion
             // if using same footnote container as the follow, pointless to 
try?
             && m_pFrame->FindFootnoteBossFrame() != 
m_pFrame->GetFollow()->FindFootnoteBossFrame())
         {
commit 4a5c329e22b7ad52a14ca39028e4a645c1bbbe40
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jul 28 12:13:41 2023 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Fri Jul 28 16:03:34 2023 +0200

    follow python recommendation and pass SSL contexts
    
    i.e. https://docs.python.org/3/library/ssl.html#security-considerations
    
    Change-Id: I67a0f9e1c25abc6644412b014f30933a7e681da2

diff --git a/scripting/source/pyprov/mailmerge.py 
b/scripting/source/pyprov/mailmerge.py
index 079744007816..9b0e35ccdf42 100644
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -49,7 +49,7 @@ from email.utils import formatdate
 from email.utils import parseaddr
 from socket import _GLOBAL_DEFAULT_TIMEOUT
 
-import sys, smtplib, imaplib, poplib
+import sys, ssl, smtplib, imaplib, poplib
 dbg = False
 
 # pythonloader looks for a static g_ImplementationHelper variable
@@ -105,7 +105,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
                if dbg:
                        print("Timeout: " + str(tout), file=dbgout)
                if port == 465:
-                       self.server = smtplib.SMTP_SSL(server, 
port,timeout=tout)
+                       self.server = smtplib.SMTP_SSL(server, port, 
timeout=tout, context=ssl.create_default_context())
                else:
                        self.server = smtplib.SMTP(server, port,timeout=tout)
 
@@ -121,7 +121,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
                        print("ConnectionType: " + connectiontype, file=dbgout)
                if connectiontype.upper() == 'SSL' and port != 465:
                        self.server.ehlo()
-                       self.server.starttls()
+                       
self.server.starttls(context=ssl.create_default_context())
                        self.server.ehlo()
 
                user = xAuthenticator.getUserName()
@@ -325,7 +325,7 @@ class PyMailIMAPService(unohelper.Base, XMailService):
                        print(connectiontype, file=dbgout)
                print("BEFORE", file=dbgout)
                if connectiontype.upper() == 'SSL':
-                       self.server = imaplib.IMAP4_SSL(server, port)
+                       self.server = imaplib.IMAP4_SSL(server, port, 
ssl_context=ssl.create_default_context())
                else:
                        self.server = imaplib.IMAP4(server, port)
                print("AFTER", file=dbgout)
@@ -397,7 +397,7 @@ class PyMailPOP3Service(unohelper.Base, XMailService):
                        print(connectiontype, file=dbgout)
                print("BEFORE", file=dbgout)
                if connectiontype.upper() == 'SSL':
-                       self.server = poplib.POP3_SSL(server, port)
+                       self.server = poplib.POP3_SSL(server, port, 
context=ssl.create_default_context())
                else:
                        tout = xConnectionContext.getValueByName("Timeout")
                        if dbg:
commit dbb6992156773d0be0ea59b3832516f5f16c1f0c
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Fri Jul 28 15:13:08 2023 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Fri Jul 28 15:13:08 2023 +0200

    Bump version to 6.4.0.20
    
    Change-Id: Id3648daeb6ac39b5995629a9ad4aee8ef0dd0857

diff --git a/configure.ac b/configure.ac
index 23cfdfc91927..ec3bdb6e3a19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([CIB Office],[6.4.0.19],[],[],[https://www.cib.de/office/])
+AC_INIT([CIB Office],[6.4.0.20],[],[],[https://www.cib.de/office/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard
commit 53aeaeeeed3c04bbfa33a9363015047554c4cdb6
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Mon Jul 24 21:39:21 2023 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed Jul 26 10:14:36 2023 +0200

    tdf#156354 - Fix UI Basic dialog contents not visible in preview mode
    
    with scrollbars enabled. Basic dialog elemets appear under groupbox
    in case of the dialog have scrollbar.
    
    cherry-pick from commit: 99e6e4dd273752ee671d1ade00b381786800a508
    
    Change-Id: I07b26c4a4f733cb08b3432ee41d829552ec5e08d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154876
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <kelem...@ubuntu.com>
    Reviewed-by: Gabor Kelemen <kelem...@ubuntu.com>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154900
    Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/vcl/source/toolkit/group.cxx b/vcl/source/toolkit/group.cxx
index 0743518f8ba1..f713b1f8fd43 100644
--- a/vcl/source/toolkit/group.cxx
+++ b/vcl/source/toolkit/group.cxx
@@ -60,9 +60,9 @@ void GroupBox::ImplInitSettings( bool bBackground )
     if ( bBackground )
     {
         vcl::Window* pParent = GetParent();
-        if ( (pParent->IsChildTransparentModeEnabled() ||
-              !(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
-             !IsControlBackground() )
+        if (pParent->IsChildTransparentModeEnabled() ||
+            !(pParent->GetStyle() & WB_CLIPCHILDREN) ||
+            !IsControlBackground())
         {
             EnableChildTransparentMode();
             SetParentClipMode( ParentClipMode::NoClip );
commit c1f78108bcb9fe63586f37985e7bcbcf0970537a
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed Jul 12 23:09:45 2023 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue Jul 25 11:05:59 2023 +0200

    Related: tdf#155708 Clean-up - Fix validity dialog closes
    
    Do not close Validation window if click on another Calc sheet.
    
    Follow-up of commits:
    1 - a5c61b143d53bb10430b8a486874856c16a2d86c
    2 - efaa065eb7053954242c83760f897e7dba2e9fe8
    
    Change-Id: I5352ee869f3e8a93b49abec863089f57cdf0aeba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154369
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154831
    Tested-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 65a781d5e598..42c7054eb4de 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -51,6 +51,7 @@ public:
     virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
     virtual void Close() {} // called by the SfxChildWin when the dialog is 
closed
     virtual void EndDialog(int nResponse); // called by the SfxChildWin to 
close the dialog
+    virtual bool CloseOnHide() const { return true; } // called from 
ScValidationDlg
 };
 
 class SfxModelessDialog_Impl;
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 485aa70bbd3e..d3fb36947a83 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -212,8 +212,6 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
-// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
-const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 //! The Macro of the future ...
 #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 9ee85231f609..da10715a777d 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -180,6 +180,8 @@ public:
 
     virtual void EndDialog(int nResponse) override;
 
+    virtual bool CloseOnHide() const override { return false; }
+
     virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override
     {
         if ( m_pHandler && m_pSetReferenceHdl )
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 05257229fd89..97a8c2e43bc2 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -639,7 +639,7 @@ void SfxChildWindow::Show( ShowFlags nFlags )
     {
         if (!xController->getDialog()->get_visible())
         {
-            if (nScValidityWindowSlotID == GetType())
+            if (!xController->CloseOnHide())
             {
                 // tdf#155708 - do not run a new (Async) validation window,
                 // because we already have one in sync mode, just show the 
running one
commit e103944cb7a95fe648d5d3fb53581b32bb0230d6
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Mon Jul 3 19:56:43 2023 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue Jul 18 09:48:17 2023 +0200

    tdf#155708 Fix validity dialog closes when moving focus to another window
    
    Do not close Validation window if click on another Calc sheet.
    
    (cherry picked from commit a5c61b143d53bb10430b8a486874856c16a2d86c)
    and
    (cherry picked from commit efaa065eb7053954242c83760f897e7dba2e9fe8)
    
    Change-Id: I75569cbb91ebd445ac57f7a52d914297c21349e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153930
    Tested-by: Balazs Varga <balazs.varga.ext...@allotropia.de>
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154512
    Tested-by: Gabor Kelemen <kelem...@ubuntu.com>

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index d3fb36947a83..485aa70bbd3e 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -212,6 +212,8 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
+// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
+const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 //! The Macro of the future ...
 #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 150cfb889df8..c9fbd5501a39 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -97,7 +97,13 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, 
const SfxItemSet* pArgSe
 
 void ScValidationDlg::EndDialog(int nResponse)
 {
-    // tdf#137215 ensure original modalality of true is restored before dialog 
loop ends
+    // tdf#155708 - do not close, just hide validation window if we click in 
another sheet
+    if (nResponse == nCloseResponseToJustHide && getDialog()->get_visible())
+    {
+        getDialog()->hide();
+        return;
+    }
+    // tdf#137215 ensure original modality of true is restored before dialog 
loop ends
     if (m_bOwnRefHdlr)
         RemoveRefDlg(true);
     ScValidationDlgBase::EndDialog(nResponse);
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index e2edf6bc5b30..9ee85231f609 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -154,6 +154,8 @@ class ScValidationDlg
     bool    m_bOwnRefHdlr:1;
     bool    m_bRefInputting:1;
 
+    const int nCloseResponseToJustHide = -42;
+
     std::unique_ptr<weld::Container> m_xHBox;
 
     bool    EnterRefStatus();
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 451a4d305df1..05257229fd89 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -639,12 +639,21 @@ void SfxChildWindow::Show( ShowFlags nFlags )
     {
         if (!xController->getDialog()->get_visible())
         {
-            weld::DialogController::runAsync(xController,
-                [this](sal_Int32 nResult) {
-                    if (nResult == nCloseResponseToJustHide)
-                        return;
-                    xController->Close();
-                });
+            if (nScValidityWindowSlotID == GetType())
+            {
+                // tdf#155708 - do not run a new (Async) validation window,
+                // because we already have one in sync mode, just show the 
running one
+                xController->getDialog()->show();
+            }
+            else
+            {
+                weld::DialogController::runAsync(xController,
+                    [this](sal_Int32 nResult) {
+                        if (nResult == nCloseResponseToJustHide)
+                            return;
+                        xController->Close();
+                    });
+            }
         }
     }
     else
commit 09d496b2f57e31631784bb9234ce21961cd52275
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 24 17:10:48 2022 +0000
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue Jul 18 09:47:48 2023 +0200

    tdf#146913 don't destroy the dialog if we just want to hide it
    
    Change-Id: Ie534aba915120d12e65aa965e5435bc7575ecb29
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128879
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154511
    Tested-by: Gabor Kelemen <kelem...@ubuntu.com>
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index fedaa598109c..65a781d5e598 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -50,7 +50,7 @@ public:
     // when the dialog has an associated SfxChildWin, typically for Modeless 
interaction
     virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
     virtual void Close() {} // called by the SfxChildWin when the dialog is 
closed
-    virtual void EndDialog(); // called by the SfxChildWin to close the dialog
+    virtual void EndDialog(int nResponse); // called by the SfxChildWin to 
close the dialog
 };
 
 class SfxModelessDialog_Impl;
@@ -75,7 +75,7 @@ public:
     void                    Initialize (SfxChildWinInfo const * pInfo);
     bool                    IsClosing() const;
     virtual void            Close() override;
-    virtual void            EndDialog() override;
+    virtual void            EndDialog(int nRespose) override;
     virtual void            Activate() override;
     virtual void            Deactivate() override;
     virtual void            ChildWinDispose() override;
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index f5e64fdfedf3..d3fb36947a83 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -211,6 +211,7 @@ public:
     SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* );
 };
 
+const int nCloseResponseToJustHide = -42;
 
 //! The Macro of the future ...
 #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 73e04cc44706..150cfb889df8 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -95,12 +95,12 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, 
const SfxItemSet* pArgSe
     AddTabPage("erroralert", ScTPValidationError::Create, nullptr);
 }
 
-void ScValidationDlg::EndDialog()
+void ScValidationDlg::EndDialog(int nResponse)
 {
     // tdf#137215 ensure original modalality of true is restored before dialog 
loop ends
     if (m_bOwnRefHdlr)
         RemoveRefDlg(true);
-    ScValidationDlgBase::EndDialog();
+    ScValidationDlgBase::EndDialog(nResponse);
 }
 
 ScValidationDlg::~ScValidationDlg()
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 744de1a843bd..e2edf6bc5b30 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -176,14 +176,14 @@ public:
 
     void            SetModal(bool bModal) { m_xDialog->set_modal(bModal); }
 
-    virtual void            SetReference( const ScRange& rRef, ScDocument* 
pDoc ) override
+    virtual void EndDialog(int nResponse) override;
+
+    virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override
     {
         if ( m_pHandler && m_pSetReferenceHdl )
             (m_pHandler->*m_pSetReferenceHdl)( rRef, pDoc );
     }
 
-    virtual void EndDialog() override;
-
     virtual void            SetActive() override
     {
         if ( m_pHandler && m_pSetActiveHdl )
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index a7013fa6c530..451a4d305df1 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -628,7 +628,7 @@ void SfxChildWindow::SetVisible_Impl( bool bVis )
 void SfxChildWindow::Hide()
 {
     if (xController)
-        xController->EndDialog();
+        xController->EndDialog(nCloseResponseToJustHide);
     else
         pWindow->Hide();
 }
@@ -640,7 +640,11 @@ void SfxChildWindow::Show( ShowFlags nFlags )
         if (!xController->getDialog()->get_visible())
         {
             weld::DialogController::runAsync(xController,
-                [this](sal_Int32 /*nResult*/){ xController->Close(); });
+                [this](sal_Int32 nResult) {
+                    if (nResult == nCloseResponseToJustHide)
+                        return;
+                    xController->Close();
+                });
         }
     }
     else
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 5feb326243fc..5fba0e02079f 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1009,7 +1009,11 @@ void SfxWorkWindow::ShowChildren_Impl()
                     {
                         auto xController = pCli->xController;
                         weld::DialogController::runAsync(xController,
-                            [=](sal_Int32 /*nResult*/){ xController->Close(); 
});
+                            [=](sal_Int32 nResult){
+                                if (nResult == nCloseResponseToJustHide)
+                                    return;
+                                xController->Close();
+                            });
                     }
                 }
                 else
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 905d27fd3a3e..187a030fab4d 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -169,11 +169,11 @@ 
SfxModelessDialogController::~SfxModelessDialogController()
         m_pBindings->SetActiveFrame(nullptr);
 }
 
-void SfxDialogController::EndDialog()
+void SfxDialogController::EndDialog(int nResponse)
 {
     if (!m_xDialog->get_visible())
         return;
-    response(RET_CLOSE);
+    response(nResponse);
 }
 
 bool SfxModelessDialogController::IsClosing() const
@@ -181,7 +181,7 @@ bool SfxModelessDialogController::IsClosing() const
     return m_xImpl->bClosing;
 }
 
-void SfxModelessDialogController::EndDialog()
+void SfxModelessDialogController::EndDialog(int nResponse)
 {
     if (m_xImpl->bClosing)
         return;
@@ -190,7 +190,7 @@ void SfxModelessDialogController::EndDialog()
     // stack frame.
     auto aHoldSelf = shared_from_this();
     m_xImpl->bClosing = true;
-    SfxDialogController::EndDialog();
+    SfxDialogController::EndDialog(nResponse);
     if (!m_xImpl)
         return;
     m_xImpl->bClosing = false;
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 8c1bb998fb85..6172d2bc7b8d 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -99,10 +99,10 @@ SwFieldDlg::~SwFieldDlg()
 {
 }
 
-void SwFieldDlg::EndDialog()
+void SwFieldDlg::EndDialog(int nResponse)
 {
     m_bClosing = true;
-    SfxTabDialogController::EndDialog();
+    SfxTabDialogController::EndDialog(nResponse);
     m_bClosing = false;
 }
 
@@ -110,9 +110,16 @@ void SwFieldDlg::Close()
 {
     if (m_bClosing)
         return;
-    m_pBindings->GetDispatcher()->
+    const SfxPoolItem* pResult = m_pBindings->GetDispatcher()->
         Execute(m_bDataBaseMode ? FN_INSERT_FIELD_DATA_ONLY : FN_INSERT_FIELD,
         SfxCallMode::SYNCHRON|SfxCallMode::RECORD);
+    if (!pResult)
+    {
+        // If Execute action did fail for whatever reason, this means that 
request
+        // to close did fail or wasn't delivered to SwTextShell::ExecField().
+        // Just explicitly close dialog in this case.
+        SfxTabDialogController::EndDialog(RET_CLOSE);
+    }
 }
 
 void SwFieldDlg::Initialize(SfxChildWinInfo const *pInfo)
diff --git a/sw/source/uibase/inc/fldtdlg.hxx b/sw/source/uibase/inc/fldtdlg.hxx
index 159881ed1192..9546b99ffa0d 100644
--- a/sw/source/uibase/inc/fldtdlg.hxx
+++ b/sw/source/uibase/inc/fldtdlg.hxx
@@ -53,7 +53,7 @@ public:
     void                ActivateDatabasePage();
     void                ShowReferencePage();
     virtual void        Close() override;
-    virtual void        EndDialog() override;
+    virtual void        EndDialog(int nResponse) override;
     virtual void        Activate() override;
 };
 
commit 20c272631877d2c77bd0b14fee41acfb056aade7
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Jul 14 14:44:59 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jul 14 20:31:21 2023 +0200

    tdf#156267 sw: remove DdeBookmarks in SwDoc::DelTable()
    
    On Copy, a SwTransferDdeLink is created, which also creates a
    DDE_BOOKMARK (it's the only thing that does that) without Undo.
    
    On Delete, the DelTable() creates SwUndoDelete which creates a
    SwHistoryBookmark; then the DeleteAndJoin() deletes the DdeBookmark.
    
    On Undo, the SwHistoryBookmark doesn't find its bookmark, and crashes.
    
    Because the DdeBookmark is artificial and deliberately created without
    Undo, DelTable() should prevent the SwHistoryBookmark by deleting it
    first.
    
    (regression from commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda)
    
    Change-Id: Ib24c788a49a6fee364b44a1dbc8d53870c074596
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154440
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 4270552395600487f9d680cfdc9cd0ad6f457497)

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index b21acc7020c1..379c0a7666be 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1935,6 +1935,11 @@ void SwDoc::DeleteCol( const SwCursor& rCursor )
 
 void SwDoc::DelTable(SwTableNode *const pTableNd)
 {
+    {
+        // tdf#156267 remove DdeBookmarks before deleting nodes
+        SwDataChanged aTmp(SwPaM(*pTableNd, *pTableNd->EndOfSectionNode()));
+    }
+
     bool bNewTextNd = false;
     // Is it alone in a FlyFrame?
     SwNodeIndex aIdx( *pTableNd, -1 );
commit bf7d6a90ae4eeff1c27491f76f25016c9deada50
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jun 27 14:50:02 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jun 30 18:22:00 2023 +0200

    xmloff: ODF import: adapt generator parsing to 2-digit major versions
    
    DocumentInfo currently assumes that a LO version encoded in "BuildId"
    property has only 1 digit major version, which is now wrong and would
    start to give incorrect results when major version "30" will be detected
    as LO_3x.
    
    Add the dots as separators into the BuildId because it's not going to
    work without.
    
    Change-Id: I8918afe3642cbefa8488c57658f1505c9a20eddd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153649
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit b1ce8bb078904db1df542f7a1c2ed527dde1a2d3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153689
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit b963e5b2007790213c370f781f0872b256fe77a3)

diff --git a/sd/source/filter/xml/sdxmlwrp.cxx 
b/sd/source/filter/xml/sdxmlwrp.cxx
index f23eabd0f6c8..261b87634a90 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -747,7 +747,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
                 if( !sBuildId.isEmpty() )
                 {
                     sal_Int32 nIndex = sBuildId.indexOf('$');
-                    if( nIndex != -1 )
+                    if (sBuildId.indexOf(';') == -1 && nIndex != -1)
                     {
                         sal_Int32 nUPD = sBuildId.copy( 0, nIndex ).toInt32();
 
diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx
index 27edb47004d2..b3b285730634 100644
--- a/xmloff/qa/unit/uxmloff.cxx
+++ b/xmloff/qa/unit/uxmloff.cxx
@@ -173,30 +173,35 @@ void Test::testMetaGenerator()
         { "OpenOffice/4.1.4$Unix OpenOffice.org_project/414m2$Build-9785", 
"414$9785", SvXMLImport::AOO_4x },
 
         // LO versions
-        { "LibreOffice/3.3$Linux LibreOffice_project/330m17$Build-3", 
"330$3;33", SvXMLImport::LO_3x },
-        { "BrOffice/3.3$Win32 LibreOffice_project/330m19$Build-8", "330$8;33", 
SvXMLImport::LO_3x },
-        { "LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-1206", 
"340$1206;34", SvXMLImport::LO_3x },
-        { "LibreOffice/3.5$Linux_X86_64 
LibreOffice_project/3fa2330-e49ffd2-90d118b-705e248-051e21c", ";35", 
SvXMLImport::LO_3x },
-        { "LibreOffice/3.6$Windows_x86 
LibreOffice_project/a9a0717-273e462-768e6e3-978247f-65e65f", ";36", 
SvXMLImport::LO_3x },
-        { "LibreOffice/4.0.2.2$Windows_x86 
LibreOffice_project/4c82dcdd6efcd48b1d8bba66bfe1989deee49c3", ";4022", 
SvXMLImport::LO_41x },
-        { "LibreOffice/4.1.2.3$MacOSX_x86 
LibreOffice_project/40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38", ";4123", 
SvXMLImport::LO_41x },
-        { "LibreOffice/4.2.8.2$Windows_x86 
LibreOffice_project/48d50dbfc06349262c9d50868e5c1f630a573ebd", ";4282", 
SvXMLImport::LO_42x },
-        { "LibreOffice_from_Collabora_4.2-8/4.2.10.8$Linux_x86 
LibreOffice_project/84584cc237b2eb93f7684d8fcd063bb37e87b5fb", ";42108", 
SvXMLImport::LO_42x },
-        { "LibreOffice/4.3.3.2$Linux_x86 
LibreOffice_project/9bb7eadab57b6755b1265afa86e04bf45fbfc644", ";4332", 
SvXMLImport::LO_43x },
-        { "LibreOffice_from_Collabora_4.4-10/4.4.10.9$Linux_x86 
LibreOffice_project/5600b19b88a01bbb669b0900100760758dff8c26", ";44109", 
SvXMLImport::LO_44x },
-        { "LibreOffice/4.3.3.2$Linux_X86_64 
LibreOffice_project/430m0$Build-2", "430$2;4332", SvXMLImport::LO_43x },
-        { "LibreOffice/4.4.3.2$Linux_x86 
LibreOffice_project/88805f81e9fe61362df02b9941de8e38a9b5fd16", ";4432", 
SvXMLImport::LO_44x },
-        { "LibreOffice/5.0.1.1$Linux_x86 LibreOffice_project/00m0$Build-1", 
"00$1;5011", SvXMLImport::LO_5x },
-        { "LibreOffice/5.0.3.2$Windows_X86_64 
LibreOffice_project/e5f16313668ac592c1bfb310f4390624e3dbfb75", ";5032", 
SvXMLImport::LO_5x },
-        { "Collabora_Office/5.0.10.19$Linux_X86_64 
LibreOffice_project/95060d44300d8866fa81c16fc8fe2afe22d63777", ";501019", 
SvXMLImport::LO_5x },
-        { "LibreOffice/5.1.6.2.0$Linux_X86_64 LibreOffice_project/10$Build-2", 
";51620", SvXMLImport::LO_5x },
-        { "Collabora_Office/5.1.10.17$Linux_X86_64 
LibreOffice_project/a104cbe76eefca3cf23973da68893d2225fd718b", ";511017", 
SvXMLImport::LO_5x },
-        { "LibreOffice/5.2.1.2$Windows_X86_64 
LibreOffice_project/31dd62db80d4e60af04904455ec9c9219178d620", ";5212", 
SvXMLImport::LO_5x },
-        { "LibreOffice_Vanilla/5.2.3.5$MacOSX_X86_64 
LibreOffice_project/83adc9c35c74e0badc710d981405858b1179a327", ";5235", 
SvXMLImport::LO_5x },
-        { "LibreOffice/5.3.4.2$Windows_X86_64 
LibreOffice_project/f82d347ccc0be322489bf7da61d7e4ad13fe2ff3", ";5342", 
SvXMLImport::LO_5x },
-        { "Collabora_Office/5.3.10.27$Linux_X86_64 
LibreOffice_project/7a5a5378661e338a44666c08773cc796b8d1c84a", ";531027", 
SvXMLImport::LO_5x },
-        { "LibreOfficeDev/5.4.7.0.0$Linux_X86_64 
LibreOffice_project/ba7461fc88c08e75e315f786020a2946e56166c9", ";54700", 
SvXMLImport::LO_5x },
-        { "LibreOfficeDev/6.0.3.0.0$Linux_X86_64 
LibreOffice_project/34442b85bfb0c451738b4db023345a7484463321", ";60300", 
SvXMLImport::LO_6x },
+        { "LibreOffice/3.3$Linux LibreOffice_project/330m17$Build-3", 
"330$3;3.3", SvXMLImport::LO_3x },
+        { "BrOffice/3.3$Win32 LibreOffice_project/330m19$Build-8", 
"330$8;3.3", SvXMLImport::LO_3x },
+        { "LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-1206", 
"340$1206;3.4", SvXMLImport::LO_3x },
+        { "LibreOffice/3.5$Linux_X86_64 
LibreOffice_project/3fa2330-e49ffd2-90d118b-705e248-051e21c", ";3.5", 
SvXMLImport::LO_3x },
+        { "LibreOffice/3.6$Windows_x86 
LibreOffice_project/a9a0717-273e462-768e6e3-978247f-65e65f", ";3.6", 
SvXMLImport::LO_3x },
+        { "LibreOffice/4.0.2.2$Windows_x86 
LibreOffice_project/4c82dcdd6efcd48b1d8bba66bfe1989deee49c3", ";4.0.2.2", 
SvXMLImport::LO_41x },
+        { "LibreOffice/4.1.2.3$MacOSX_x86 
LibreOffice_project/40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38", ";4.1.2.3", 
SvXMLImport::LO_41x },
+        { "LibreOffice/4.2.8.2$Windows_x86 
LibreOffice_project/48d50dbfc06349262c9d50868e5c1f630a573ebd", ";4.2.8.2", 
SvXMLImport::LO_42x },
+        { "LibreOffice_from_Collabora_4.2-8/4.2.10.8$Linux_x86 
LibreOffice_project/84584cc237b2eb93f7684d8fcd063bb37e87b5fb", ";4.2.10.8", 
SvXMLImport::LO_42x },
+        { "LibreOffice/4.3.3.2$Linux_x86 
LibreOffice_project/9bb7eadab57b6755b1265afa86e04bf45fbfc644", ";4.3.3.2", 
SvXMLImport::LO_43x },
+        { "LibreOffice_from_Collabora_4.4-10/4.4.10.9$Linux_x86 
LibreOffice_project/5600b19b88a01bbb669b0900100760758dff8c26", ";4.4.10.9", 
SvXMLImport::LO_44x },
+        { "LibreOffice/4.3.3.2$Linux_X86_64 
LibreOffice_project/430m0$Build-2", "430$2;4.3.3.2", SvXMLImport::LO_43x },
+        { "LibreOffice/4.4.3.2$Linux_x86 
LibreOffice_project/88805f81e9fe61362df02b9941de8e38a9b5fd16", ";4.4.3.2", 
SvXMLImport::LO_44x },
+        { "LibreOffice/5.0.1.1$Linux_x86 LibreOffice_project/00m0$Build-1", 
"00$1;5.0.1.1", SvXMLImport::LO_5x },
+        { "LibreOffice/5.0.3.2$Windows_X86_64 
LibreOffice_project/e5f16313668ac592c1bfb310f4390624e3dbfb75", ";5.0.3.2", 
SvXMLImport::LO_5x },
+        { "Collabora_Office/5.0.10.19$Linux_X86_64 
LibreOffice_project/95060d44300d8866fa81c16fc8fe2afe22d63777", ";5.0.10.19", 
SvXMLImport::LO_5x },
+        { "LibreOffice/5.1.6.2.0$Linux_X86_64 LibreOffice_project/10$Build-2", 
";5.1.6.2.0", SvXMLImport::LO_5x },
+        { "Collabora_Office/5.1.10.17$Linux_X86_64 
LibreOffice_project/a104cbe76eefca3cf23973da68893d2225fd718b", ";5.1.10.17", 
SvXMLImport::LO_5x },
+        { "LibreOffice/5.2.1.2$Windows_X86_64 
LibreOffice_project/31dd62db80d4e60af04904455ec9c9219178d620", ";5.2.1.2", 
SvXMLImport::LO_5x },
+        { "LibreOffice_Vanilla/5.2.3.5$MacOSX_X86_64 
LibreOffice_project/83adc9c35c74e0badc710d981405858b1179a327", ";5.2.3.5", 
SvXMLImport::LO_5x },
+        { "LibreOffice/5.3.4.2$Windows_X86_64 
LibreOffice_project/f82d347ccc0be322489bf7da61d7e4ad13fe2ff3", ";5.3.4.2", 
SvXMLImport::LO_5x },
+        { "Collabora_Office/5.3.10.27$Linux_X86_64 
LibreOffice_project/7a5a5378661e338a44666c08773cc796b8d1c84a", ";5.3.10.27", 
SvXMLImport::LO_5x },
+        { "LibreOfficeDev/5.4.7.0.0$Linux_X86_64 
LibreOffice_project/ba7461fc88c08e75e315f786020a2946e56166c9", ";5.4.7.0.0", 
SvXMLImport::LO_5x },
+        { "LibreOfficeDev/6.0.3.0.0$Linux_X86_64 
LibreOffice_project/34442b85bfb0c451738b4db023345a7484463321", ";6.0.3.0.0", 
SvXMLImport::LO_6x },
+        { "LibreOffice_powered_by_CIBDev/6.3.9.0.0$Linux_X86_64 
LibreOffice_project/c87f331d2900eab70ac3021cbe530926efa6499f", ";6.3.9.0.0", 
SvXMLImport::LO_6x/*LO_63x*/ },
+        { "LibreOffice_powered_by_CIBDev/6.4.0.0.0$Linux_X86_64 
LibreOffice_project/e29e100174c133d27e953934311d68602c4515b7", ";6.4.0.0.0", 
SvXMLImport::LO_6x/*LO_63x*/ },
+        { "LibreOfficeDev/7.0.6.0.0$Linux_X86_64 
LibreOffice_project/dfc40e2292c6e19e285c10ed8c8044d9454107d0", ";7.0.6.0.0", 
SvXMLImport::LO_6x/*LO_7x*/ },
+        { "CIB_OfficeDev/6.4.0.19$Linux_X86_64 
LibreOffice_project/2e04f804b5f82770435f250873f07b3384d95504", ";6.4.0.19", 
SvXMLImport::LO_6x/*LO_63x*/ },
+        { "LibreOfficeDev/24.2.0.0.alpha0$Linux_X86_64 
LibreOffice_project/b81e7b6f3c71fb3ade1cb665444ac730dac0a9a9", ";24.2.0.0.", 
SvXMLImport::ProductVersionUnknown/*LO_New*/ },
     };
 
     for (size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i)
@@ -212,14 +217,15 @@ void Test::testMetaGenerator()
                 OUString::createFromAscii(tests[i].generator), xInfoSet);
         if (tests[i].buildId[0] != '\0')
         {
-            CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(tests[i].buildId),
-                    xInfoSet->getPropertyValue("BuildId").get<OUString>());
+            CPPUNIT_ASSERT_EQUAL_MESSAGE(tests[i].generator,
+                                 OUString::createFromAscii(tests[i].buildId),
+                                 
xInfoSet->getPropertyValue("BuildId").get<OUString>());
         }
         else
         {
-            CPPUNIT_ASSERT(!xInfoSet->getPropertyValue("BuildId").hasValue());
+            CPPUNIT_ASSERT_MESSAGE(tests[i].generator, 
!xInfoSet->getPropertyValue("BuildId").hasValue());
         }
-        CPPUNIT_ASSERT_EQUAL(tests[i].result, pImport->getGeneratorVersion());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE(tests[i].generator, tests[i].result, 
pImport->getGeneratorVersion());
     }
 }
 
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index bfc9d3fe819a..2cc37c313d5f 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -162,37 +162,63 @@ public:
                 OUString const loVersion(buildIds.copy(ix + 1));
                 if (!loVersion.isEmpty())
                 {
-                    if ('3' == loVersion[0])
-                    {
-                        mnGeneratorVersion = SvXMLImport::LO_3x;
-                    }
-                    else if ('4' == loVersion[0])
-                    {
-                        if (loVersion.getLength() > 1
-                            && (loVersion[1] == '0' || loVersion[1] == '1'))
+                    auto const firstDot(loVersion.indexOf('.'));
+                    if (firstDot == 1)
+                    {   // old version scheme 3.3 ... 7.6
+                        if ('3' == loVersion[0])
                         {
-                            mnGeneratorVersion = SvXMLImport::LO_41x; // 
4.0/4.1
+                            mnGeneratorVersion = SvXMLImport::LO_3x;
                         }
-                        else if (loVersion.getLength() > 1 && '2' == 
loVersion[1])
+                        else if ('4' == loVersion[0])
                         {
-                            mnGeneratorVersion = SvXMLImport::LO_42x; // 4.2
+                            if (loVersion.getLength() > 2
+                                && (loVersion[2] == '0' || loVersion[2] == 
'1'))
+                            {
+                                mnGeneratorVersion = SvXMLImport::LO_41x; // 
4.0/4.1
+                            }
+                            else if (loVersion.getLength() > 2 && '2' == 
loVersion[2])
+                            {
+                                mnGeneratorVersion = SvXMLImport::LO_42x; // 
4.2
+                            }
+                            else if (loVersion.getLength() > 2 && '3' == 
loVersion[2])
+                            {
+                                mnGeneratorVersion = SvXMLImport::LO_43x; // 
4.3
+                            }
+                            else if (loVersion.getLength() > 2 && '4' == 
loVersion[2])
+                            {
+                                mnGeneratorVersion = SvXMLImport::LO_44x; // 
4.4
+                            }
                         }
-                        else if (loVersion.getLength() > 1 && '3' == 
loVersion[1])
+                        else if ('5' == loVersion[0])
                         {
-                            mnGeneratorVersion = SvXMLImport::LO_43x; // 4.3
+                            mnGeneratorVersion = SvXMLImport::LO_5x;
                         }
-                        else if (loVersion.getLength() > 1 && '4' == 
loVersion[1])
+                        else if ('6' == loVersion[0])
                         {
-                            mnGeneratorVersion = SvXMLImport::LO_44x; // 4.4
+                            mnGeneratorVersion = SvXMLImport::LO_6x;
+                        }
+                        else if ('7' == loVersion[0])
+                        {
+                            mnGeneratorVersion = SvXMLImport::LO_6x; // no 
point in adding LO_7x here
+                        }
+                        else
+                        {
+                            SAL_INFO("xmloff.core", "unknown LO version: " << 
loVersion);
                         }
                     }
-                    else if ('5' == loVersion[0])
-                    {
-                        mnGeneratorVersion = SvXMLImport::LO_5x;
-                    }
-                    else if ('6' == loVersion[0])
+                    else if (1 < firstDot) // new version scheme 24.2 ...
                     {
-                        mnGeneratorVersion = SvXMLImport::LO_6x;
+                        OUString const nMajor(loVersion.copy(0, firstDot));
+                        auto const year(nMajor.toInt32());
+                        //auto const 
month(loVersion.copy(firstDot+1).toInt32());
+                        if (0 < year)
+                        {
+                            //mnGeneratorVersion = SvXMLImport::LO_New;
+                        }
+                        else
+                        {
+                            SAL_INFO("xmloff.core", "unknown LO version: " << 
loVersion);
+                        }
                     }
                     else
                     {
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 907fd68d4e0d..22c96917b097 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -273,11 +273,11 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& 
i_rBuildId, const uno:
         assert(firstSlash != -1);
         for (sal_Int32 i = firstSlash + 1; i < i_rBuildId.getLength(); ++i)
         {
-            if (rtl::isAsciiDigit(i_rBuildId[i]))
+            if (rtl::isAsciiDigit(i_rBuildId[i]) || '.' == i_rBuildId[i])
             {
                 sNumber.append(i_rBuildId[i]);
             }
-            else if ('.' != i_rBuildId[i])
+            else
             {
                 break;
             }
commit 57c5dc443068ebc4be83b5ebe375e5533ec0ad78
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jun 28 17:19:02 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Jun 28 18:42:11 2023 +0200

    tdf#156077 sw: layout: call AssertFlyPages() in Init()
    
    The bugdoc has 3 pages, and there are at-page flys anchored to the 3rd
    page, and these are not displayed - simply missing from the layout.
    
    In LO 6.1, this worked because the layout-cache was read from the file,
    and 3 pages were created in SwRootFrame::Init() calling InsertCnt_().
    
    But now this creates only 2 pages, and later SwLayAction creates the 2nd
    page between the existing ones on some MoveFwd(), but despite page nr 2
    becoming page nr 3 nothing attaches the at-page flys to the now-page-3.
    
    If a document is loaded containing at-page flys, then all pages that
    have flys anchored to them should be created in SwRootFrame::Init()
    already.
    
    (regression from commit 7e8b4756d95057f069467b34e7849f9354856578)
    
    Change-Id: I4792c483a7620efd81211e6ad0d9220152367d68
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153720
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit ff8ec4cfe5df1e15c3e9f6adc843dfe31358e097)

diff --git a/sw/qa/extras/layout/data/s4_min2.fodt 
b/sw/qa/extras/layout/data/s4_min2.fodt
new file mode 100644
index 000000000000..e1317de597d8
--- /dev/null
+++ b/sw/qa/extras/layout/data/s4_min2.fodt
@@ -0,0 +1,360 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle: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:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d: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:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
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:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0" 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:meta><meta:generator>CIB_OfficeDev/6.1.7.41$Linux_X86_64 
LibreOffice_project/1df0ab666a1bb346850daa72aaa2e29a697a252c</meta:generator><meta:creation-date>2023-06-26T22:28:03.054604345</meta:creation-date><dc:language>de-DE</dc:language><meta:editing-cycles>11</meta:editing-cycles><meta:editing-duration>PT14M3S</meta:editing-duration><dc:date>2023-06-26T23:06:43.147312212</dc:date><meta:document-statistic
 meta:table-count="1" meta:image-count="0" meta:object-count="0" 
meta:page-count="3" meta:paragraph-count="14" meta:word-count="247" 
meta:character-count="1680"/><meta:user-defined meta:name="Info 
1"/><meta:user-defined meta:name="Info 2"/><meta:user-defined meta:name="Info 
3"/><meta:user-defined meta:name="Info 4"/></office:meta>
+ <office:font-face-decls>
+  <style:font-face style:name="Arial" svg:font-family="Arial" 
style:font-pitch="variable"/>
+  <style:font-face style:name="Arial Unicode MS" svg:font-family="'Arial 
Unicode MS'" style:font-pitch="variable"/>
+  <style:font-face style:name="HG Mincho Light J" svg:font-family="'HG Mincho 
Light J'" style:font-pitch="variable"/>
+  <style:font-face style:name="Times New Roman" svg:font-family="'Times New 
Roman'" style:font-pitch="variable"/>
+  <style:font-face style:name="Thorndale" svg:font-family="Thorndale" 
style:font-family-generic="roman" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#808080" 
draw:fill-color="#cfe7f5" 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="true"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties fo:color="#000000" style:font-name="Thorndale" 
fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="HG 
Mincho Light J" style:font-size-asian="12pt" style:language-asian="zxx" 
style:country-asian="none" style:font-name-complex="Arial Unicode MS" 
style:font-size-complex="12pt" style:language-complex="zxx" 
style:country-complex="none"/>
+  </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="2cm" 
style:writing-mode="lr-tb"/>
+   <style:text-properties fo:color="#000000" style:font-name="Thorndale" 
fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="HG 
Mincho Light J" style:font-size-asian="12pt" style:language-asian="zxx" 
style:country-asian="none" style:font-name-complex="Arial Unicode MS" 
style:font-size-complex="12pt" style:language-complex="zxx" 
style:country-complex="none" 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="separating"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="always"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" 
loext:contextual-spacing="false" fo:hyphenation-ladder-count="no-limit"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
style:font-pitch="variable" fo:hyphenate="true" 
fo:hyphenation-remain-char-count="4" fo:hyphenation-push-char-count="4"/>
+  </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" fo:hyphenation-ladder-count="no-limit"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
style:font-pitch="variable" fo:hyphenate="true" 
fo:hyphenation-remain-char-count="4" fo:hyphenation-push-char-count="4"/>
+  </style:style>
+  <style:style style:name="Footer" style:family="paragraph" 
style:parent-style-name="Standard" style:class="extra">
+   <style:paragraph-properties>
+    <style:tab-stops>
+     <style:tab-stop style:position="8.5cm" style:type="center"/>
+     <style:tab-stop style:position="17.002cm" style:type="right"/>
+    </style:tab-stops>
+   </style:paragraph-properties>
+  </style:style>
+  <style:style style:name="Table_20_Contents" style:display-name="Table 
Contents" style:family="paragraph" style:parent-style-name="Text_20_body" 
style:class="extra"/>
+  <style:style style:name="Frame_20_contents" style:display-name="Frame 
contents" style:family="paragraph" style:parent-style-name="Text_20_body" 
style:class="extra"/>
+  <style:style style:name="Arial_5f_12_5f_Links" 
style:display-name="Arial_12_Links" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" 
loext:contextual-spacing="false" fo:hyphenation-ladder-count="no-limit"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
style:font-pitch="variable" fo:font-weight="350" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="4" fo:hyphenation-push-char-count="4"/>
+  </style:style>
+  <style:style style:name="TVS_20_Standard" style:display-name="TVS Standard" 
style:family="paragraph" style:master-page-name="">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
style:page-number="auto"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
style:font-pitch="variable" fo:hyphenate="true" 
fo:hyphenation-remain-char-count="4" fo:hyphenation-push-char-count="4"/>
+  </style:style>
+  <style:style style:name="TVS_20_KopfzeileFKB_5f_S2" style:display-name="TVS 
KopfzeileFKB_S2" style:family="paragraph" 
style:parent-style-name="TVS_20_Standard">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false"/>
+   <style:text-properties fo:font-size="8pt"/>
+  </style:style>
+  <style:style style:name="TVS_20_FußzeileFKB" style:display-name="TVS 
FußzeileFKB" style:family="paragraph" style:parent-style-name="TVS_20_Standard" 
style:master-page-name="">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false" style:page-number="auto" 
style:vertical-align="middle"/>
+   <style:text-properties style:font-name="Times New Roman" 
fo:font-family="'Times New Roman'" style:font-pitch="variable" 
fo:font-size="8pt"/>
+  </style:style>
+  <style:style style:name="TVS_20_Adressfeld" style:display-name="TVS 
Adressfeld" style:family="paragraph" style:parent-style-name="TVS_20_Standard" 
style:master-page-name="">
+   <style:paragraph-properties style:page-number="auto"/>
+   <style:text-properties fo:language="zxx" fo:country="none"/>
+  </style:style>
+  <style:style style:name="TVS_20_Unsichtbar" style:display-name="TVS 
Unsichtbar" style:family="paragraph" style:parent-style-name="TVS_20_Standard" 
style:master-page-name="">
+   <style:paragraph-properties style:page-number="auto"/>
+   <style:text-properties fo:font-size="2pt"/>
+  </style:style>
+  <style:style style:name="TVS_20_Mehrfertigung" style:display-name="TVS 
Mehrfertigung" style:family="paragraph" 
style:parent-style-name="TVS_20_Standard" style:master-page-name="">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false" style:page-number="auto"/>
+   <style:text-properties fo:font-weight="bold"/>
+  </style:style>
+  <style:style style:name="TVS_20_Absender" style:display-name="TVS Absender" 
style:family="paragraph" style:parent-style-name="TVS_20_Standard" 
style:master-page-name="">
+   <style:paragraph-properties style:page-number="auto"/>
+   <style:text-properties style:font-name="Times New Roman" 
fo:font-family="'Times New Roman'" style:font-pitch="variable" 
fo:font-size="8pt"/>
+  </style:style>
+  <style:style style:name="TVS_20_Anrede" style:display-name="TVS Anrede" 
style:family="paragraph" style:parent-style-name="TVS_20_Standard" 
style:next-style-name="TVS_20_Freitext">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.42cm" 
loext:contextual-spacing="false"/>
+  </style:style>
+  <style:style style:name="TVS_20_Freitext" style:display-name="TVS Freitext" 
style:family="paragraph" style:parent-style-name="TVS_20_Standard">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.42cm" 
loext:contextual-spacing="false"/>
+  </style:style>
+  <style:style style:name="Footnote_20_Symbol" style:display-name="Footnote 
Symbol" style:family="text"/>
+  <style:style style:name="Endnote_20_Symbol" style:display-name="Endnote 
Symbol" style:family="text"/>
+  <style:style style:name="TVS_20_Fett" style:display-name="TVS Fett" 
style:family="text">
+   <style:text-properties fo:font-weight="bold"/>
+  </style:style>
+  <style:style style:name="Footnote_20_anchor" style:display-name="Footnote 
anchor" style:family="text">
+   <style:text-properties style:text-position="super 58%"/>
+  </style:style>
+  <style:style style:name="Endnote_20_anchor" style:display-name="Endnote 
anchor" style:family="text">
+   <style:text-properties style:text-position="super 58%"/>
+  </style:style>
+  <style:style style:name="Frame" style:family="graphic">
+   <style:graphic-properties svg:width="7.696cm" fo:min-height="3.519cm" 
text:anchor-type="page" style:wrap="parallel" 
style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+   </style:graphic-properties>
+  </style:style>
+  <text:outline-style style:name="Outline">
+   <text:outline-level-style text:level="1" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="2" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties/>
+   </text:outline-level-style>
+  </text:outline-style>
+  <text:notes-configuration text:note-class="footnote" 
text:citation-style-name="Footnote_20_Symbol" 
text:citation-body-style-name="Footnote_20_anchor" 
text:master-page-name="Standard" style:num-format="1" text:start-value="0" 
text:footnotes-position="page" text:start-numbering-at="document"/>
+  <text:notes-configuration text:note-class="endnote" 
text:citation-style-name="Endnote_20_Symbol" 
text:citation-body-style-name="Endnote_20_anchor" 
text:master-page-name="Endnote" style:num-format="1" 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="Tabelle1" style:family="table">
+   <style:table-properties style:width="16.574cm" table:align="margins"/>
+  </style:style>
+  <style:style style:name="Tabelle1.A" style:family="table-column">
+   <style:table-column-properties style:column-width="16.574cm" 
style:rel-column-width="65535*"/>
+  </style:style>
+  <style:style style:name="Tabelle1.A1" style:family="table-cell">
+   <style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
+  </style:style>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false"/>
+   <style:text-properties fo:font-size="2pt" fo:font-weight="bold"/>
+  </style:style>
+  <style:style style:name="P2" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false"/>
+   <style:text-properties fo:font-size="14pt" fo:font-weight="bold"/>
+  </style:style>
+  <style:style style:name="P3" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:text-align="center" 
style:justify-single-word="false"/>
+   <style:text-properties fo:font-size="10pt" fo:font-weight="normal"/>
+  </style:style>
+  <style:style style:name="P4" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:text-properties/>
+  </style:style>
+  <style:style style:name="P5" style:family="paragraph" 
style:parent-style-name="TVS_20_Adressfeld">
+   <style:text-properties fo:font-size="10pt"/>
+  </style:style>
+  <style:style style:name="P6" style:family="paragraph" 
style:parent-style-name="Table_20_Contents">
+   <style:text-properties fo:font-size="12pt" style:font-size-asian="12pt" 
style:font-size-complex="12pt"/>
+  </style:style>
+  <style:style style:name="P7" style:family="paragraph" 
style:parent-style-name="Arial_5f_12_5f_Links">
+   <style:text-properties/>
+  </style:style>
+  <style:style style:name="P8" style:family="paragraph" 
style:parent-style-name="Standard" style:master-page-name="Standard2">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:margin-top="0cm" fo:margin-bottom="0cm" loext:contextual-spacing="false" 
fo:text-indent="0cm" style:auto-text-indent="false" style:page-number="auto"/>
+   <style:text-properties style:font-name="Arial" fo:font-size="12pt" 
fo:font-style="normal" style:text-underline-style="none" fo:font-weight="bold" 
style:font-size-asian="12pt" style:font-weight-asian="normal" 
style:font-size-complex="12pt" style:font-weight-complex="normal"/>
+  </style:style>
+  <style:style style:name="P9" style:family="paragraph" 
style:parent-style-name="TVS_20_Anrede" style:master-page-name="FABrief_5f_S1">
+   <style:paragraph-properties style:page-number="auto"/>
+  </style:style>
+  <style:style style:name="fr1" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="size position" 
style:vertical-pos="from-top" style:vertical-rel="paragraph" 
style:horizontal-pos="from-left" style:horizontal-rel="paragraph" 
fo:padding="0cm" fo:border="none" style:shadow="none" 
draw:shadow-opacity="100%"/>
+  </style:style>
+  <style:style style:name="fr2" 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="content size 
position" style:vertical-pos="middle" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="paragraph" 
fo:padding="0cm" fo:border-left="none" fo:border-right="none" 
fo:border-top="0.51pt solid #000000" fo:border-bottom="none"/>
+  </style:style>
+  <style:style style:name="fr3" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="size position" 
style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" 
style:vertical-pos="from-top" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="page" fo:padding="0cm" 
fo:border="none">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+   </style:graphic-properties>
+  </style:style>
+  <style:style style:name="fr4" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="size position" 
style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" 
style:vertical-pos="from-top" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="page" 
fo:background-color="transparent" draw:fill="none" draw:fill-color="#ffffff" 
fo:padding="0cm" fo:border-left="none" fo:border-right="none" 
fo:border-top="none" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="fr5" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="size position" 
style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" 
style:vertical-pos="from-top" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="page" 
style:shadow="none" draw:shadow-opacity="100%"/>
+  </style:style>
+  <style:style style:name="fr6" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="size position" 
style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" 
style:vertical-pos="from-top" style:vertical-rel="page" 
style:horizontal-pos="from-left" style:horizontal-rel="paragraph" 
fo:padding="0cm" fo:border="none">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+   </style:graphic-properties>
+  </style:style>
+  <style:style style:name="fr7" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties style:protect="position" style:wrap="parallel" 
style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" 
style:vertical-rel="page" style:horizontal-pos="from-left" 
style:horizontal-rel="page">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+   </style:graphic-properties>
+  </style:style>
+  <style:style style:name="Sect1" style:family="section">
+   <style:section-properties style:editable="false">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+   </style:section-properties>
+  </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:paper-tray-name="[From 
printer settings]" style:print-orientation="portrait" fo:margin-top="2cm" 
fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" 
fo:border="none" fo:padding="0cm" 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="true" style:layout-grid-display="true" 
draw:fill="none" draw:fill-color="#cfe7f5" 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:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm2" style:page-usage="mirrored">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:paper-tray-name="[From 
printer settings]" style:print-orientation="portrait" fo:margin-top="1.3cm" 
fo:margin-bottom="1.799cm" fo:margin-left="2.9cm" fo:margin-right="1.799cm" 
fo:border="none" fo:padding="0cm" 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="true" style:layout-grid-display="true" 
draw:fill="none" draw:fill-color="#cfe7f5" 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="1.9cm" fo:margin-left="0cm" 
fo:margin-right="0cm" fo:margin-bottom="1.401cm" fo:border="none" 
fo:padding="0cm" style:shadow="none" fo:background-color="transparent" 
style:dynamic-spacing="false" draw:fill="none" draw:fill-color="#cfe7f5"/>
+   </style:header-style>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm3">
+   <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="8.7cm" fo:margin-bottom="1.799cm" fo:margin-left="2.193cm" 
fo:margin-right="1.799cm" 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="#cfe7f5" 
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:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm4">
+   <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: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:footnote-sep style:line-style="none" style:adjustment="left" 
style:rel-width="25%" style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style/>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm5" style:page-usage="mirrored">
+   <style:page-layout-properties fo:page-width="29.7cm" 
fo:page-height="21.001cm" style:num-format="1" style:paper-tray-name="[From 
printer settings]" style:print-orientation="landscape" fo:margin-top="2.9cm" 
fo:margin-bottom="1.799cm" fo:margin-left="2cm" fo:margin-right="2cm" 
fo:border="none" fo:padding="0cm" 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="true" style:layout-grid-display="true" 
draw:fill="none" draw:fill-color="#cfe7f5" 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 fo:min-height="0.499cm" 
fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm" 
fo:border="none" fo:padding="0cm" fo:background-color="transparent" 
style:dynamic-spacing="false" draw:fill="none" draw:fill-color="#cfe7f5"/>
+   </style:header-style>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm6">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:paper-tray-name="[From 
printer settings]" style:print-orientation="portrait" fo:margin-top="10.7cm" 
fo:margin-bottom="2.2cm" fo:margin-left="2.9cm" fo:margin-right="1.799cm" 
fo:border="none" fo:padding="0cm" 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="true" style:layout-grid-display="true" 
draw:fill="none" draw:fill-color="#cfe7f5" 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:footer-style>
+    <style:header-footer-properties svg:height="2.401cm" fo:margin-left="0cm" 
fo:margin-right="0cm" fo:margin-top="0.3cm" fo:border="none" fo:padding="0cm" 
style:shadow="none" fo:background-color="transparent" 
style:dynamic-spacing="false" draw:fill="none" draw:fill-color="#cfe7f5"/>
+   </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 style:name="FABrief_5f_S2" 
style:display-name="FABrief_S2" style:page-layout-name="pm2">
+   <style:header>
+    <text:p text:style-name="TVS_20_KopfzeileFKB_5f_S2">- <text:page-number 
text:select-page="current">2</text:page-number><text:s/>-</text:p>
+   </style:header>
+  </style:master-page>
+  <style:master-page style:name="Standard2" style:page-layout-name="pm3" 
style:next-style-name="FABrief_5f_S2"/>
+  <style:master-page style:name="Endnote" style:page-layout-name="pm4"/>
+  <style:master-page style:name="FABrief_5f_S1" 
style:display-name="FABrief_S1" style:page-layout-name="pm6" 
style:next-style-name="FABrief_5f_S2">
+   <style:footer>
+    <text:p text:style-name="Footer"><draw:frame draw:style-name="fr1" 
draw:name="ES_FUSSZEILE" text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" 
svg:width="16.3cm" svg:height="2.101cm" draw:z-index="7">
+      <draw:text-box>
+       <text:p text:style-name="TVS_20_FußzeileFKB"><text:span 
text:style-name="TVS_20_Fett"/></text:p>
+      </draw:text-box>
+     </draw:frame></text:p>
+   </style:footer>
+  </style:master-page>
+ </office:master-styles>
+ <office:body>
+  <office:text text:use-soft-page-breaks="true">
+   <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:user-field-decls>
+    <text:user-field-decl office:value-type="string" office:string-value="" 
text:name="RF_POSTADR1"/>
+    <text:user-field-decl office:value-type="string" office:string-value="" 
text:name="RF_POSTADR2"/>
+    <text:user-field-decl office:value-type="string" office:string-value="" 
text:name="IF_MEHRFERTIGUNG"/>
+    <text:user-field-decl office:value-type="string" office:string-value="" 
text:name="ES_BRIEFANREDE"/>
+    <text:user-field-decl office:value-type="string" office:string-value="" 
text:name="IF_AUSBL_DSGVO"/>
+   </text:user-field-decls><draw:frame draw:style-name="fr2" 
draw:name="Rahmen2" text:anchor-type="page" text:anchor-page-number="2" 
svg:x="0.6cm" svg:width="0.497cm" svg:height="0.041cm" draw:z-index="0">
+    <draw:text-box>
+     <text:p text:style-name="Frame_20_contents"/>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr3" draw:name="ES_ADRESSFELD" 
text:anchor-type="page" text:anchor-page-number="1" svg:x="2cm" svg:y="6.549cm" 
svg:width="8.5cm" svg:height="2.799cm" draw:z-index="1">
+    <draw:text-box>
+     <text:p text:style-name="P5"/>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr4" draw:name="Absender" 
text:anchor-type="page" text:anchor-page-number="1" svg:x="2cm" svg:y="4.3cm" 
svg:width="8.5cm" svg:height="0.651cm" draw:z-index="2">
+    <draw:text-box>
+     <text:p text:style-name="TVS_20_Absender"><text:user-field-get 
text:name="RF_POSTADR1"/><text:line-break/><text:user-field-get 
text:name="RF_POSTADR2"/></text:p>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr5" draw:name="Mehrfertigung" 
text:anchor-type="page" text:anchor-page-number="1" svg:x="10.901cm" 
svg:y="4.3cm" svg:width="8.4cm" svg:height="0.55cm" draw:z-index="3">
+    <draw:text-box>
+     <text:p text:style-name="TVS_20_Mehrfertigung"><text:user-field-get 
text:name="IF_MEHRFERTIGUNG"/></text:p>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr6" 
draw:name="ES_ADRESSFELD_FA00" text:anchor-type="page" 
text:anchor-page-number="3" svg:x="2.221cm" svg:y="4.484cm" svg:width="7.878cm" 
draw:z-index="4">
+    <draw:text-box fo:min-height="3.701cm">
+     <text:p text:style-name="P7">Second box</text:p>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr6" draw:name="Absender_Stpfl" 
text:anchor-type="page" text:anchor-page-number="3" svg:x="11.312cm" 
svg:y="4.228cm" svg:width="7.828cm" draw:z-index="5">
+    <draw:text-box fo:min-height="3.62cm">
+     <text:p text:style-name="P7">Third box</text:p>
+    </draw:text-box>
+   </draw:frame><draw:frame draw:style-name="fr7" draw:name="Kopf_Fragebogen" 
text:anchor-type="page" text:anchor-page-number="3" svg:x="2.17cm" 
svg:y="1.36cm" svg:width="16.574cm" draw:z-index="6">
+    <draw:text-box fo:min-height="1.353cm">
+     <table:table table:name="Tabelle1" table:style-name="Tabelle1">
+      <table:table-column table:style-name="Tabelle1.A"/>
+      <table:table-header-rows>
+       <table:table-row>
+        <table:table-cell table:style-name="Tabelle1.A1" 
office:value-type="string">
+         <text:p text:style-name="P2">Something</text:p>
+        </table:table-cell>
+       </table:table-row>
+      </table:table-header-rows>
+      <table:table-row>
+       <table:table-cell table:style-name="Tabelle1.A1" 
office:value-type="string">
+        <text:p text:style-name="P3">Important here</text:p>
+       </table:table-cell>
+      </table:table-row>
+     </table:table>
+     <text:p text:style-name="P1"/>
+    </draw:text-box>
+   </draw:frame>
+   <text:section text:style-name="Sect1" text:name="CopyA">
+    <text:p text:style-name="P9"><text:user-field-get 
text:name="ES_BRIEFANREDE"/></text:p>
+    <text:p text:style-name="TVS_20_Freitext"/>
+    <text:p text:style-name="TVS_20_Freitext"/>
+    <text:p text:style-name="TVS_20_Freitext"/>
+    <text:p text:style-name="TVS_20_Freitext"/>
+    <text:p text:style-name="P6">Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci 
ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis 
cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. 
In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, 
non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus 
semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce 
pellentesque est orci.</text:p>
+    <text:p text:style-name="P6">Integer sodales tincidunt tristique. Sed a 
metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit 
amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. 
Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate 
lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis 
felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum 
est vel ultricies.</text:p>
+    <text:p text:style-name="P6">Aliquam velit massa, laoreet vel leo nec, 
volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis 
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum 
primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus 
tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit 
amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu 
sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed 
ante. Donec nec est elementum, euismod nulla in, mollis nunc.</text:p>
+    <text:p 
text:style-name="TVS_20_Unsichtbar"><text:soft-page-break/><text:user-field-get 
text:name="IF_AUSBL_DSGVO"/><text:hidden-paragraph 
text:condition="ooow:IF_AUSBL_DSGVO eq &quot;1&quot;"/></text:p>
+   </text:section>
+   <text:p text:style-name="P4">Second page</text:p>
+   <text:section text:style-name="Sect1" text:name="CopyB">
+    <text:p text:style-name="P8">Page 3</text:p>
+   </text:section>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 6debcdbd0f17..2503a06b61d6 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -108,6 +108,18 @@ void SwLayoutWriter::CheckRedlineFootnotesHidden()
     assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", 
"Portion", "mo");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf156077)
+{
+    createDoc("s4_min2.fodt");
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 3, 
getPages());
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    assertXPath(pXmlDoc, "/root/page[1]/anchored/fly", 3);
+    assertXPath(pXmlDoc, "/root/page[2]/anchored/fly", 1);
+    // this was 0, the at-page anchored flys were not displayed
+    assertXPath(pXmlDoc, "/root/page[3]/anchored/fly", 3);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
 {
     createDoc("redline_footnotes.odt");
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1d1f4597fcf2..2b3c18f981b0 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -500,6 +500,11 @@ void SwRootFrame::Init( SwFrameFormat* pFormat )
 
     SwNodeIndex aTmp( 
*pDoc->GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
     ::InsertCnt_( pLay, pDoc, aTmp.GetIndex(), true );
+
+    // tdf#156077 create all pages for at-page anchored flys now because all
+    // these flys must be attached to some page when Init() is finished
+    AssertFlyPages();
+
     //Remove masters that haven't been replaced yet from the list.
     RemoveMasterObjs( mpDrawPage );
     if( rSettingAccess.get(DocumentSettingId::GLOBAL_DOCUMENT) )
commit 61b0c6605932873ccf8ef321cbb41464d366cb70
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jun 27 19:50:51 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Jun 28 12:52:48 2023 +0200

    tdf#146547 sfx2: preserve modified state from read-only to editable
    
    SfxViewFrame::ExecReload_Impl() calls DoSaveCompleted() which resets the
    modified state, but in this case the document wasn't actually saved.
    
    Change-Id: I54f6508a652cc42a127bc59058c5b435dd1a25a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153676
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 79241a1fd32ab03cd2bb34fb303ce7f2fa93e57e)

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 2b39c4b1ef3c..bbfb37e5291d 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -330,9 +330,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                             m_pFrame->RemoveInfoBar("readonly");
                         if (m_pMed)
                         {
+                            bool const 
isEnableSetModified(m_pSh->IsEnableSetModified());
+                            m_pSh->EnableSetModified(false);
                             // tdf#116066: DoSaveCompleted should be called 
after SetReadOnlyUI
                             m_pSh->DoSaveCompleted(m_pMed);
                             m_pSh->Broadcast(SfxHint(SfxHintId::ModeChanged));
+                            m_pSh->EnableSetModified(isEnableSetModified);
                         }
                     }
                 }
commit eae41835161a90bf395ea29559db953fb5b820e2
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Apr 20 11:18:34 2023 +0300
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Jun 27 16:57:03 2023 +0200

    tdf#154113: do not forget to split the outermost section frame
    
    ... when the inserted section node is not the first one.
    
    The very first frame, where InsertCnt_ puts content to, may already have
    some content after the insertion position. When an inner section ends,
    the current section needs a new frame, and the rest of content must go
    to that new frame. Previously, the new empty frame was created without
    taking the content move into account.
    
    This moves the split into the single place inside InsertCnt_, to avoid
    special processing in MakeFrames.
    
    Change-Id: I1335ebbc620af0f2b064141e8267e5bd1af0b195
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150675
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    
    (cherry-picked from commit efb3c57851d29440ef086c68a6c1ddbb8bc8fc00)
    
    Change-Id: I021d868835b85226ab62ed8728c8aacdaf8e4528

diff --git a/sw/qa/extras/layout/data/three_sections.fodt 
b/sw/qa/extras/layout/data/three_sections.fodt
new file mode 100644
index 000000000000..9233fed89085
--- /dev/null
+++ b/sw/qa/extras/layout/data/three_sections.fodt
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:body>
+  <office:text>
+   <text:p>Select the text below, copy to clipboard, and paste from clipboard, 
replacing the selection.</text:p>
+   <text:section text:name="Section1">
+    <text:p>&lt;-- Start selection here. Section1</text:p>
+   </text:section>
+   <text:section text:name="Section2">
+    <text:p>Section2</text:p>
+   </text:section>
+   <text:section text:name="Section3">
+    <text:p>Section3. End selection here --&gt;</text:p>
+   </text:section>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file

... etc. - the rest is truncated

Reply via email to