summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-05-30 11:23:58 -0400
committerJustin Luth <jluth@mail.com>2023-05-30 21:33:16 +0200
commit0ceb131e964206efbb1c76a03f19d1992e2f89c7 (patch)
treeea2a0405d747eb09f75596a889da394696330d65 /sw
parent60e32969a98cad348cf8e55e8f93abc3d6e9c70c (diff)
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 <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx1
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx21
2 files changed, 17 insertions, 5 deletions
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);
+ }
+ }
}
}