diff options
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 2 | ||||
-rwxr-xr-x | sw/qa/extras/layout/data/tdf138465min.docx | bin | 0 -> 19431 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 29 |
4 files changed, 36 insertions, 11 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index b6caaa0f3214..2d4e99c7be3f 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -1457,7 +1457,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes oox::drawingml::ShapePropertyMap aPropMap(mrDrawing.getFilter().getModelObjectHelper()); const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper(); maTypeModel.maStrokeModel.pushToPropMap(aPropMap, rGraphicHelper); - //And, fill-color properties as well... + // And, fill-color properties as well... maTypeModel.maFillModel.pushToPropMap(aPropMap, rGraphicHelper); PropertySet(xShape).setProperties(aPropMap); diff --git a/sw/qa/extras/layout/data/tdf138465min.docx b/sw/qa/extras/layout/data/tdf138465min.docx Binary files differnew file mode 100755 index 000000000000..d576a54f281f --- /dev/null +++ b/sw/qa/extras/layout/data/tdf138465min.docx diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index de6c48d56783..0b3f23d48bc7 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -518,6 +518,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425) assertXPath(pXmlDoc, "//textarray", 14); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops) +{ + CPPUNIT_ASSERT(createDoc("tdf138465min.docx")); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + CPPUNIT_ASSERT(pXmlDoc); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: >300 + // - Actual : 142 + // i.e. the formula squashed + CPPUNIT_ASSERT_GREATEREQUAL( + double(300), + getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/notxt/infos/bounds", "height") + .toDouble()); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123268) { SwDoc* pDoc = createDoc("tdf123268.odt"); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8ace7179ad18..c102d7bcc565 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2321,11 +2321,13 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share xReplacementProperties->getPropertyValue("LineWidth") >>= aBorderProps.LineWidth; xReplacementProperties->getPropertyValue("LineStyle") >>= aBorderProps.LineStyle; - xOLEProperties->setPropertyValue("RightBorder", uno::Any(aBorderProps)); - xOLEProperties->setPropertyValue("TopBorder", uno::Any(aBorderProps)); - xOLEProperties->setPropertyValue("LeftBorder", uno::Any(aBorderProps)); - xOLEProperties->setPropertyValue("BottomBorder", uno::Any(aBorderProps)); - + if (aBorderProps.LineStyle) // Set line props only if LineStyle is set + { + xOLEProperties->setPropertyValue("RightBorder", uno::Any(aBorderProps)); + xOLEProperties->setPropertyValue("TopBorder", uno::Any(aBorderProps)); + xOLEProperties->setPropertyValue("LeftBorder", uno::Any(aBorderProps)); + xOLEProperties->setPropertyValue("BottomBorder", uno::Any(aBorderProps)); + } OUString pProperties[] = { "AnchorType", "Surround", @@ -2339,17 +2341,24 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share "LeftMargin", "RightMargin", "TopMargin", - "BottomMargin", - "FillStyle", - "FillColor", - "FillColor2", - "LineStyle", + "BottomMargin" }; for (const OUString& s : pProperties) { const uno::Any aVal = xReplacementProperties->getPropertyValue(s); xOLEProperties->setPropertyValue(s, aVal); } + + if (xReplacementProperties->getPropertyValue("FillStyle").get<css::drawing::FillStyle>() + != css::drawing::FillStyle::FillStyle_NONE) // Apply fill props if style is set + { + xOLEProperties->setPropertyValue( + "FillStyle", xReplacementProperties->getPropertyValue("FillStyle")); + xOLEProperties->setPropertyValue( + "FillColor", xReplacementProperties->getPropertyValue("FillColor")); + xOLEProperties->setPropertyValue( + "FillColor2", xReplacementProperties->getPropertyValue("FillColor2")); + } } else // mimic the treatment of graphics here... it seems anchoring as character |