summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-16 10:18:18 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-13 14:14:26 +0200
commite9263bd81e75ecf3039ec5e611d91fe5325061bc (patch)
treecf89cf3ce3d96bdcebfb7afd564e86ece4c26a37
parentf149acd8652655c8357b5108d3d06468a2234dc9 (diff)
tdf#122894 skipping anchor in column in footnote
a trawl of crash testing document didn't show up another example and it doesn't seem possible to create this scenario directly in out UI Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112567 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit fa1bcc22921941b2cd8a0b32fe0d15655d12d607) (cherry picked from commit 87ada07d405bd6813d7ad03e66b66bc259988f61) Change-Id: Ie65a51bf609e8bacd261f368f0b8037431c116ed
-rw-r--r--solenv/clang-format/blacklist1
-rw-r--r--sw/qa/extras/layout/data/tdf122894-4.docbin0 -> 214528 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx7
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx3
4 files changed, 10 insertions, 1 deletions
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 107d59b1f668..2b7b37d2e1c1 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -15159,6 +15159,7 @@ sw/qa/extras/htmlexport/htmlexport.cxx
sw/qa/extras/htmlimport/htmlimport.cxx
sw/qa/extras/inc/bordertest.hxx
sw/qa/extras/inc/swmodeltestbase.hxx
+sw/qa/extras/layout/layout.cxx
sw/qa/extras/mailmerge/mailmerge.cxx
sw/qa/extras/odfexport/odfexport.cxx
sw/qa/extras/odfimport/odfimport.cxx
diff --git a/sw/qa/extras/layout/data/tdf122894-4.doc b/sw/qa/extras/layout/data/tdf122894-4.doc
new file mode 100644
index 000000000000..4ebdb53de04f
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf122894-4.doc
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index ff7c509cc1ca..d77f3099f759 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -39,6 +39,7 @@ public:
void testTdf116989();
void testAbi11870();
void testStableAtPageAnchoredFlyPosition();
+ void testCrashRemoveFromLayout();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830);
@@ -59,6 +60,7 @@ public:
CPPUNIT_TEST(testTdf116989);
CPPUNIT_TEST(testAbi11870);
CPPUNIT_TEST(testStableAtPageAnchoredFlyPosition);
+ CPPUNIT_TEST(testCrashRemoveFromLayout);
CPPUNIT_TEST_SUITE_END();
private:
@@ -366,6 +368,11 @@ void SwLayoutWriter::testStableAtPageAnchoredFlyPosition()
CPPUNIT_ASSERT_EQUAL(aOrigRect, aRelayoutRect);
}
+void SwLayoutWriter::testCrashRemoveFromLayout()
+{
+ createDoc("tdf122894-4.doc");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 88f0bc28904f..d9322f581c9d 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -728,7 +728,8 @@ void SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs( SwTextFrame& _rAn
// format the content of the previous columns.
// Note: It's a very simple format without formatting objects.
SwFrame* pColFrameOfAnchor = _rAnchorTextFrame.FindColFrame();
- if ( pColFrameOfAnchor )
+ SAL_WARN_IF(pColFrameOfAnchor && _rAnchorTextFrame.IsInFootnote(), "sw.layout", "tdf#122894 skipping anchor in column in footnote");
+ if (pColFrameOfAnchor && !_rAnchorTextFrame.IsInFootnote())
{
// #i44049#
_rAnchorTextFrame.LockJoin();