oox/source/drawingml/shape.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit f9d868a5fedcd8e55b1537876e4457c1139bfa3c
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Dec 19 12:26:53 2013 +0100

    oox: import drawingml border color for TextFrames
    
    CppunitTest_sw_ooxmlexport's testTextFrameBorders is a reproducer for
    this problem.
    
    Change-Id: I0fdf6362fcc487a5002ef7f359dc4d4a1fb03616

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 72c7547..a28b1b4 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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to