diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-17 16:56:08 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-17 17:44:39 +0100 |
commit | 88ebaff73533fdbbd7ecbf24a0e892f411c577a0 (patch) | |
tree | d8a0c81d2d0836339fe543056fa624056d29591e | |
parent | 0a51d18b5aec457b74bf4bf01d0363aab1dc0593 (diff) |
VML import of TextFrame border color
Change-Id: I8c0cf9e3ac17b87cbfdd4e744632c5306e2abfc2
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 72c4ca114fc2..0fa3a3d17996 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/SizeType.hpp> @@ -360,12 +361,30 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con maTypeModel.maStrokeModel.pushToPropMap( aPropMap, rGraphicHelper ); maTypeModel.maFillModel.pushToPropMap( aPropMap, rGraphicHelper ); - // TextFrames have BackColor, not FillColor uno::Reference<lang::XServiceInfo> xSInfo(rxShape, uno::UNO_QUERY_THROW); - if (xSInfo->supportsService("com.sun.star.text.TextFrame") && aPropMap.hasProperty(PROP_FillColor)) + if (xSInfo->supportsService("com.sun.star.text.TextFrame")) { - aPropMap.setProperty(PROP_BackColor, aPropMap[PROP_FillColor]); - aPropMap.erase(PROP_FillColor); + // TextFrames have BackColor, not FillColor + if (aPropMap.hasProperty(PROP_FillColor)) + { + aPropMap.setProperty(PROP_BackColor, aPropMap[PROP_FillColor]); + aPropMap.erase(PROP_FillColor); + } + // And no LineColor property; individual borders can have colors + if (aPropMap.hasProperty(PROP_LineColor)) + { + uno::Reference<beans::XPropertySet> xPropertySet(rxShape, uno::UNO_QUERY); + static sal_Int32 aBorders[] = { + PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i) + { + table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<table::BorderLine2>(); + aBorderLine.Color = aPropMap[PROP_LineColor].get<sal_Int32>(); + aPropMap.setProperty(aBorders[i], uno::makeAny(aBorderLine)); + } + aPropMap.erase(PROP_LineColor); + } } PropertySet( rxShape ).setProperties( aPropMap ); |