[Libreoffice-commits] core.git: 2 commits - oox/source sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Apr 15 17:25:43 PDT 2015


 oox/source/export/chartexport.cxx         |    4 +++
 sc/source/filter/inc/condformatbuffer.hxx |    4 +--
 sc/source/filter/oox/condformatbuffer.cxx |   40 ++++++++++++++++++++++++------
 3 files changed, 38 insertions(+), 10 deletions(-)

New commits:
commit f9f53c4a8c9e1cd2fa1a9f48576b09f1bfd023ae
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Apr 16 02:22:41 2015 +0200

    support tint for databar and colorscale colors, related tdf#90511
    
    Change-Id: I59b00ab856583ed08f70c9c90469bbb44cb5782a

diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index c3154ea..31ae39a 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -224,9 +224,9 @@ struct ExCfRuleModel
     bool mbGradient;
     OUString maAxisPosition;
     // AxisColor
-    sal_Int32 mnAxisColor;
+    sal_uInt32 mnAxisColor;
     // NegativeFillColor
-    sal_Int32 mnNegativeColor;
+    sal_uInt32 mnNegativeColor;
     // Cfvo
     bool mbIsLower;
     OUString maColorScaleType;
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 1992d3c..7e0a0f5 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -161,29 +161,42 @@ void ColorScaleRule::importCfvo( const AttributeList& rAttribs )
 
 namespace {
 
-::Color RgbToRgbComponents( sal_Int32& nRgb )
+::Color ARgbToARgbComponents( sal_uInt32& nRgb )
 {
+    sal_Int32 ornA = 255 - ((nRgb >> 24) & 0xFF);
     sal_Int32 ornR = (nRgb >> 16) & 0xFF;
     sal_Int32 ornG = (nRgb >> 8) & 0xFF;
     sal_Int32 ornB = nRgb & 0xFF;
 
-    return ::Color(ornR, ornG, ornB);
+    return ::Color(ornA, ornR, ornG, ornB);
 }
 
 }
 
 void ColorScaleRule::importColor( const AttributeList& rAttribs )
 {
-    sal_Int32 nColor = 0;
+    sal_uInt32 nColor = 0;
     if( rAttribs.hasAttribute( XML_rgb ) )
         nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT );
     else if( rAttribs.hasAttribute( XML_theme ) )
     {
         sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 );
         nColor = getTheme().getColorByIndex( nThemeIndex );
+
     }
 
-    ::Color aColor = RgbToRgbComponents( nColor );
+    ::Color aColor;
+    double nTint = rAttribs.getDouble(XML_tint, 0.0);
+    if (nTint != 0.0)
+    {
+        oox::drawingml::Color aDMColor;
+        aDMColor.setSrgbClr(nColor);
+        aDMColor.addExcelTintTransformation(nTint);
+        nColor = aDMColor.getColor(getBaseFilter().getGraphicHelper());
+        aColor = ::Color(nColor);
+    }
+    else
+        aColor = ARgbToARgbComponents( nColor );
 
     if(mnCol >= maColorScaleRuleEntries.size())
         maColorScaleRuleEntries.push_back(ColorScaleRuleModelEntry());
@@ -239,7 +252,7 @@ DataBarRule::DataBarRule( const CondFormat& rFormat ):
 
 void DataBarRule::importColor( const AttributeList& rAttribs )
 {
-    sal_Int32 nColor = 0;
+    sal_uInt32 nColor = 0;
     if( rAttribs.hasAttribute( XML_rgb ) )
         nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT );
     else if( rAttribs.hasAttribute( XML_theme ) )
@@ -248,7 +261,18 @@ void DataBarRule::importColor( const AttributeList& rAttribs )
         nColor = getTheme().getColorByIndex( nThemeIndex );
     }
 
-    ::Color aColor = RgbToRgbComponents( nColor );
+    ::Color aColor;
+    double nTint = rAttribs.getDouble(XML_tint, 0.0);
+    if (nTint != 0.0)
+    {
+        oox::drawingml::Color aDMColor;
+        aDMColor.setSrgbClr(nColor);
+        aDMColor.addExcelTintTransformation(nTint);
+        nColor = aDMColor.getColor(getBaseFilter().getGraphicHelper());
+        aColor = ::Color(nColor);
+    }
+    else
+        aColor = ARgbToARgbComponents( nColor );
 
     mxFormat->maPositiveColor = aColor;
 }
@@ -1119,13 +1143,13 @@ void ExtCfRule::finalizeImport()
         case AXISCOLOR:
         {
             ScDataBarFormatData* pDataBar = mpTarget;
-            pDataBar->maAxisColor = RgbToRgbComponents(maModel.mnAxisColor);
+            pDataBar->maAxisColor = ARgbToARgbComponents(maModel.mnAxisColor);
             break;
         }
         case NEGATIVEFILLCOLOR:
         {
             ScDataBarFormatData* pDataBar = mpTarget;
-            pDataBar->mpNegativeColor.reset( new ::Color( RgbToRgbComponents(maModel.mnNegativeColor) ) );
+            pDataBar->mpNegativeColor.reset( new ::Color( ARgbToARgbComponents(maModel.mnNegativeColor) ) );
             pDataBar->mbNeg = true;
             break;
         }
commit cb2063832dd64d39ec57d70d0637fe23412c096d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Apr 16 02:04:51 2015 +0200

    we don't support roundedCorners, tdf#90533
    
    Change-Id: Ic02c8c265792356fccedb310a44997443e46589a

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index edc1176..63d7765 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -745,6 +745,10 @@ void ChartExport::exportChartSpace( Reference< ::com::sun::star::chart::XChartDo
             XML_val, "en-US",
             FSEND );
 
+    pFS->singleElement(FSNS( XML_c, XML_roundedCorners),
+            XML_val, "0",
+            FSEND);
+
     if( !bIncludeTable )
     {
         // TODO:external data


More information about the Libreoffice-commits mailing list