diff options
-rw-r--r-- | sw/CppunitTest_sw_ww8import.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/ww8import/data/tdf112535.doc | bin | 0 -> 19968 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 20 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 8 |
4 files changed, 29 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ww8import.mk b/sw/CppunitTest_sw_ww8import.mk index 31a7dcbe80ba..01e0d6b95164 100644 --- a/sw/CppunitTest_sw_ww8import.mk +++ b/sw/CppunitTest_sw_ww8import.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8import, \ unotest \ vcl \ sfx \ + svl \ sw \ utl \ )) diff --git a/sw/qa/extras/ww8import/data/tdf112535.doc b/sw/qa/extras/ww8import/data/tdf112535.doc Binary files differnew file mode 100644 index 000000000000..4eea19ecd54c --- /dev/null +++ b/sw/qa/extras/ww8import/data/tdf112535.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 73495cea2754..bd29b496fea4 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -15,6 +15,7 @@ #include <viscrs.hxx> #include <wrtsh.hxx> #include <ndgrf.hxx> +#include <fmtsrnd.hxx> #include <editeng/boxitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> @@ -85,6 +86,25 @@ DECLARE_WW8IMPORT_TEST(testTdf107773, "tdf107773.doc") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), xDrawPage->getCount()); } +DECLARE_WW8IMPORT_TEST(testTdf112535, "tdf112535.doc") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDoc->GetSpzFrameFormats()); + + SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats(); + CPPUNIT_ASSERT(!rFormats.empty()); + + const SwFrameFormat* pFormat = rFormats[0]; + CPPUNIT_ASSERT(pFormat); + + // Without the accompanying fix in place, this test would have failed: auto-contour was enabled + // in Writer, but not in Word. + CPPUNIT_ASSERT(!pFormat->GetSurround().IsContour()); +} + DECLARE_WW8IMPORT_TEST(testTdf106291, "tdf106291.doc") { // Table cell was merged vertically instead of horizontally -> had incorrect dimensions diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index c9ec0f43fc27..50672e797e38 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2089,6 +2089,14 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(SvxMSDffImportRec const * pRecord, pNd->SetContour(&aPoly); } } + else if (pFlyFormat->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(pFlyFormat->GetSurround()); + aSurround.SetContour(false); + pFlyFormat->SetFormatAttr(aSurround); + } } static sal_Int32 lcl_ConvertCrop(sal_uInt32 const nCrop, sal_Int32 const nSize) |