diff options
author | Daniel Arato (NISZ) <arato.daniel@nisz.hu> | 2020-09-02 15:46:56 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-09-07 13:11:44 +0200 |
commit | 4b7ee7bd61f78be60211cc72ba36da987191266e (patch) | |
tree | 85e21fe7b274d1c3176a3fd64f933fc74bfbf408 /sw | |
parent | 2f47a1fb74ce73d4b9ef49aaf02e3b0750fd0a79 (diff) |
tdf#135665 DOCX: import tight wrap setting of VML shapes
The wrap setting that OOXML calls "tight" and LibreOffice calls
"contour" (== true) was not supported by the import code, only
the export.
Change-Id: I48739ffaad48e28df05fd87a9b51a14238dc47e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101932
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf135665.docx | bin | 0 -> 25099 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135665.docx b/sw/qa/extras/ooxmlexport/data/tdf135665.docx Binary files differnew file mode 100644 index 000000000000..2400a1c1a46c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf135665.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 4e39a5af0297..95770433a6ab 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -513,6 +513,19 @@ DECLARE_OOXMLIMPORT_TEST(TestTdf135653, "tdf135653.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE bg color does not match!", aExpectedColor, aFillColor); } +DECLARE_OOXMLIMPORT_TEST(testTdf135665, "tdf135665.docx") +{ + uno::Reference<beans::XPropertySet> xOLEProps1(getShape(1), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xOLEProps2(getShape(2), uno::UNO_QUERY_THROW); + bool bSurroundContour1 = false; + bool bSurroundContour2 = false; + xOLEProps1->getPropertyValue("SurroundContour") >>= bSurroundContour1; + xOLEProps2->getPropertyValue("SurroundContour") >>= bSurroundContour2; + + CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported correctly", true, bSurroundContour1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported correctly", false, bSurroundContour2); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt") { // invalid combination of at-page anchor and horizontal-rel="paragraph" diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 2d122992d840..5d7b86fc37e0 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -752,15 +752,19 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI bRet &= aSh.PutValue(*pShTr, MID_SHADOW_TRANSPARENCE); rToSet.Put(aSh); } - const ::uno::Any* pSur = nullptr; + const ::uno::Any* pSur = nullptr; GetProperty(RES_SURROUND, MID_SURROUND_SURROUNDTYPE, pSur); + const ::uno::Any* pSurCont = nullptr; + GetProperty(RES_SURROUND, MID_SURROUND_CONTOUR, pSurCont); const ::uno::Any* pSurAnch = nullptr; GetProperty(RES_SURROUND, MID_SURROUND_ANCHORONLY, pSurAnch); if(pSur || pSurAnch) { SwFormatSurround aSrnd ( rFromSet.Get ( RES_SURROUND ) ); if(pSur) - bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSur, MID_SURROUND_SURROUNDTYPE ); + bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSur, MID_SURROUND_SURROUNDTYPE); + if(pSurCont) + bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSurCont, MID_SURROUND_CONTOUR); if(pSurAnch) bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSurAnch, MID_SURROUND_ANCHORONLY); rToSet.Put(aSrnd); |