diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2021-02-18 13:42:00 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-02-25 16:23:50 +0100 |
commit | ca7855c24af858f52a11a593761ee9e6b9d6ba79 (patch) | |
tree | c16874bdcc8a00342209daf01689ae79f6db6fcd /writerfilter/source/dmapper | |
parent | 7ba76115b0e3baefae0ede66848f4340c7c7401b (diff) |
tdf#136570 OOXML import: fix height of OLE objects
e.g. OLE icons or math formulas by skipping unset
border properties.
Regression from 636d16efe45a55c1a5a7a451c46fbb8618bf0393
(tdf#135653 OOXML import: fix OLE background color).
Change-Id: I64bd68037d063de81fbb302b90d65b77af50a622
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111119
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 29 |
1 files changed, 19 insertions, 10 deletions
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 |