writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx             |   14 
++++++++++
 writerfilter/qa/cppunittests/dmapper/data/tdf143208_wrapTight.docx |binary
 writerfilter/source/dmapper/GraphicImport.cxx                      |    1 
 3 files changed, 15 insertions(+)

New commits:
commit 72541a46aa26194b751785cd56185c8d3db0c9e9
Author:     Regina Henschel <rb.hensc...@t-online.de>
AuthorDate: Tue Jul 6 00:03:25 2021 +0200
Commit:     Regina Henschel <rb.hensc...@t-online.de>
CommitDate: Tue Jul 6 14:02:15 2021 +0200

    tdf#143208 set property ContourOutside in docx import
    
    The property value was correctly read from wrapTight and wrapThrough
    to bContourOutside, but not added to the shape properties.
    
    Change-Id: I825ec2a652031edf69e05f611e6da0f1afd862cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118456
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <rb.hensc...@t-online.de>

diff --git a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx 
b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
index 6ef6cf1da6e6..c47b33b71f5c 100644
--- a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
@@ -57,6 +57,20 @@ void Test::tearDown()
 
 constexpr OUStringLiteral DATA_DIRECTORY = 
u"/writerfilter/qa/cppunittests/dmapper/data/";
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf143208wrapTight)
+{
+    OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf143208_wrapTight.docx";
+    // The document has a shape with indentation and contour wrap "wrapTight". 
Error was, that
+    // the corresponding shape property 'ContourOutside=true' was not set.
+    getComponent() = loadFromDesktop(aURL);
+    uno::Reference<drawing::XDrawPageSupplier> 
xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = 
xDrawPageSupplier->getDrawPage();
+    uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+    bool bContourOutside;
+    xShape->getPropertyValue("ContourOutside") >>= bContourOutside;
+    CPPUNIT_ASSERT(bContourOutside);
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf142305StrokeGlowMargin)
 {
     OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf142305StrokeGlowMargin.docx";
diff --git a/writerfilter/qa/cppunittests/dmapper/data/tdf143208_wrapTight.docx 
b/writerfilter/qa/cppunittests/dmapper/data/tdf143208_wrapTight.docx
new file mode 100644
index 000000000000..fab911ad902e
Binary files /dev/null and 
b/writerfilter/qa/cppunittests/dmapper/data/tdf143208_wrapTight.docx differ
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index f67966d0008c..0b0176516745 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1162,6 +1162,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
                         m_pImpl->applyRelativePosition(xShapeProps, 
/*bRelativeOnly=*/true);
 
                         xShapeProps->setPropertyValue("SurroundContour", 
uno::makeAny(m_pImpl->bContour));
+                        xShapeProps->setPropertyValue("ContourOutside", 
uno::makeAny(m_pImpl->bContourOutside));
                         m_pImpl->applyMargins(xShapeProps);
                         xShapeProps->setPropertyValue("Opaque", 
uno::makeAny(m_pImpl->bOpaque));
                         xShapeProps->setPropertyValue("Surround", 
uno::makeAny(static_cast<sal_Int32>(m_pImpl->nWrap)));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to