From e835c2c0d3aff4f1ee5d29c9eaf36400b1aca6a7 Mon Sep 17 00:00:00 2001 From: "Attila Bakos (NISZ)" Date: Thu, 24 Feb 2022 09:51:15 +0100 Subject: tdf#146597 sw: fix freezing with GroupShape MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in case it is anchored to character and wrap is none. Regression from 8da3586cff9cc11cf5db985d19851f21f0d42eb8 "tdf#141220 sw: fix textbox popped out of off-page shape". Note: This is a backport-compatible fix made also for the 7.3 backport. There will be a less urgent 7.4-only fix for its unresolved group case soon. Change-Id: I421c85e2dd16ad2649bc299fc4733d462be8d7b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130478 Tested-by: László Németh Reviewed-by: László Németh --- sw/qa/extras/odfimport/data/tdf146597.odt | Bin 0 -> 13307 bytes sw/qa/extras/odfimport/odfimport.cxx | 6 ++++++ sw/source/core/draw/dcontact.cxx | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/odfimport/data/tdf146597.odt (limited to 'sw') diff --git a/sw/qa/extras/odfimport/data/tdf146597.odt b/sw/qa/extras/odfimport/data/tdf146597.odt new file mode 100644 index 000000000000..6dcc379cef4d Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf146597.odt differ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index ed715a75f9a2..1130f3cce848 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -1328,5 +1328,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146257) } } +CPPUNIT_TEST_FIXTURE(Test, testTdf146597) +{ + load(mpTestDocumentPath, "tdf146597.odt"); + // This was creashed before. +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 563bb61737a6..7040a741076c 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1341,7 +1341,8 @@ void SwDrawContact::Changed_( const SdrObject& rObj, // tdf#135198: keep text box together with its shape const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame(); - if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && !rObj.getChildrenOfSdrObject()) + if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && GetFormat() + && GetFormat()->GetOtherTextBoxFormat()) { SwDoc* const pDoc = GetFormat()->GetDoc(); -- cgit