summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2022-02-24 09:51:15 +0100
committerLászló Németh <nemeth@numbertext.org>2022-03-10 13:34:41 +0100
commitd691e9ef4d77cf5e46aec288d5efcf9291534352 (patch)
treec55d0f4fc3778c6559249331be2cd67b0bdc99bc
parentbae5503ac47ac2faa4c4365f86a00543e43a149a (diff)
tdf#146597 sw: fix freezing with GroupShapemimo-7-2-branch-point
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 <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e835c2c0d3aff4f1ee5d29c9eaf36400b1aca6a7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130456 Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130715 Reviewed-by: Attila Bakos <bakos.attilakaroly@nisz.hu>
-rw-r--r--sw/qa/extras/odfimport/data/tdf146597.odtbin0 -> 13307 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx6
-rw-r--r--sw/source/core/draw/dcontact.cxx5
3 files changed, 10 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf146597.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index bd936937475d..c1ec472f405d 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1322,5 +1322,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 ad377073a58e..e4d2450629c8 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1338,7 +1338,10 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
// tdf#135198: keep text box together with its shape
const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
- if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+ auto pFormat = GetFormat();
+ if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && pFormat
+ && (SwTextBoxHelper::isTextBox(pFormat, RES_FLYFRMFMT) ||
+ SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT)))
{
SwDoc* const pDoc = GetFormat()->GetDoc();