[Libreoffice-commits] core.git: accessibility/source canvas/source UnoControls/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 7 08:49:50 UTC 2018


 UnoControls/source/controls/progressbar.cxx                   |   12 +++----
 UnoControls/source/inc/progressbar.hxx                        |    4 +-
 accessibility/source/extended/AccessibleBrowseBoxBase.cxx     |   16 +++++-----
 accessibility/source/extended/AccessibleGridControlBase.cxx   |   16 +++++-----
 accessibility/source/extended/accessibletabbar.cxx            |   16 +++++-----
 accessibility/source/standard/accessiblemenucomponent.cxx     |    4 +-
 accessibility/source/standard/vclxaccessibleedit.cxx          |    2 -
 accessibility/source/standard/vclxaccessiblemenubar.cxx       |    2 -
 accessibility/source/standard/vclxaccessiblepopupmenu.cxx     |    2 -
 accessibility/source/standard/vclxaccessibletextcomponent.cxx |    6 +--
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |   12 +++----
 canvas/source/tools/canvastools.cxx                           |    2 -
 12 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit dbcf5b28aacba55d5f48e58a07fa4d6fc06931b9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 7 09:10:26 2018 +0200

    use more Color in UnoControls..canvas
    
    Change-Id: I8dda18f9630b4e59ead83fa7471525bdf4eaeda0
    Reviewed-on: https://gerrit.libreoffice.org/50863
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx
index ebffd5a44069..898c4032ebaf 100644
--- a/UnoControls/source/controls/progressbar.cxx
+++ b/UnoControls/source/controls/progressbar.cxx
@@ -144,7 +144,7 @@ void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor )
     MutexGuard  aGuard (m_aMutex);
 
     // Safe color for later use.
-    m_nForegroundColor = nColor;
+    m_nForegroundColor = Color(nColor);
 
     // Repaint control
     impl_paint ( 0, 0, impl_getGraphicsPeer() );
@@ -158,7 +158,7 @@ void SAL_CALL ProgressBar::setBackgroundColor ( sal_Int32 nColor )
     MutexGuard  aGuard (m_aMutex);
 
     // Safe color for later use.
-    m_nBackgroundColor = nColor;
+    m_nBackgroundColor = Color(nColor);
 
     // Repaint control
     impl_paint ( 0, 0, impl_getGraphicsPeer() );
@@ -316,13 +316,13 @@ void ProgressBar::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGra
 
         // Clear background
         // (same color for line and fill)
-        rGraphics->setFillColor ( m_nBackgroundColor                        );
-        rGraphics->setLineColor ( m_nBackgroundColor                        );
+        rGraphics->setFillColor ( sal_Int32(m_nBackgroundColor) );
+        rGraphics->setLineColor ( sal_Int32(m_nBackgroundColor) );
         rGraphics->drawRect     ( nX, nY, impl_getWidth(), impl_getHeight() );
 
         // same color for line and fill for blocks
-        rGraphics->setFillColor ( m_nForegroundColor );
-        rGraphics->setLineColor ( m_nForegroundColor );
+        rGraphics->setFillColor ( sal_Int32(m_nForegroundColor) );
+        rGraphics->setLineColor ( sal_Int32(m_nForegroundColor) );
 
         sal_Int32   nBlockStart     =   0;   // = left site of new block
         sal_Int32   nBlockCount     =   m_nBlockValue!=0.00 ? static_cast<sal_Int32>((m_nValue-m_nMinRange)/m_nBlockValue) : 0;   // = number of next block
diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx
index a31208ca0c5a..f162f423a58c 100644
--- a/UnoControls/source/inc/progressbar.hxx
+++ b/UnoControls/source/inc/progressbar.hxx
@@ -138,8 +138,8 @@ private:
 
     bool            m_bHorizontal;   // orientation for steps            [true=horizontal/false=vertical]
     css::awt::Size  m_aBlockSize;   // width and height of a block      [>=0,0]
-    sal_Int32       m_nForegroundColor;   //                                  (alpha,r,g,b)
-    sal_Int32       m_nBackgroundColor;   //                                  (alpha,r,g,b)
+    Color           m_nForegroundColor;   //                                  (alpha,r,g,b)
+    Color           m_nBackgroundColor;   //                                  (alpha,r,g,b)
     sal_Int32       m_nMinRange;   // lowest value  =   0%             [long, <_nMaxRange]
     sal_Int32       m_nMaxRange;   // highest value = 100%             [long, >_nMinRange]
     double          m_nBlockValue;   // value for one block              [long, >0]
diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
index 904e0846d8e2..f9ade6d25fa7 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
@@ -478,12 +478,12 @@ sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getForeground(  )
     SolarMethodGuard aGuard(getMutex());
     ensureIsAlive();
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     vcl::Window* pInst = mpBrowseBox->GetWindowInstance();
     if ( pInst )
     {
         if ( pInst->IsControlForeground() )
-            nColor = pInst->GetControlForeground().GetColor();
+            nColor = pInst->GetControlForeground();
         else
         {
             vcl::Font aFont;
@@ -491,11 +491,11 @@ sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getForeground(  )
                 aFont = pInst->GetControlFont();
             else
                 aFont = pInst->GetFont();
-            nColor = aFont.GetColor().GetColor();
+            nColor = aFont.GetColor();
         }
     }
 
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getBackground(  )
@@ -503,17 +503,17 @@ sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getBackground(  )
     SolarMethodGuard aGuard(getMutex());
     ensureIsAlive();
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     vcl::Window* pInst = mpBrowseBox->GetWindowInstance();
     if ( pInst )
     {
         if ( pInst->IsControlBackground() )
-            nColor = pInst->GetControlBackground().GetColor();
+            nColor = pInst->GetControlBackground();
         else
-            nColor = pInst->GetBackground().GetColor().GetColor();
+            nColor = pInst->GetBackground().GetColor();
     }
 
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index 49b5a46f32a2..a5a634feb129 100644
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -392,12 +392,12 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground(  )
 
     ensureIsAlive();
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     vcl::Window* pInst = m_aTable.GetWindowInstance();
     if ( pInst )
     {
         if ( pInst->IsControlForeground() )
-            nColor = pInst->GetControlForeground().GetColor();
+            nColor = pInst->GetControlForeground();
     else
     {
         vcl::Font aFont;
@@ -405,10 +405,10 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground(  )
             aFont = pInst->GetControlFont();
         else
             aFont = pInst->GetFont();
-        nColor = aFont.GetColor().GetColor();
+        nColor = aFont.GetColor();
     }
     }
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground(  )
@@ -416,16 +416,16 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground(  )
     SolarMutexGuard aSolarGuard;
 
     ensureIsAlive();
-    sal_Int32 nColor = 0;
+    Color nColor;
     vcl::Window* pInst = m_aTable.GetWindowInstance();
     if ( pInst )
     {
         if ( pInst->IsControlBackground() )
-            nColor = pInst->GetControlBackground().GetColor();
+            nColor = pInst->GetControlBackground();
     else
-            nColor = pInst->GetBackground().GetColor().GetColor();
+            nColor = pInst->GetBackground().GetColor();
     }
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 
diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx
index 37c9c81d6fdb..f4b111698abf 100644
--- a/accessibility/source/extended/accessibletabbar.cxx
+++ b/accessibility/source/extended/accessibletabbar.cxx
@@ -414,11 +414,11 @@ namespace accessibility
     {
         OExternalLockGuard aGuard( this );
 
-        sal_Int32 nColor = 0;
+        Color nColor;
         if ( m_pTabBar )
         {
             if ( m_pTabBar->IsControlForeground() )
-                nColor = m_pTabBar->GetControlForeground().GetColor();
+                nColor = m_pTabBar->GetControlForeground();
             else
             {
                 vcl::Font aFont;
@@ -426,11 +426,11 @@ namespace accessibility
                     aFont = m_pTabBar->GetControlFont();
                 else
                     aFont = m_pTabBar->GetFont();
-                nColor = aFont.GetColor().GetColor();
+                nColor = aFont.GetColor();
             }
         }
 
-        return nColor;
+        return sal_Int32(nColor);
     }
 
 
@@ -438,16 +438,16 @@ namespace accessibility
     {
         OExternalLockGuard aGuard( this );
 
-        sal_Int32 nColor = 0;
+        Color nColor;
         if ( m_pTabBar )
         {
             if ( m_pTabBar->IsControlBackground() )
-                nColor = m_pTabBar->GetControlBackground().GetColor();
+                nColor = m_pTabBar->GetControlBackground();
             else
-                nColor = m_pTabBar->GetBackground().GetColor().GetColor();
+                nColor = m_pTabBar->GetBackground().GetColor();
         }
 
-        return nColor;
+        return sal_Int32(nColor);
     }
 
 
