diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-19 12:26:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-19 12:30:08 +0100 |
commit | f9d868a5fedcd8e55b1537876e4457c1139bfa3c (patch) | |
tree | 30d34a7e1a81a6f867dc812c784033aa12981291 /oox | |
parent | 05bf939a5855a973ab6f5c70c44c210daa280908 (diff) |
oox: import drawingml border color for TextFrames
CppunitTest_sw_ooxmlexport's testTextFrameBorders is a reproducer for
this problem.
Change-Id: I0fdf6362fcc487a5002ef7f359dc4d4a1fb03616
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 72c75475c694..a28b1b4c1b1e 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/text/XText.hpp> +#include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/io/XOutputStream.hpp> @@ -625,6 +626,22 @@ Reference< XShape > Shape::createAndInsert( aShapeProps.setProperty(PROP_BackColorTransparency, aShapeProps[PROP_FillTransparence]); aShapeProps.erase(PROP_FillTransparence); } + // And no LineColor property; individual borders can have colors + if (aShapeProps.hasProperty(PROP_LineColor)) + { + uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY); + static const sal_Int32 aBorders[] = + { + PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i) + { + css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<css::table::BorderLine2>(); + aBorderLine.Color = aShapeProps[PROP_LineColor].get<sal_Int32>(); + aShapeProps.setProperty(aBorders[i], uno::makeAny(aBorderLine)); + } + aShapeProps.erase(PROP_LineColor); + } } PropertySet( xSet ).setProperties( aShapeProps ); |