Kaydet (Commit) dbcf5b28 authored tarafından Noel Grandin's avatar Noel Grandin

use more Color in UnoControls..canvas

Change-Id: I8dda18f9630b4e59ead83fa7471525bdf4eaeda0
Reviewed-on: https://gerrit.libreoffice.org/50863Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 39a13fa6
......@@ -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
......
......@@ -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]
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -185,7 +185,7 @@ sal_Int32 VCLXAccessibleMenuBar::getBackground( )
{
OExternalLockGuard aGuard( this );
return Application::GetSettings().GetStyleSettings().GetMenuBarColor().GetColor();
return sal_Int32(Application::GetSettings().GetStyleSettings().GetMenuBarColor());
}
......
......@@ -78,7 +78,7 @@ sal_Int32 VCLXAccessiblePopupMenu::getBackground( )
{
OExternalLockGuard aGuard( this );
return Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
return sal_Int32(Application::GetSettings().GetStyleSettings().GetMenuColor());
}
......
......@@ -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 );
}
......
......@@ -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
......
......@@ -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;
}
......
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