diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-16 10:18:18 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-06-20 11:24:21 +0200 |
commit | 4ac83001c38f0ff4696bd204e7baabcb2947725f (patch) | |
tree | efe45fafdf2cb67a47abff2d02b53cbec840ebcc | |
parent | an inconsistent SwTextFormatInfo index, len, text length case (diff) | |
download | core-4ac83001c38f0ff4696bd204e7baabcb2947725f.tar.gz core-4ac83001c38f0ff4696bd204e7baabcb2947725f.zip |
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
Change-Id: Ie65a51bf609e8bacd261f368f0b8037431c116ed
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)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133903
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sw/qa/core/layout/data/tdf122894-4.doc | bin | 0 -> 214528 bytes | |||
-rw-r--r-- | sw/qa/core/layout/layout.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/layout/objectformattertxtfrm.cxx | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/sw/qa/core/layout/data/tdf122894-4.doc b/sw/qa/core/layout/data/tdf122894-4.doc Binary files differnew file mode 100644 index 000000000000..4ebdb53de04f --- /dev/null +++ b/sw/qa/core/layout/data/tdf122894-4.doc diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 02a1a70ac04c..4dcbaa15e5f4 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -29,6 +29,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf128195) CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2269), nTxtHeight); } +CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testCrashRemoveFromLayout) +{ + load(DATA_DIRECTORY, "tdf122894-4.doc"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index e6fc506d73fb..8f311463f898 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -856,7 +856,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(); |