From 0ceb131e964206efbb1c76a03f19d1992e2f89c7 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 30 May 2023 11:23:58 -0400 Subject: 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 Tested-by: Jenkins --- sw/source/filter/ww8/ww8graf.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'sw/source') 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); + } + } } } -- cgit