sw/source/core/layout/flycnt.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 906151f18771418ee899f59fc98c774b07dadf16
Author:     Attila Bakos (NISZ) <bakos.attilakar...@nisz.hu>
AuthorDate: Tue May 17 15:28:59 2022 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Mon May 30 11:17:15 2022 +0200

    tdf#148365 sw: fix freezing with FrameIsAutomaticHeight
    
    Lock layout update temporarily during setting horizontal
    and after that, vertical orientations of textboxes
    with FrameIsAutomaticHeight to avoid freezing
    SwObjectFormatter, and depending on the platform,
    freezing Writer completely.
    
    Regression from commit 3b0a0e70cb67fc2e1f9999d2e8cbb9cfcd8c670e
    "Related tdf#66039 DOCX import: fix Z-order of group shapes".
    
    Change-Id: Ib106182b9f0d3d74ebdc3e746345380c8b685fdf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134480
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 182d2a47a2b4ed0affdc828a534c1659cc2e926d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135007
    Tested-by: Jenkins
    Reviewed-by: Attila Bakos <bakos.attilakar...@nisz.hu>

diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 5e9bdfe92ef0..5bcdad916e13 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -549,8 +549,14 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
         aHOri.SetPos(aHOri.GetPos() + aTextRectangle.Left());
         aVOri.SetPos(aVOri.GetPos() + aTextRectangle.Top());
         // save the new position for the shape
-        GetFormat()->SetFormatAttr(aHOri);
-        GetFormat()->SetFormatAttr(aVOri);
+        auto pFormat = GetFormat();
+        const bool bLocked = pFormat->IsModifyLocked();
+        if (!bLocked)
+            pFormat->LockModify();
+        pFormat->SetFormatAttr(aHOri);
+        pFormat->SetFormatAttr(aVOri);
+        if (!bLocked)
+            pFormat->UnlockModify();
     }
     if ( bOsz || bConsiderWrapInfluenceDueToOverlapPrevCol ||
          // #i40444#

Reply via email to