sw/source/core/layout/tabfrm.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 4ca4282517d02592966576fc642048b3d5ae5532
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Thu Mar 23 14:09:05 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Mar 24 21:16:59 2023 +0000

    related tdf#76022 sw CalcFlyOffset: no ConsiderFly if THROUGH wrap
    
    A fly that has text wrap through it does not need to be considered
    for table offsets.
    
    Change-Id: I1b1e58bca3f59d8789581f978f15355c2d4d7ee0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149465
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 900f3ba71fe1..ef169a209212 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2912,18 +2912,22 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
                         bConsiderFly = false;
                 }
 
+                text::WrapTextMode nSurround = text::WrapTextMode_NONE;
                 if ( bConsiderFly )
                 {
-                    text::WrapTextMode nSurround = 
pFly->GetFormat()->GetSurround().GetSurround();
+                    nSurround = pFly->GetFormat()->GetSurround().GetSurround();
                     // If the frame format is a TextBox of a draw shape,
                     // then use the surround of the original shape.
                     bool bWrapThrough = nSurround == 
text::WrapTextMode_THROUGH;
                     SwTextBoxHelper::getShapeWrapThrough(pFly->GetFormat(), 
bWrapThrough);
-                    if (bWrapThrough && nSurround != 
text::WrapTextMode_THROUGH)
-                        nSurround = text::WrapTextMode_THROUGH;
+                    if (bWrapThrough)
+                        bConsiderFly = false;
                     else if (!bWrapThrough && nSurround == 
text::WrapTextMode_THROUGH)
                         nSurround = text::WrapTextMode_PARALLEL;
+                }
 
+                if (bConsiderFly)
+                {
                     const SwFormatHoriOrient &rHori= 
pFly->GetFormat()->GetHoriOrient();
                     bool bShiftDown = css::text::WrapTextMode_NONE == 
nSurround;
                     if (!bShiftDown && bAddVerticalFlyOffsets)

Reply via email to