[Libreoffice-commits] core.git: accessibility/source editeng/source framework/source sc/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Feb 28 10:51:57 UTC 2018


 accessibility/source/extended/textwindowaccessibility.cxx |    3 +--
 accessibility/source/standard/vclxaccessibleedit.cxx      |    2 +-
 editeng/source/items/frmitems.cxx                         |    9 ++++-----
 framework/source/xml/imagesdocumenthandler.cxx            |    2 +-
 sc/source/filter/excel/xechart.cxx                        |    5 +----
 5 files changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 5564a31c3fe1098fd72635238d33a3dbafb8b62e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 27 15:06:21 2018 +0200

    use less COLORDATA_RGB
    
    part of removing ColorData
    
    Change-Id: I5518cddeeefe66f70380367e1e3f78af0f3b5fbc
    Reviewed-on: https://gerrit.libreoffice.org/50486
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index a4de8a27c67a..4c5309795867 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -2352,8 +2352,7 @@ void Document::disposeParagraphs()
 // static
 css::uno::Any Document::mapFontColor(::Color const & rColor)
 {
-    return css::uno::Any(
-        static_cast< ::sal_Int32 >(COLORDATA_RGB(rColor.GetColor())));
+    return css::uno::makeAny(rColor.GetRGBColor());
         // FIXME  keep transparency?
 }
 
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index 17146ae2518c..f1959b9dc980 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -319,7 +319,7 @@ Sequence< PropertyValue > VCLXAccessibleEdit::getCharacterAttributes( sal_Int32
             {
                 if (aValue.Name == "CharColor")
                 {
-                    aValue.Value <<= static_cast< sal_Int32 >(COLORDATA_RGB(pFontColor->GetColor().GetColor()));
+                    aValue.Value <<= pFontColor->GetColor().GetRGBColor();
                     break;
                 }
             }
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 040f1a53fe09..5d3f3370bbde 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3243,15 +3243,14 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         case MID_BACK_COLOR:
         case MID_BACK_COLOR_R_G_B:
         {
-            sal_Int32 nCol = 0;
-            if ( !( rVal >>= nCol ) )
+            Color aNewCol;
+            if ( !( rVal >>= aNewCol ) )
                 return false;
             if(MID_BACK_COLOR_R_G_B == nMemberId)
             {
-                nCol = COLORDATA_RGB( nCol );
-                nCol += aColor.GetColor() & 0xff000000;
+                aNewCol.SetTransparency(aColor.GetTransparency());
             }
-            aColor = Color( nCol );
+            aColor = aNewCol;
         }
         break;
         case MID_BACK_COLOR_TRANSPARENCY:
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index 327e666fde9d..28ec385b2f3e 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -224,7 +224,7 @@ void SAL_CALL OReadImagesDocumentHandler::startElement(
                                     // the color value is given as #rrggbb and used the hexadecimal system!!
                                     sal_uInt32 nColor = aColor.copy( 1 ).toUInt32( 16 );
 
-                                    m_pImages->aMaskColor = Color( COLORDATA_RGB( nColor ) );
+                                    m_pImages->aMaskColor = Color( nColor );
                                 }
                             }
                             break;
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index b0d0837214f9..e864d192e617 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -706,10 +706,7 @@ sal_uInt32 XclExpChEscherFormat::RegisterColor( sal_uInt16 nPropId )
     if( maData.mxEscherSet && maData.mxEscherSet->GetOpt( nPropId, nBGRValue ) )
     {
         // swap red and blue
-        Color aColor( Color(
-            COLORDATA_BLUE( nBGRValue ),
-            COLORDATA_GREEN( nBGRValue ),
-            COLORDATA_RED( nBGRValue ) ) );
+        Color aColor( nBGRValue & 0xff, (nBGRValue >> 8) & 0xff, (nBGRValue >> 16) & 0xff );
         return GetPalette().InsertColor( aColor, EXC_COLOR_CHARTAREA );
     }
     return XclExpPalette::GetColorIdFromIndex( EXC_COLOR_CHWINDOWBACK );


More information about the Libreoffice-commits mailing list