sw/source/core/layout/tabfrm.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit e11e1d48abedf17db40c069d9f37b4edcbcc09c4
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Fri Feb 17 10:14:31 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Feb 17 10:07:48 2023 +0000

    sw floattable: it's fine to recalc the table in SwTabFrame::MakeAll()
    
    Avoids this warning:
    
    warn:legacy.osl:22791:22791:sw/source/core/layout/tabfrm.cxx:2751: debug 
assertion: <SwTabFrame::MakeAll()> - format of table lowers suppressed by fix 
i44910
    
    I assume that the intention is that flys first format their content and
    then grow as necessary, so there is no risk to call lcl_RecalcTable() in
    the floattable case. (Parent will grow, then split if necessary.)
    
    Change-Id: Ib15d2d56066b695010c76f2052114082678c2e9b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147194
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b95f8ca45b25..177bfa947fb2 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2736,7 +2736,13 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
             // allowed to split.
             SwTwips nDistToUpperPrtBottom =
                 aRectFnSet.BottomDist( getFrameArea(), 
aRectFnSet.GetPrtBottom(*GetUpper()));
-            if ( nDistToUpperPrtBottom >= 0 || bTryToSplit )
+            bool bFlySplit = false;
+            if (GetUpper()->IsFlyFrame())
+            {
+                auto pUpperFly = static_cast<SwFlyFrame*>(GetUpper());
+                bFlySplit = pUpperFly->IsFlySplitAllowed();
+            }
+            if ( nDistToUpperPrtBottom >= 0 || bTryToSplit || bFlySplit )
             {
                 lcl_RecalcTable( *this, nullptr, aNotify );
                 m_bLowersFormatted = true;

Reply via email to