sw/qa/extras/ww8export/ww8export3.cxx | 1 + sw/source/filter/ww8/ww8graf.cxx | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-)
New commits: commit 0ceb131e964206efbb1c76a03f19d1992e2f89c7 Author: Justin Luth <jl...@mail.com> AuthorDate: Tue May 30 11:23:58 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Tue May 30 21:33:16 2023 +0200 tdf#140508 doc import: auto-contour for textboxes This fixes a 6.3.1 regression. The problem was that contour was turned off despite settings indicating that it should be on. An earlier patchset contains the results of a make sw.check assert. make CppunitTest_sw_ww8export3 CPPUNIT_TEST_NAME=testTdf79186_noLayoutInCell Change-Id: Ib3df022a1430649b271083f343b470798f4a08c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152398 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 0b116c232d60..7cbc2e256943 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -1066,6 +1066,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79186_noLayoutInCell) CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), "IsFollowingTextFlow")); + CPPUNIT_ASSERT(getProperty<bool>(getShape(1), "SurroundContour")); // tdf#140508 } CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 35621217ece1..4e7a454ab773 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2104,11 +2104,22 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(const SvxMSDffImportRec& rRecord, } else if (rFlyFormat.GetSurround().IsContour()) { - // Contour is enabled, but no polygon is set: disable contour, because Word does not - // Writer-style auto-contour in that case. - SwFormatSurround aSurround(rFlyFormat.GetSurround()); - aSurround.SetContour(false); - rFlyFormat.SetFormatAttr(aSurround); + const SdrObject* pSdrObj = rFlyFormat.FindSdrObject(); + SdrObjKind eKind = pSdrObj ? pSdrObj->GetObjIdentifier() : SdrObjKind::Graphic; + switch (eKind) + { + case SdrObjKind::Text: + break; + case SdrObjKind::SwFlyDrawObjIdentifier: + default: + { + // Contour is enabled, but no polygon is set: disable contour, because Word does not + // Writer-style auto-contour in that case. + SwFormatSurround aSurround(rFlyFormat.GetSurround()); + aSurround.SetContour(false); + rFlyFormat.SetFormatAttr(aSurround); + } + } } }