diff --git a/accessibility/source/standard/accessiblemenucomponent.cxx b/accessibility/source/standard/accessiblemenucomponent.cxx
index f2fd2b9f653c..86a9946c0e12 100644
--- a/accessibility/source/standard/accessiblemenucomponent.cxx
+++ b/accessibility/source/standard/accessiblemenucomponent.cxx
@@ -277,9 +277,9 @@ sal_Int32 OAccessibleMenuComponent::getForeground(  )
     OExternalLockGuard aGuard( this );
 
     const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-    sal_Int32 nColor = rStyleSettings.GetMenuTextColor().GetColor();
+    Color nColor = rStyleSettings.GetMenuTextColor();
 
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index f1959b9dc980..b75484012745 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -336,7 +336,7 @@ Sequence< PropertyValue > VCLXAccessibleEdit::getCharacterAttributes( sal_Int32
                 OutputDevice* pDev = Application::GetDefaultDevice();
                 if ( pDev )
                 {
-                    aValue.Value <<= static_cast< sal_Int32 >(pDev->GetSettings().GetStyleSettings().GetFieldTextColor().GetColor());
+                    aValue.Value <<= pDev->GetSettings().GetStyleSettings().GetFieldTextColor();
                 }
             }
             break;
diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx b/accessibility/source/standard/vclxaccessiblemenubar.cxx
index ba5715e5d9de..80509f517ae1 100644
--- a/accessibility/source/standard/vclxaccessiblemenubar.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenubar.cxx
@@ -185,7 +185,7 @@ sal_Int32 VCLXAccessibleMenuBar::getBackground(  )
 {
     OExternalLockGuard aGuard( this );
 
-    return Application::GetSettings().GetStyleSettings().GetMenuBarColor().GetColor();
+    return sal_Int32(Application::GetSettings().GetStyleSettings().GetMenuBarColor());
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx b/accessibility/source/standard/vclxaccessiblepopupmenu.cxx
index 005a6243755d..a5f1e0620a9a 100644
--- a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx
+++ b/accessibility/source/standard/vclxaccessiblepopupmenu.cxx
@@ -78,7 +78,7 @@ sal_Int32 VCLXAccessiblePopupMenu::getBackground(  )
 {
     OExternalLockGuard aGuard( this );
 
-    return Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
+    return sal_Int32(Application::GetSettings().GetStyleSettings().GetMenuColor());
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index fba126a63497..44dee58c31e8 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -170,8 +170,8 @@ Sequence< PropertyValue > VCLXAccessibleTextComponent::getCharacterAttributes( s
     {
         vcl::Font aFont = GetWindow()->GetControlFont();
 
-        sal_Int32 nBackColor = GetWindow()->GetControlBackground().GetColor();
-        sal_Int32 nColor = GetWindow()->GetControlForeground().GetColor();
+        Color nBackColor = GetWindow()->GetControlBackground();
+        Color nColor = GetWindow()->GetControlForeground();
 
         // MT: Code with default font was introduced with the IA2 CWS, but I am not convinced that this is the correct font...
         // Decide what to do when we have a concrete issue.
@@ -222,7 +222,7 @@ Sequence< PropertyValue > VCLXAccessibleTextComponent::getCharacterAttributes( s
         }
         */
 
-        aValues = CharacterAttributesHelper( aFont, nBackColor, nColor )
+        aValues = CharacterAttributesHelper( aFont, sal_Int32(nBackColor), sal_Int32(nColor) )
             .GetCharacterAttributes( aRequestedAttributes );
     }
 
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index f309445fad11..20707c94b7e2 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -582,22 +582,22 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getForeground(  )
 {
     OExternalLockGuard aGuard( this );
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     if ( m_pToolBox )
-       nColor = m_pToolBox->GetControlForeground().GetColor();
+       nColor = m_pToolBox->GetControlForeground();
 
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getBackground(  )
 {
     OExternalLockGuard aGuard( this );
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     if ( m_pToolBox )
-       nColor = m_pToolBox->GetControlBackground().GetColor();
+       nColor = m_pToolBox->GetControlBackground();
 
-    return nColor;
+    return sal_Int32(nColor);
 }
 
 // XAccessibleExtendedComponent
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx
index 63f264779b9a..10d109f5a52c 100644
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -908,7 +908,7 @@ namespace canvas
             pCols[2] = rColor.GetBlue();
             pCols[3] = 255-rColor.GetTransparency();
 #else
-            *reinterpret_cast<sal_Int32*>(pCols) = rColor.GetColor();
+            *reinterpret_cast<sal_Int32*>(pCols) = sal_Int32(rColor);
 #endif
             return aRet;
         }


More information about the Libreoffice-commits mailing list