diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-06 13:08:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-07 07:10:22 +0100 |
commit | 26a016be816826c80fc914a927758a814f29136c (patch) | |
tree | a9737eb927d6d23264ed818ba2d1c2d79dac4307 /svtools | |
parent | 9a97b9c051735afb3797888d111f1b6b2cab1a83 (diff) |
use more Color in sfx2..svtools
Change-Id: Idd951841ce7e9c4b4e5229bc24efe5c7b8042617
Reviewed-on: https://gerrit.libreoffice.org/50817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 32 | ||||
-rw-r--r-- | svtools/source/config/extcolorcfg.cxx | 2 | ||||
-rw-r--r-- | svtools/source/config/optionsdrawinglayer.cxx | 16 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/accessibleruler.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenuacc.cxx | 8 | ||||
-rw-r--r-- | svtools/source/control/valueacc.cxx | 12 | ||||
-rw-r--r-- | svtools/source/dialogs/colrdlg.cxx | 9 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/svtxgridcontrol.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/unocontroltablemodel.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/unoiface.cxx | 7 |
12 files changed, 50 insertions, 52 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 038c1623b3ad..fa4671a76ab9 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -223,7 +223,11 @@ void ColorConfig_Impl::Load(const OUString& rScheme) for(int i = 0; i < ColorConfigEntryCount && aColors.getLength() > nIndex; ++i) { if(pColors[nIndex].hasValue()) - pColors[nIndex] >>= m_aConfigValues[i].nColor; + { + sal_Int32 nTmp; + pColors[nIndex] >>= nTmp; + m_aConfigValues[i].nColor = Color(nTmp); + } else m_aConfigValues[i].nColor = COL_AUTO; nIndex++; @@ -353,8 +357,8 @@ void ColorConfig_Impl::ImplUpdateApplicationSettings() StyleSettings aStyleSettings( aSettings.GetStyleSettings() ); ColorConfigValue aRet = GetColorConfigValue(svtools::FONTCOLOR); - if(aRet.nColor == COL_AUTO) - aRet.nColor = ColorConfig::GetDefaultColor(svtools::FONTCOLOR).GetColor(); + if(COL_AUTO == aRet.nColor) + aRet.nColor = ColorConfig::GetDefaultColor(svtools::FONTCOLOR); Color aFontColor(aRet.nColor); @@ -400,12 +404,12 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) { COL_WHITE, // DOCCOLOR COL_LIGHTGRAY, // DOCBOUNDARIES - 0xDFDFDE, // APPBACKGROUND + Color(0xDFDFDE), // APPBACKGROUND COL_LIGHTGRAY, // OBJECTBOUNDARIES COL_LIGHTGRAY, // TABLEBOUNDARIES COL_BLACK, // FONTCOLOR COL_BLUE, // LINKS - 0x0000cc, // LINKSVISITED + Color(0x0000cc), // LINKSVISITED COL_LIGHTRED, // SPELL COL_LIGHTMAGENTA, // SMARTTAGS COL_GRAY, // SHADOWCOLOR @@ -415,7 +419,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) COL_BLACK, // WRITERDIRECTCURSOR COL_GREEN, //WRITERSCRIPTINDICATOR COL_LIGHTGRAY, //WRITERSECTIONBOUNDARIES - 0x0369a3, //WRITERHEADERFOOTERMARK, + Color(0x0369a3), //WRITERHEADERFOOTERMARK, COL_BLUE, //WRITERPAGEBREAKS, COL_LIGHTBLUE, // HTMLSGML COL_LIGHTGREEN, // HTMLCOMMENT @@ -423,12 +427,12 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) COL_GRAY, // HTMLUNKNOWN COL_GRAY3, // CALCGRID COL_BLUE, //CALCPAGEBREAK - 0x2300dc, //CALCPAGEBREAKMANUAL + Color(0x2300dc), //CALCPAGEBREAKMANUAL COL_GRAY7, //CALCPAGEBREAKAUTOMATIC COL_LIGHTBLUE, // CALCDETECTIVE COL_LIGHTRED, // CALCDETECTIVEERROR - 0xef0fff, // CALCREFERENCE - 0xffffc0, // CALCNOTESBACKGROUND + Color(0xef0fff), // CALCREFERENCE + Color(0xffffc0), // CALCNOTESBACKGROUND COL_LIGHTGRAY, // DRAWGRID COL_GREEN, // BASICIDENTIFIER, COL_GRAY, // BASICCOMMENT, @@ -437,12 +441,12 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) COL_BLUE, // BASICOPERATOR, COL_BLUE, // BASICKEYWORD, COL_RED, //BASICERROR - 0x009900, // SQLIDENTIFIER + Color(0x009900), // SQLIDENTIFIER COL_BLACK, // SQLNUMBER - 0xCE7B00, // SQLSTRING + Color(0xCE7B00), // SQLSTRING COL_BLACK, // SQLOPERATOR - 0x0000E6, // SQLKEYWORD - 0x259D9D, // SQLPARAMETER + Color(0x0000E6), // SQLKEYWORD + Color(0x259D9D), // SQLPARAMETER COL_GRAY, // SQLCOMMENT }; Color aRet; @@ -491,7 +495,7 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, bool bSmart if (bSmart) { if(aRet.nColor == COL_AUTO) - aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor(); + aRet.nColor = ColorConfig::GetDefaultColor(eEntry); } return aRet; diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 945299289555..76c4c6ac5343 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -353,7 +353,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _ OSL_ENSURE(pColors[i].hasValue(),"Color config entry has NIL as color value set!"); OSL_ENSURE(pDefaultColors[i].hasValue(),"Color config entry has NIL as color value set!"); - sal_Int32 nColor = 0,nDefaultColor = 0; + Color nColor, nDefaultColor; pColors[i] >>= nColor; if ( bDefaultColorFound ) pDefaultColors[i] >>= nDefaultColor; diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index 418ae34c7596..d1e8427eb032 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -37,8 +37,8 @@ using namespace ::com::sun::star::uno ; #define ROOTNODE_START "Office.Common/Drawinglayer" #define DEFAULT_OVERLAYBUFFER true #define DEFAULT_PAINTBUFFER true -#define DEFAULT_STRIPE_COLOR_A 0 -#define DEFAULT_STRIPE_COLOR_B 16581375 +#define DEFAULT_STRIPE_COLOR_A Color(0) +#define DEFAULT_STRIPE_COLOR_B Color(16581375) #define DEFAULT_STRIPE_LENGTH 4 // #i73602# @@ -261,8 +261,8 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : ConfigItem( ROOTNODE_START ), m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER ), m_bPaintBuffer( DEFAULT_PAINTBUFFER ), - m_bStripeColorA(Color(DEFAULT_STRIPE_COLOR_A)), - m_bStripeColorB(Color(DEFAULT_STRIPE_COLOR_B)), + m_bStripeColorA(DEFAULT_STRIPE_COLOR_A), + m_bStripeColorB(DEFAULT_STRIPE_COLOR_B), m_nStripeLength(DEFAULT_STRIPE_LENGTH), // #i73602# @@ -334,7 +334,7 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" ); sal_Int32 nValue = 0; seqValues[nProperty] >>= nValue; - m_bStripeColorA = nValue; + m_bStripeColorA = Color(nValue); } break; @@ -343,7 +343,7 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" ); sal_Int32 nValue = 0; seqValues[nProperty] >>= nValue; - m_bStripeColorB = nValue; + m_bStripeColorB = Color(nValue); } break; @@ -543,11 +543,11 @@ void SvtOptionsDrawinglayer_Impl::ImplCommit() break; case PROPERTYHANDLE_STRIPE_COLOR_A: - aSeqValues[nProperty] <<= m_bStripeColorA.GetColor(); + aSeqValues[nProperty] <<= m_bStripeColorA; break; case PROPERTYHANDLE_STRIPE_COLOR_B: - aSeqValues[nProperty] <<= m_bStripeColorB.GetColor(); + aSeqValues[nProperty] <<= m_bStripeColorB; break; case PROPERTYHANDLE_STRIPE_LENGTH: diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index d04cd408dae4..48c65c97deb6 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -593,7 +593,7 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const too #if defined(OV_DRAWGRID) Color aOldColor (rRenderContext.GetLineColor()); - Color aColor(COL_BLACK); + Color aCOL_BLACK); rRenderContext.SetLineColor( aColor ); Point aOffs(rRenderContext.GetMapMode().GetOrigin()); Size aXSize(GetOutputSizePixel()); diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index c1eb425106de..38fe6a9275fb 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -288,7 +288,7 @@ sal_Int32 SvtRulerAccessible::getForeground( ) ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mpRepr->GetControlForeground().GetColor(); + return sal_Int32(mpRepr->GetControlForeground()); } sal_Int32 SvtRulerAccessible::getBackground( ) { @@ -296,7 +296,7 @@ sal_Int32 SvtRulerAccessible::getBackground( ) ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mpRepr->GetControlBackground().GetColor(); + return sal_Int32(mpRepr->GetControlBackground()); } // XServiceInfo diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 74d91e584b29..611654ae5986 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -394,14 +394,14 @@ void SAL_CALL ToolbarMenuAcc::grabFocus() sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() { ThrowIfDisposed(); - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor(); return static_cast<sal_Int32>(nColor); } sal_Int32 SAL_CALL ToolbarMenuAcc::getBackground() { ThrowIfDisposed(); - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetMenuColor(); return static_cast<sal_Int32>(nColor); } @@ -818,12 +818,12 @@ void SAL_CALL ToolbarMenuEntryAcc::grabFocus() sal_Int32 SAL_CALL ToolbarMenuEntryAcc::getForeground( ) { - return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor()); + return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetMenuTextColor()); } sal_Int32 SAL_CALL ToolbarMenuEntryAcc::getBackground( ) { - return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor()); + return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetMenuColor()); } } diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 4abbb3a4c645..b5cb0ef17f89 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -469,14 +469,14 @@ void SAL_CALL ValueSetAcc::grabFocus() sal_Int32 SAL_CALL ValueSetAcc::getForeground( ) { ThrowIfDisposed(); - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor(); return static_cast<sal_Int32>(nColor); } sal_Int32 SAL_CALL ValueSetAcc::getBackground( ) { ThrowIfDisposed(); - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetWindowColor(); return static_cast<sal_Int32>(nColor); } @@ -1010,17 +1010,17 @@ void SAL_CALL ValueItemAcc::grabFocus() sal_Int32 SAL_CALL ValueItemAcc::getForeground( ) { - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor(); return static_cast<sal_Int32>(nColor); } sal_Int32 SAL_CALL ValueItemAcc::getBackground( ) { - sal_uInt32 nColor; + Color nColor; if (mpParent && mpParent->meType == VALUESETITEM_COLOR) - nColor = mpParent->maColor.GetColor(); + nColor = mpParent->maColor; else - nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + nColor = Application::GetSettings().GetStyleSettings().GetWindowColor(); return static_cast<sal_Int32>(nColor); } diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx index 68aad12d8566..8c60e753f2bf 100644 --- a/svtools/source/dialogs/colrdlg.cxx +++ b/svtools/source/dialogs/colrdlg.cxx @@ -74,7 +74,7 @@ short SvColorDialog::Execute() Sequence< PropertyValue > props( 2 ); props[0].Name = sColor; - props[0].Value <<= static_cast<sal_Int32>(maColor.GetColor()); + props[0].Value <<= maColor; props[1].Name = "Mode"; props[1].Value <<= static_cast<sal_Int16>(meMode); @@ -89,12 +89,7 @@ short SvColorDialog::Execute() { if( props[n].Name == sColor ) { - sal_Int32 nColor = 0; - if( props[n].Value >>= nColor ) - { - maColor = nColor; - } - + props[n].Value >>= maColor; } } } diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 2351564f439e..d19f8c1eae04 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1736,7 +1736,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent } #ifdef DBG_TEST -// rVDev.SetFillColor( COL_WHITE ); +// rVDev.SetFillCOL_WHITE ); rVDev.SetFillColor(); rVDev.SetLineColor( Color( 255 * nExponent / nMSBFactor, 255 - 255 * nExponent / nMSBFactor, 128 - 255 * nExponent / nMSBFactor ) ); rVDev.DrawEllipse( Rectangle(aTileInfo.aNextTileTopLeft.X(), aTileInfo.aTileTopLeft.Y(), @@ -1820,7 +1820,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent } #ifdef DBG_TEST -// rVDev.SetFillColor( COL_WHITE ); +// rVDev.SetFillCOL_WHITE ); rVDev.SetFillColor(); rVDev.SetLineColor( Color( 255 * nExponent / nMSBFactor, 255 - 255 * nExponent / nMSBFactor, 128 - 255 * nExponent / nMSBFactor ) ); rVDev.DrawRect( Rectangle((rTileInfo.aTileTopLeft.X())*rTileSizePixel.Width(), diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 981461fd8b97..148f85a9b359 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -461,7 +461,7 @@ namespace if ( !i_color ) o_colorValue.clear(); else - o_colorValue <<= i_color->GetColor(); + o_colorValue <<= sal_Int32(*i_color); } } @@ -547,7 +547,7 @@ Any SVTXGridControl::getProperty( const OUString& PropertyName ) Sequence< css::util::Color > aAPIColors( aColors->size() ); for ( size_t i=0; i<aColors->size(); ++i ) { - aAPIColors[i] = aColors->at(i).GetColor(); + aAPIColors[i] = sal_Int32(aColors->at(i)); } aPropertyValue <<= aAPIColors; } diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index 36226892970b..b249e40b64f3 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -702,7 +702,7 @@ namespace svt { namespace table ::std::vector< ::Color > aColors( aAPIColors.getLength() ); for ( sal_Int32 i=0; i<aAPIColors.getLength(); ++i ) { - aColors[i] = ::Color( aAPIColors[i] ); + aColors[i] = Color(aAPIColors[i]); } m_pImpl->m_aRowColors.reset( aColors ); } diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 27b2c7180f40..022db626eb7e 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -2122,8 +2122,7 @@ void VCLXProgressBar::setForegroundColor( sal_Int32 nColor ) VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { - Color aColor( nColor ); - pWindow->SetControlForeground( aColor ); + pWindow->SetControlForeground( Color(nColor) ); } } @@ -2134,7 +2133,7 @@ void VCLXProgressBar::setBackgroundColor( sal_Int32 nColor ) VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { - Color aColor( nColor ); + Color aColor = Color( nColor ); pWindow->SetBackground( aColor ); pWindow->SetControlBackground( aColor ); pWindow->Invalidate(); @@ -2222,7 +2221,7 @@ void VCLXProgressBar::setProperty( const OUString& PropertyName, const css::uno: sal_Int32 nColor = 0; if ( Value >>= nColor ) { - Color aColor( nColor ); + Color aColor = Color( nColor ); pWindow->SetControlForeground( aColor ); } } |