Kaydet (Commit) f9d868a5 authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: import drawingml border color for TextFrames

CppunitTest_sw_ooxmlexport's testTextFrameBorders is a reproducer for
this problem.

Change-Id: I0fdf6362fcc487a5002ef7f359dc4d4a1fb03616
üst 05bf939a
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/text/XText.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/chart2/XChartDocument.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp>
...@@ -625,6 +626,22 @@ Reference< XShape > Shape::createAndInsert( ...@@ -625,6 +626,22 @@ Reference< XShape > Shape::createAndInsert(
aShapeProps.setProperty(PROP_BackColorTransparency, aShapeProps[PROP_FillTransparence]); aShapeProps.setProperty(PROP_BackColorTransparency, aShapeProps[PROP_FillTransparence]);
aShapeProps.erase(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 ); PropertySet( xSet ).setProperties( aShapeProps );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment