[Libreoffice-commits] core.git: sc/inc sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed Mar 7 06:11:51 UTC 2018
sc/inc/appoptio.hxx | 24 ++++-----
sc/source/core/data/document10.cxx | 2
sc/source/core/tool/appoptio.cxx | 24 ++++-----
sc/source/core/tool/detfunc.cxx | 8 +--
sc/source/core/tool/viewopti.cxx | 2
sc/source/filter/excel/xestyle.cxx | 8 +--
sc/source/filter/excel/xiescher.cxx | 2
sc/source/filter/excel/xistyle.cxx | 2
sc/source/filter/excel/xlstyle.cxx | 34 ++++++-------
sc/source/filter/html/htmlexp.cxx | 2
sc/source/filter/inc/stylesbuffer.hxx | 12 ++--
sc/source/filter/inc/themebuffer.hxx | 4 -
sc/source/filter/inc/viewsettings.hxx | 2
sc/source/filter/oox/condformatbuffer.cxx | 17 +-----
sc/source/filter/oox/pagesettings.cxx | 2
sc/source/filter/oox/stylesbuffer.cxx | 52 ++++++++++----------
sc/source/filter/oox/themebuffer.cxx | 8 +--
sc/source/filter/oox/viewsettings.cxx | 4 -
sc/source/filter/xcl97/xcl97rec.cxx | 2
sc/source/filter/xml/xmlsceni.cxx | 6 --
sc/source/ui/Accessibility/AccessibleCellBase.cxx | 8 +--
sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 8 +--
sc/source/ui/app/rfindlst.cxx | 4 -
sc/source/ui/cctrl/cbuttonw.cxx | 2
sc/source/ui/optdlg/opredlin.cxx | 18 +++---
sc/source/ui/sidebar/CellBorderUpdater.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 4 -
sc/source/ui/unoobj/condformatuno.cxx | 13 +----
sc/source/ui/unoobj/confuno.cxx | 2
sc/source/ui/unoobj/viewuno.cxx | 4 -
sc/source/ui/vba/vbaborders.cxx | 2
sc/source/ui/vba/vbainterior.cxx | 19 +++----
sc/source/ui/vba/vbapalette.cxx | 16 +++---
sc/source/ui/view/formatsh.cxx | 2
sc/source/ui/view/viewdata.cxx | 7 +-
35 files changed, 154 insertions(+), 174 deletions(-)
New commits:
commit 9d1f56903b05841020dfae21dca0c686483b2494
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Mar 6 13:34:11 2018 +0200
use more Color in sc
Change-Id: Ifdd53fa0eed8cec7878d0f5b9eea1e2c826e3ae5
Reviewed-on: https://gerrit.libreoffice.org/50819
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index cdc055e07ee2..43a75832be4b 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -57,14 +57,14 @@ public:
void SetDetectiveAuto( bool bNew ) { bDetectiveAuto = bNew; }
bool GetDetectiveAuto() const { return bDetectiveAuto; }
- void SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; }
- sal_uInt32 GetTrackContentColor() const { return nTrackContentColor; }
- void SetTrackInsertColor(sal_uInt32 nNew) { nTrackInsertColor = nNew; }
- sal_uInt32 GetTrackInsertColor() const { return nTrackInsertColor; }
- void SetTrackDeleteColor(sal_uInt32 nNew) { nTrackDeleteColor = nNew; }
- sal_uInt32 GetTrackDeleteColor() const { return nTrackDeleteColor; }
- void SetTrackMoveColor(sal_uInt32 nNew) { nTrackMoveColor = nNew; }
- sal_uInt32 GetTrackMoveColor() const { return nTrackMoveColor; }
+ void SetTrackContentColor(Color nNew) { nTrackContentColor = nNew; }
+ Color GetTrackContentColor() const { return nTrackContentColor; }
+ void SetTrackInsertColor(Color nNew) { nTrackInsertColor = nNew; }
+ Color GetTrackInsertColor() const { return nTrackInsertColor; }
+ void SetTrackDeleteColor(Color nNew) { nTrackDeleteColor = nNew; }
+ Color GetTrackDeleteColor() const { return nTrackDeleteColor; }
+ void SetTrackMoveColor(Color nNew) { nTrackMoveColor = nNew; }
+ Color GetTrackMoveColor() const { return nTrackMoveColor; }
ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
@@ -92,10 +92,10 @@ private:
sal_uInt32 nStatusFunc;
bool bAutoComplete;
bool bDetectiveAuto;
- sal_uInt32 nTrackContentColor;
- sal_uInt32 nTrackInsertColor;
- sal_uInt32 nTrackDeleteColor;
- sal_uInt32 nTrackMoveColor;
+ Color nTrackContentColor;
+ Color nTrackInsertColor;
+ Color nTrackDeleteColor;
+ Color nTrackMoveColor;
ScLkUpdMode eLinkMode;
sal_Int32 nDefaultObjectSizeWidth;
sal_Int32 nDefaultObjectSizeHeight;
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 2c944e12e6ae..2de34d272730 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -196,7 +196,7 @@ std::set<Color> ScDocument::GetDocColors()
if (pItem == nullptr)
continue;
Color aColor( pItem->GetValue() );
- if (COL_AUTO != aColor.GetColor())
+ if (COL_AUTO != aColor)
aDocColors.insert(aColor);
}
}
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index f291105c04fe..464baa9fc251 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -72,10 +72,10 @@ void ScAppOptions::SetDefaults()
pLRUList[4] = SC_OPCODE_IF;
nLRUFuncCount = 5;
- nTrackContentColor = sal_uInt32(COL_TRANSPARENT);
- nTrackInsertColor = sal_uInt32(COL_TRANSPARENT);
- nTrackDeleteColor = sal_uInt32(COL_TRANSPARENT);
- nTrackMoveColor = sal_uInt32(COL_TRANSPARENT);
+ nTrackContentColor = COL_TRANSPARENT;
+ nTrackInsertColor = COL_TRANSPARENT;
+ nTrackDeleteColor = COL_TRANSPARENT;
+ nTrackMoveColor = COL_TRANSPARENT;
eLinkMode = LM_ON_DEMAND;
nDefaultObjectSizeWidth = 8000;
@@ -426,16 +426,16 @@ ScAppCfg::ScAppCfg() :
switch(nProp)
{
case SCREVISOPT_CHANGE:
- if (pValues[nProp] >>= nIntVal) SetTrackContentColor( static_cast<sal_uInt32>(nIntVal) );
+ if (pValues[nProp] >>= nIntVal) SetTrackContentColor( Color(nIntVal) );
break;
case SCREVISOPT_INSERTION:
- if (pValues[nProp] >>= nIntVal) SetTrackInsertColor( static_cast<sal_uInt32>(nIntVal) );
+ if (pValues[nProp] >>= nIntVal) SetTrackInsertColor( Color(nIntVal) );
break;
case SCREVISOPT_DELETION:
- if (pValues[nProp] >>= nIntVal) SetTrackDeleteColor( static_cast<sal_uInt32>(nIntVal) );
+ if (pValues[nProp] >>= nIntVal) SetTrackDeleteColor( Color(nIntVal) );
break;
case SCREVISOPT_MOVEDENTRY:
- if (pValues[nProp] >>= nIntVal) SetTrackMoveColor( static_cast<sal_uInt32>(nIntVal) );
+ if (pValues[nProp] >>= nIntVal) SetTrackMoveColor( Color(nIntVal) );
break;
}
}
@@ -608,16 +608,16 @@ IMPL_LINK_NOARG(ScAppCfg, RevisionCommitHdl, ScLinkConfigItem&, void)
switch(nProp)
{
case SCREVISOPT_CHANGE:
- pValues[nProp] <<= static_cast<sal_Int32>(GetTrackContentColor());
+ pValues[nProp] <<= GetTrackContentColor();
break;
case SCREVISOPT_INSERTION:
- pValues[nProp] <<= static_cast<sal_Int32>(GetTrackInsertColor());
+ pValues[nProp] <<= GetTrackInsertColor();
break;
case SCREVISOPT_DELETION:
- pValues[nProp] <<= static_cast<sal_Int32>(GetTrackDeleteColor());
+ pValues[nProp] <<= GetTrackDeleteColor();
break;
case SCREVISOPT_MOVEDENTRY:
- pValues[nProp] <<= static_cast<sal_Int32>(GetTrackMoveColor());
+ pValues[nProp] <<= GetTrackMoveColor();
break;
}
}
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 7eebfedd2bcf..f8f5ac045c68 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -121,9 +121,9 @@ private:
SfxItemSet aCaptionSet;
};
-Color ScDetectiveFunc::nArrowColor = 0;
-Color ScDetectiveFunc::nErrorColor = 0;
-Color ScDetectiveFunc::nCommentColor = 0;
+Color ScDetectiveFunc::nArrowColor = Color(0);
+Color ScDetectiveFunc::nErrorColor = Color(0);
+Color ScDetectiveFunc::nCommentColor = Color(0);
bool ScDetectiveFunc::bColorsInitialized = false;
static bool lcl_HasThickLine( const SdrObject& rObj )
@@ -1579,7 +1579,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject,
FindFrameForObject( pObject, rSource ); // modifies rSource
}
- Color nObjColor = pObject->GetMergedItem(XATTR_LINECOLOR).GetColorValue().GetColor();
+ Color nObjColor = pObject->GetMergedItem(XATTR_LINECOLOR).GetColorValue();
if ( nObjColor == GetErrorColor() && nObjColor != GetArrowColor() )
rRedLine = true;
}
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 6d4d4bf05789..d882e82e6fd2 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -490,7 +490,7 @@ IMPL_LINK_NOARG(ScViewCfg, LayoutCommitHdl, ScLinkConfigItem&, void)
switch(nProp)
{
case SCLAYOUTOPT_GRIDCOLOR:
- pValues[nProp] <<= static_cast<sal_Int32>(GetGridColor().GetColor());
+ pValues[nProp] <<= GetGridColor();
break;
case SCLAYOUTOPT_GRIDLINES:
pValues[nProp] <<= GetOption( VOPT_GRID );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index a8f7d6b1bcfc..6ac14466b7d3 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -251,7 +251,7 @@ public:
sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx, sal_uInt8& rnXclPattern,
sal_uInt32 nForeColorId, sal_uInt32 nBackColorId ) const;
- /** Returns the RGB color data for a (non-zero-based) Excel palette entry.
+ /** Returns the RGB color for a (non-zero-based) Excel palette entry.
@return The color from current or default palette or COL_AUTO, if nothing else found. */
Color GetColor( sal_uInt16 nXclIndex ) const;
@@ -467,7 +467,7 @@ Color XclExpPaletteImpl::GetColor( sal_uInt16 nXclIndex ) const
{
sal_uInt32 nIdx = nXclIndex - EXC_COLOR_USEROFFSET;
if( nIdx < maPalette.size() )
- return maPalette[ nIdx ].maColor.GetColor();
+ return maPalette[ nIdx ].maColor;
}
return mrDefPal.GetDefColor( nXclIndex );
}
@@ -541,7 +541,7 @@ XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt3
bFound = pEntry->GetColor() == rColor;
if( !bFound )
{
- if( pEntry->GetColor().GetColor() < rColor.GetColor() )
+ if( pEntry->GetColor() < rColor )
nBegIdx = rnIndex + 1;
else
nEndIdx = rnIndex;
@@ -946,7 +946,7 @@ namespace {
sal_uInt32 lclCalcHash( const XclFontData& rFontData )
{
sal_uInt32 nHash = rFontData.maName.getLength();
- nHash += rFontData.maColor.GetColor() * 2;
+ nHash += sal_uInt32(rFontData.maColor) * 2;
nHash += rFontData.mnWeight * 3;
nHash += rFontData.mnCharSet * 5;
nHash += rFontData.mnFamily * 7;
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 8ba239b0862d..f38c13f75ca0 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2210,7 +2210,7 @@ void XclImpCheckBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const
// background color
if( maFillData.IsFilled() )
{
- sal_Int32 nColor = static_cast< sal_Int32 >( GetSolidFillColor( maFillData ).GetColor() );
+ sal_Int32 nColor = static_cast< sal_Int32 >( GetSolidFillColor( maFillData ) );
rPropSet.SetProperty( "BackgroundColor", nColor );
}
}
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 1187deb0c658..1059f886d38b 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -168,7 +168,7 @@ void XclImpPalette::ReadPalette( XclImpStream& rStrm )
for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
rStrm >> aColor;
- maColorTable[ nIndex ] = aColor.GetColor();
+ maColorTable[ nIndex ] = aColor;
}
ExportPalette();
}
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index 3c32027ce5cc..673b2a5bf62c 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -36,10 +36,10 @@
/** Standard EGA colors, bright. */
#define EXC_PALETTE_EGA_COLORS_LIGHT \
- 0x000000, 0xFFFFFF, 0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF
+ Color(0x000000), Color(0xFFFFFF), Color(0xFF0000), Color(0x00FF00), Color(0x0000FF), Color(0xFFFF00), Color(0xFF00FF), Color(0x00FFFF)
/** Standard EGA colors, dark. */
#define EXC_PALETTE_EGA_COLORS_DARK \
- 0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080
+ Color(0x800000), Color(0x008000), Color(0x000080), Color(0x808000), Color(0x800080), Color(0x008080), Color(0xC0C0C0), Color(0x808080)
/** Default color table for BIFF2. */
static const Color spnDefColorTable2[] =
@@ -61,11 +61,11 @@ static const Color spnDefColorTable5[] =
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 16 */ EXC_PALETTE_EGA_COLORS_DARK,
-/* 24 */ 0x8080FF, 0x802060, 0xFFFFC0, 0xA0E0E0, 0x600080, 0xFF8080, 0x0080C0, 0xC0C0FF,
-/* 32 */ 0x000080, 0xFF00FF, 0xFFFF00, 0x00FFFF, 0x800080, 0x800000, 0x008080, 0x0000FF,
-/* 40 */ 0x00CFFF, 0x69FFFF, 0xE0FFE0, 0xFFFF80, 0xA6CAF0, 0xDD9CB3, 0xB38FEE, 0xE3E3E3,
-/* 48 */ 0x2A6FF9, 0x3FB8CD, 0x488436, 0x958C41, 0x8E5E42, 0xA0627A, 0x624FAC, 0x969696,
-/* 56 */ 0x1D2FBE, 0x286676, 0x004500, 0x453E01, 0x6A2813, 0x85396A, 0x4A3285, 0x424242
+/* 24 */ Color(0x8080FF), Color(0x802060), Color(0xFFFFC0), Color(0xA0E0E0), Color(0x600080), Color(0xFF8080), Color(0x0080C0), Color(0xC0C0FF),
+/* 32 */ Color(0x000080), Color(0xFF00FF), Color(0xFFFF00), Color(0x00FFFF), Color(0x800080), Color(0x800000), Color(0x008080), Color(0x0000FF),
+/* 40 */ Color(0x00CFFF), Color(0x69FFFF), Color(0xE0FFE0), Color(0xFFFF80), Color(0xA6CAF0), Color(0xDD9CB3), Color(0xB38FEE), Color(0xE3E3E3),
+/* 48 */ Color(0x2A6FF9), Color(0x3FB8CD), Color(0x488436), Color(0x958C41), Color(0x8E5E42), Color(0xA0627A), Color(0x624FAC), Color(0x969696),
+/* 56 */ Color(0x1D2FBE), Color(0x286676), Color(0x004500), Color(0x453E01), Color(0x6A2813), Color(0x85396A), Color(0x4A3285), Color(0x424242)
};
/** Default color table for BIFF8. */
@@ -74,11 +74,11 @@ static const Color spnDefColorTable8[] =
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 16 */ EXC_PALETTE_EGA_COLORS_DARK,
-/* 24 */ 0x9999FF, 0x993366, 0xFFFFCC, 0xCCFFFF, 0x660066, 0xFF8080, 0x0066CC, 0xCCCCFF,
-/* 32 */ 0x000080, 0xFF00FF, 0xFFFF00, 0x00FFFF, 0x800080, 0x800000, 0x008080, 0x0000FF,
-/* 40 */ 0x00CCFF, 0xCCFFFF, 0xCCFFCC, 0xFFFF99, 0x99CCFF, 0xFF99CC, 0xCC99FF, 0xFFCC99,
-/* 48 */ 0x3366FF, 0x33CCCC, 0x99CC00, 0xFFCC00, 0xFF9900, 0xFF6600, 0x666699, 0x969696,
-/* 56 */ 0x003366, 0x339966, 0x003300, 0x333300, 0x993300, 0x993366, 0x333399, 0x333333
+/* 24 */ Color(0x9999FF), Color(0x993366), Color(0xFFFFCC), Color(0xCCFFFF), Color(0x660066), Color(0xFF8080), Color(0x0066CC), Color(0xCCCCFF),
+/* 32 */ Color(0x000080), Color(0xFF00FF), Color(0xFFFF00), Color(0x00FFFF), Color(0x800080), Color(0x800000), Color(0x008080), Color(0x0000FF),
+/* 40 */ Color(0x00CCFF), Color(0xCCFFFF), Color(0xCCFFCC), Color(0xFFFF99), Color(0x99CCFF), Color(0xFF99CC), Color(0xCC99FF), Color(0xFFCC99),
+/* 48 */ Color(0x3366FF), Color(0x33CCCC), Color(0x99CC00), Color(0xFFCC00), Color(0xFF9900), Color(0xFF6600), Color(0x666699), Color(0x969696),
+/* 56 */ Color(0x003366), Color(0x339966), Color(0x003300), Color(0x333300), Color(0x993300), Color(0x993366), Color(0x333399), Color(0x333333)
};
#undef EXC_PALETTE_EGA_COLORS_LIGHT
@@ -89,9 +89,9 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) :
mnTableSize( 0 )
{
const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
- mnWindowText = rSett.GetWindowTextColor().GetColor();
- mnWindowBack = rSett.GetWindowColor().GetColor();
- mnFaceColor = rSett.GetFaceColor().GetColor();
+ mnWindowText = rSett.GetWindowTextColor();
+ mnWindowBack = rSett.GetWindowColor();
+ mnFaceColor = rSett.GetFaceColor();
// Don't use the system HelpBack and HelpText colours as it causes problems
// with modern gnome. This is because mnNoteText and mnNoteBack are used
// when colour indices ( instead of real colours ) are specified.
@@ -106,8 +106,8 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) :
// ) lessens the chance of the one colour being an unsuitable combination
// because by default the note text is black and the note background is
// a light yellow colour ( very similar to Excel's normal defaults )
- mnNoteText = svtools::ColorConfig::GetDefaultColor( svtools::FONTCOLOR ).GetColor();
- mnNoteBack = svtools::ColorConfig::GetDefaultColor( svtools::CALCNOTESBACKGROUND ).GetColor();
+ mnNoteText = svtools::ColorConfig::GetDefaultColor( svtools::FONTCOLOR );
+ mnNoteBack = svtools::ColorConfig::GetDefaultColor( svtools::CALCNOTESBACKGROUND );
// default colors
switch( rRoot.GetBiff() )
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 18a76fa07942..04558e994015 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -993,7 +993,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
bool bItalic = ( ITALIC_NONE != rPostureItem.GetPosture() );
bool bUnderline = ( LINESTYLE_NONE != rUnderlineItem.GetLineStyle() );
bool bCrossedOut = ( STRIKEOUT_SINGLE <= rCrossedOutItem.GetStrikeout() );
- bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue().GetColor() ); // default is AUTO now
+ bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue() ); // default is AUTO now
bool bSetFontName = ( aHTMLStyle.aFontFamilyName != rFontItem.GetFamilyName() );
sal_uInt16 nSetFontSizeNumber = 0;
sal_uInt32 nFontHeight = rFontHeightItem.GetHeight();
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx
index 04e8dc682d31..f187ac979733 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -89,7 +89,7 @@ public:
/** Sets the color to automatic. */
void setAuto();
/** Sets the color to the passed RGB value. */
- void setRgb( sal_Int32 nRgbValue, double fTint = 0.0 );
+ void setRgb( ::Color nRgbValue, double fTint = 0.0 );
/** Sets the color to the passed theme index. */
void setTheme( sal_Int32 nThemeIdx, double fTint = 0.0 );
/** Sets the color to the passed palette index. */
@@ -122,14 +122,14 @@ public:
void importPaletteColor( SequenceInputStream& rStrm );
/** Returns the RGB value of the color with the passed index. */
- sal_Int32 getColor( sal_Int32 nPaletteIdx ) const;
+ ::Color getColor( sal_Int32 nPaletteIdx ) const;
private:
/** Appends the passed color. */
- void appendColor( sal_Int32 nRGBValue );
+ void appendColor( ::Color nRGBValue );
private:
- ::std::vector< sal_Int32 > maColors; /// List of RGB values.
+ ::std::vector< ::Color > maColors; /// List of RGB values.
size_t mnAppendIndex; /// Index to append a new color.
};
@@ -503,7 +503,7 @@ struct GradientFillModel
/** Contains API fill attributes. */
struct ApiSolidFillData
{
- sal_Int32 mnColor; /// Fill color.
+ ::Color mnColor; /// Fill color.
bool mbTransparent; /// True = transparent area.
bool mbUsed; /// True = fill data is valid.
@@ -821,7 +821,7 @@ public:
void finalizeImport();
/** Returns the palette color with the specified index. */
- sal_Int32 getPaletteColor( sal_Int32 nIndex ) const;
+ ::Color getPaletteColor( sal_Int32 nIndex ) const;
/** Returns the specified font object. */
FontRef getFont( sal_Int32 nFontId ) const;
/** Returns the specified border object. */
diff --git a/sc/source/filter/inc/themebuffer.hxx b/sc/source/filter/inc/themebuffer.hxx
index 103fefa8e695..c54b08bad563 100644
--- a/sc/source/filter/inc/themebuffer.hxx
+++ b/sc/source/filter/inc/themebuffer.hxx
@@ -36,9 +36,9 @@ public:
virtual ~ThemeBuffer() override;
/** Returns the theme color with the specified token identifier. */
- sal_Int32 getColorByToken( sal_Int32 nToken ) const;
+ ::Color getColorByToken( sal_Int32 nToken ) const;
- sal_Int32 getColorByIndex(size_t nIndex) const;
+ ::Color getColorByIndex(size_t nIndex) const;
/** Returns the default font data for the current file type. */
const FontModel& getDefaultFontModel() const { return *mxDefFontModel; }
diff --git a/sc/source/filter/inc/viewsettings.hxx b/sc/source/filter/inc/viewsettings.hxx
index 2537fa857625..33e4163376ae 100644
--- a/sc/source/filter/inc/viewsettings.hxx
+++ b/sc/source/filter/inc/viewsettings.hxx
@@ -75,7 +75,7 @@ struct SheetViewModel
/** Returns the zoom in pagebreak preview (returns default, if current value is 0). */
sal_Int32 getPageBreakZoom() const;
/** Returns the grid color as RGB value. */
- sal_Int32 getGridColor( const ::oox::core::FilterBase& rFilter ) const;
+ ::Color getGridColor( const ::oox::core::FilterBase& rFilter ) const;
/** Returns the selection data of the active pane. */
const PaneSelectionModel* getActiveSelection() const;
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 6b7a79761b7a..175b4a43798e 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -169,22 +169,11 @@ void ColorScaleRule::importCfvo( const AttributeList& rAttribs )
namespace {
-::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(/*ornA*/ 0, ornR, ornG, ornB);
-}
-
::Color importOOXColor(const AttributeList& rAttribs, const ThemeBuffer& rThemeBuffer, const GraphicHelper& rGraphicHelper)
{
- sal_uInt32 nColor = 0;
+ ::Color nColor;
if( rAttribs.hasAttribute( XML_rgb ) )
- nColor = rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT );
+ nColor = ::Color(rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT ));
else if( rAttribs.hasAttribute( XML_theme ) )
{
sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 );
@@ -212,7 +201,7 @@ namespace {
aColor = aDMColor.getColor(rGraphicHelper);
}
else
- aColor = ARgbToARgbComponents( nColor );
+ aColor = nColor.GetRGBColor();
return aColor;
}
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index 7dee9ab6d944..d822d9734a91 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -850,7 +850,7 @@ void HeaderFooterParser::convertFontColor( const OUString& rColor )
static_cast< double >( rColor.copy( 2 ).toInt32() ) / 100.0 );
else
// RGB color: RRGGBB
- maFontModel.maColor.setRgb( rColor.toUInt32( 16 ) );
+ maFontModel.maColor.setRgb( ::Color(rColor.toUInt32( 16 )) );
}
void HeaderFooterParser::finalizePortion()
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index f2efe4380297..910594768171 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -199,7 +199,7 @@ const sal_uInt8 BIFF_FONTUNDERL_DOUBLE = 2;
const sal_uInt8 BIFF_FONTUNDERL_SINGLE_ACC = 33;
const sal_uInt8 BIFF_FONTUNDERL_DOUBLE_ACC = 34;
-sal_Int32 lclReadRgbColor( BinaryInputStream& rStrm )
+::Color lclReadRgbColor( BinaryInputStream& rStrm )
{
sal_uInt8 nR, nG, nB, nA;
nR = rStrm.readuChar();
@@ -213,7 +213,7 @@ sal_Int32 lclReadRgbColor( BinaryInputStream& rStrm )
nValue |= nG;
nValue <<= 8;
nValue |= nB;
- return nValue;
+ return ::Color(nValue);
}
} // namespace
@@ -240,10 +240,10 @@ void Color::setAuto()
setSchemeClr( XML_phClr );
}
-void Color::setRgb( sal_Int32 nRgbValue, double fTint )
+void Color::setRgb( ::Color nRgbValue, double fTint )
{
clearTransformations();
- setSrgbClr( nRgbValue & 0xFFFFFF );
+ setSrgbClr( sal_uInt32(nRgbValue) & 0xFFFFFF );
if( fTint != 0.0 ) addExcelTintTransformation( fTint );
}
@@ -337,22 +337,22 @@ namespace {
/** Standard EGA colors, bright. */
#define PALETTE_EGA_COLORS_LIGHT \
- 0x000000, 0xFFFFFF, 0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF
-/** Standard EGA colors, dark. */
+ ::Color(0x000000), ::Color(0xFFFFFF), ::Color(0xFF0000), ::Color(0x00FF00), ::Color(0x0000FF), ::Color(0xFFFF00), ::Color(0xFF00FF), ::Color(0x00FFFF)
+/** Standard EGA colors), dark. */
#define PALETTE_EGA_COLORS_DARK \
- 0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080
+ ::Color(0x800000), ::Color(0x008000), ::Color(0x000080), ::Color(0x808000), ::Color(0x800080), ::Color(0x008080), ::Color(0xC0C0C0), ::Color(0x808080)
/** Default color table for BIFF8/BIFF12/OOXML. */
-static const sal_Int32 spnDefColors8[] =
+static const ::Color spnDefColors8[] =
{
/* 0 */ PALETTE_EGA_COLORS_LIGHT,
/* 8 */ PALETTE_EGA_COLORS_LIGHT,
/* 16 */ PALETTE_EGA_COLORS_DARK,
-/* 24 */ 0x9999FF, 0x993366, 0xFFFFCC, 0xCCFFFF, 0x660066, 0xFF8080, 0x0066CC, 0xCCCCFF,
-/* 32 */ 0x000080, 0xFF00FF, 0xFFFF00, 0x00FFFF, 0x800080, 0x800000, 0x008080, 0x0000FF,
-/* 40 */ 0x00CCFF, 0xCCFFFF, 0xCCFFCC, 0xFFFF99, 0x99CCFF, 0xFF99CC, 0xCC99FF, 0xFFCC99,
-/* 48 */ 0x3366FF, 0x33CCCC, 0x99CC00, 0xFFCC00, 0xFF9900, 0xFF6600, 0x666699, 0x969696,
-/* 56 */ 0x003366, 0x339966, 0x003300, 0x333300, 0x993300, 0x993366, 0x333399, 0x333333
+/* 24 */ ::Color(0x9999FF), ::Color(0x993366), ::Color(0xFFFFCC), ::Color(0xCCFFFF), ::Color(0x660066), ::Color(0xFF8080), ::Color(0x0066CC), ::Color(0xCCCCFF),
+/* 32 */ ::Color(0x000080), ::Color(0xFF00FF), ::Color(0xFFFF00), ::Color(0x00FFFF), ::Color(0x800080), ::Color(0x800000), ::Color(0x008080), ::Color(0x0000FF),
+/* 40 */ ::Color(0x00CCFF), ::Color(0xCCFFFF), ::Color(0xCCFFCC), ::Color(0xFFFF99), ::Color(0x99CCFF), ::Color(0xFF99CC), ::Color(0xCC99FF), ::Color(0xFFCC99),
+/* 48 */ ::Color(0x3366FF), ::Color(0x33CCCC), ::Color(0x99CC00), ::Color(0xFFCC00), ::Color(0xFF9900), ::Color(0xFF6600), ::Color(0x666699), ::Color(0x969696),
+/* 56 */ ::Color(0x003366), ::Color(0x339966), ::Color(0x003300), ::Color(0x333300), ::Color(0x993300), ::Color(0x993366), ::Color(0x333399), ::Color(0x333333)
};
#undef PALETTE_EGA_COLORS_LIGHT
@@ -376,14 +376,14 @@ void ColorPalette::importPaletteColor( const AttributeList& rAttribs )
void ColorPalette::importPaletteColor( SequenceInputStream& rStrm )
{
- sal_Int32 nRgb = lclReadRgbColor( rStrm );
- appendColor( nRgb & 0xFFFFFF );
+ ::Color nRgb = lclReadRgbColor( rStrm );
+ appendColor( nRgb );
}
-sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const
+::Color ColorPalette::getColor( sal_Int32 nPaletteIdx ) const
{
::Color nColor = API_RGB_TRANSPARENT;
- if( const sal_Int32* pnPaletteColor = ContainerHelper::getVectorElement( maColors, nPaletteIdx ) )
+ if( const ::Color* pnPaletteColor = ContainerHelper::getVectorElement( maColors, nPaletteIdx ) )
{
nColor = *pnPaletteColor;
}
@@ -402,10 +402,10 @@ sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const
case OOX_COLOR_FONTAUTO: nColor = API_RGB_TRANSPARENT; break;
default: OSL_FAIL( "ColorPalette::getColor - unknown color index" );
}
- return sal_Int32(nColor);
+ return nColor;
}
-void ColorPalette::appendColor( sal_Int32 nRGBValue )
+void ColorPalette::appendColor( ::Color nRGBValue )
{
if( mnAppendIndex < maColors.size() )
maColors[ mnAppendIndex ] = nRGBValue;
@@ -922,7 +922,7 @@ void Font::fillToItemSet( SfxItemSet& rItemSet, bool bEditEngineText, bool bSkip
// character color
if( maUsedFlags.mbColorUsed )
{
- ScfTools::PutItem( rItemSet,SvxColorItem( maApiData.mnColor, bEditEngineText ? static_cast<sal_uInt16>(EE_CHAR_COLOR) : ATTR_FONT_COLOR ) , bSkipPoolDefs );
+ ScfTools::PutItem( rItemSet,SvxColorItem( maApiData.mnColor, bEditEngineText ? static_cast<sal_uInt16>(EE_CHAR_COLOR) : ATTR_FONT_COLOR), bSkipPoolDefs );
}
// underline style
if( maUsedFlags.mbUnderlineUsed )
@@ -1820,7 +1820,7 @@ void Fill::finalizeImport()
maApiData.mbUsed = rModel.mbPatternUsed;
if( rModel.mnPattern == XML_none )
{
- maApiData.mnColor = sal_Int32(API_RGB_TRANSPARENT);
+ maApiData.mnColor = API_RGB_TRANSPARENT;
maApiData.mbTransparent = true;
}
else
@@ -1859,7 +1859,7 @@ void Fill::finalizeImport()
rModel.maFillColor.setAuto();
::Color nFillColor = rModel.maFillColor.getColor( rGraphicHelper, nWinColor );
- maApiData.mnColor = sal_Int32(lclGetMixedColor( nPattColor, nFillColor, nAlpha ));
+ maApiData.mnColor = lclGetMixedColor( nPattColor, nFillColor, nAlpha );
maApiData.mbTransparent = false;
}
}
@@ -1869,12 +1869,12 @@ void Fill::finalizeImport()
maApiData.mbUsed = true; // no support for differential attributes
GradientFillModel::ColorMap::const_iterator aIt = rModel.maColors.begin();
OSL_ENSURE( !aIt->second.isAuto(), "Fill::finalizeImport - automatic gradient color" );
- maApiData.mnColor = sal_Int32(aIt->second.getColor( rGraphicHelper, API_RGB_WHITE ));
+ maApiData.mnColor = aIt->second.getColor( rGraphicHelper, API_RGB_WHITE );
if( ++aIt != rModel.maColors.end() )
{
OSL_ENSURE( !aIt->second.isAuto(), "Fill::finalizeImport - automatic gradient color" );
::Color nEndColor = aIt->second.getColor( rGraphicHelper, API_RGB_WHITE );
- maApiData.mnColor = sal_Int32(lclGetMixedColor( maApiData.mnColor, nEndColor, 0x40 ));
+ maApiData.mnColor = lclGetMixedColor( maApiData.mnColor, nEndColor, 0x40 );
maApiData.mbTransparent = false;
}
}
@@ -1887,7 +1887,7 @@ void Fill::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
SvxBrushItem aBrushItem( ATTR_BACKGROUND );
if ( maApiData.mbTransparent )
{
- aBrushItem.SetColor( ::COL_TRANSPARENT );
+ aBrushItem.SetColor( COL_TRANSPARENT );
}
else
{
@@ -2787,7 +2787,7 @@ void StylesBuffer::finalizeImport()
maDxfs.forEachMem( &Dxf::finalizeImport );
}
-sal_Int32 StylesBuffer::getPaletteColor( sal_Int32 nPaletteIdx ) const
+::Color StylesBuffer::getPaletteColor( sal_Int32 nPaletteIdx ) const
{
return maPalette.getColor( nPaletteIdx );
}
diff --git a/sc/source/filter/oox/themebuffer.cxx b/sc/source/filter/oox/themebuffer.cxx
index b72f9029c547..1f7d97ab80fa 100644
--- a/sc/source/filter/oox/themebuffer.cxx
+++ b/sc/source/filter/oox/themebuffer.cxx
@@ -38,16 +38,16 @@ ThemeBuffer::~ThemeBuffer()
{
}
-sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const
+::Color ThemeBuffer::getColorByToken( sal_Int32 nToken ) const
{
::Color nColor = 0;
- return sal_Int32(getClrScheme().getColor( nToken, nColor ) ? nColor : API_RGB_TRANSPARENT);
+ return getClrScheme().getColor( nToken, nColor ) ? nColor : API_RGB_TRANSPARENT;
}
-sal_Int32 ThemeBuffer::getColorByIndex(size_t nIndex) const
+::Color ThemeBuffer::getColorByIndex(size_t nIndex) const
{
::Color nColor = 0;
- return sal_Int32(getClrScheme().getColorByIndex(nIndex, nColor) ? nColor : API_RGB_TRANSPARENT);
+ return getClrScheme().getColorByIndex(nIndex, nColor) ? nColor : API_RGB_TRANSPARENT;
}
} // namespace xls
diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx
index 4f5f0f54554c..92a3cfb20166 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -153,9 +153,9 @@ sal_Int32 SheetViewModel::getPageBreakZoom() const
return getLimitedValue< sal_Int32 >( nZoom, API_ZOOMVALUE_MIN, API_ZOOMVALUE_MAX );
}
-sal_Int32 SheetViewModel::getGridColor( const FilterBase& rFilter ) const
+::Color SheetViewModel::getGridColor( const FilterBase& rFilter ) const
{
- return sal_Int32(mbDefGridColor ? API_RGB_TRANSPARENT : maGridColor.getColor( rFilter.getGraphicHelper() ));
+ return mbDefGridColor ? API_RGB_TRANSPARENT : maGridColor.getColor( rFilter.getGraphicHelper() );
}
const PaneSelectionModel* SheetViewModel::getActiveSelection() const
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 9f1ea2f6d05d..7d5c910ff39d 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -531,7 +531,7 @@ static void lcl_FillProps( EscherPropertyContainer& rPropOpt, SdrObject* pCaptio
// be incorrect where user has chosen to use this colour explicitly.
Color aColor( static_cast<sal_uInt8>(nValue), static_cast<sal_uInt8>( nValue >> 8 ), static_cast<sal_uInt8>( nValue >> 16 ) );
const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
- if( aColor == rSett.GetHelpColor().GetColor() )
+ if( aColor == rSett.GetHelpColor() )
{
rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx
index e625333631cb..5a934b0cb222 100644
--- a/sc/source/filter/xml/xmlsceni.cxx
+++ b/sc/source/filter/xml/xmlsceni.cxx
@@ -59,11 +59,7 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
bDisplayBorder = IsXMLToken(aIter, XML_TRUE);
break;
case XML_ELEMENT( TABLE, XML_BORDER_COLOR ):
- {
- sal_Int32 nColor(0);
- ::sax::Converter::convertColor(nColor, aIter.toString());
- aBorderColor = nColor;
- }
+ ::sax::Converter::convertColor(aBorderColor, aIter.toString());
break;
case XML_ELEMENT( TABLE, XML_COPY_BACK ):
bCopyBack = IsXMLToken(aIter, XML_TRUE);
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 0ab07a04f1e9..b8ca55e48091 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -476,10 +476,10 @@ OUString ScAccessibleCellBase::getBorderAttrs()
bool bIn = mpDoc && mpDoc->IsCellInChangeTrack(maCellAddress,&aColor);
if (bIn)
{
- aTopBorder.Color = aColor.GetColor();
- aBottomBorder.Color = aColor.GetColor();
- aLeftBorder.Color = aColor.GetColor();
- aRightBorder.Color = aColor.GetColor();
+ aTopBorder.Color = sal_Int32(aColor);
+ aBottomBorder.Color = sal_Int32(aColor);
+ aLeftBorder.Color = sal_Int32(aColor);
+ aRightBorder.Color = sal_Int32(aColor);
aTopBorder.OuterLineWidth = DEFAULT_LINE_WIDTH;
aBottomBorder.OuterLineWidth = DEFAULT_LINE_WIDTH;
aLeftBorder.OuterLineWidth = DEFAULT_LINE_WIDTH;
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index 442e5d9d4d9b..85985c4b722c 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -344,14 +344,14 @@ sal_Int32 SAL_CALL ScAccessibleCsvRuler::getForeground( )
{
SolarMutexGuard aGuard;
ensureAlive();
- return implGetRuler().GetSettings().GetStyleSettings().GetLabelTextColor().GetColor();
+ return sal_Int32(implGetRuler().GetSettings().GetStyleSettings().GetLabelTextColor());
}
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getBackground( )
{
SolarMutexGuard aGuard;
ensureAlive();
- return implGetRuler().GetSettings().GetStyleSettings().GetFaceColor().GetColor();
+ return sal_Int32(implGetRuler().GetSettings().GetStyleSettings().GetFaceColor());
}
// XAccessibleContext ---------------------------------------------------------
@@ -878,7 +878,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getForeground( )
{
SolarMutexGuard aGuard;
ensureAlive();
- return implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
+ return sal_Int32(implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor());
}
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getBackground( )
@@ -1395,7 +1395,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvCell::getForeground( )
{
SolarMutexGuard aGuard;
ensureAlive();
- return implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
+ return sal_Int32(implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor());
}
sal_Int32 SAL_CALL ScAccessibleCsvCell::getBackground( )
diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx
index bf4d9a719f3d..93ee2d254f0f 100644
--- a/sc/source/ui/app/rfindlst.cxx
+++ b/sc/source/ui/app/rfindlst.cxx
@@ -58,8 +58,8 @@ Color ScRangeFindList::FindColor( const ScRange& rRef, const size_t nIndex )
{
sal_Int32 nOldCntr = 0;
sal_Int32 nNewCntr = 0;
- Color nOldColor = 0;
- Color nNewColor = 0;
+ Color nOldColor = Color(0);
+ Color nNewColor = Color(0);
DBG_ASSERT( (nIndex < maEntries.size()), "nIndex out of range!" );
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index acca81ea9266..c8e12e6fbeec 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -112,7 +112,7 @@ void ScDDComboBoxButton::ImpDrawArrow( const tools::Rectangle& rRect )
tools::Rectangle aTempRect = aPixRect;
const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
- Color aColor( rSett.GetButtonTextColor().GetColor() );
+ Color aColor( rSett.GetButtonTextColor() );
pOut->SetFillColor( aColor );
pOut->SetLineColor( aColor );
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index 586f15761276..ba781c86e01c 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -76,16 +76,16 @@ bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
{
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
- sal_uLong nNew = m_pContentColorLB->GetSelectEntryColor().GetColor();
+ Color nNew = m_pContentColorLB->GetSelectEntryColor();
aAppOptions.SetTrackContentColor(nNew);
- nNew = m_pMoveColorLB->GetSelectEntryColor().GetColor();
+ nNew = m_pMoveColorLB->GetSelectEntryColor();
aAppOptions.SetTrackMoveColor(nNew);
- nNew = m_pInsertColorLB->GetSelectEntryColor().GetColor();
+ nNew = m_pInsertColorLB->GetSelectEntryColor();
aAppOptions.SetTrackInsertColor(nNew);
- nNew = m_pRemoveColorLB->GetSelectEntryColor().GetColor();
+ nNew = m_pRemoveColorLB->GetSelectEntryColor();
aAppOptions.SetTrackDeleteColor(nNew);
SC_MOD()->SetAppOptions(aAppOptions);
@@ -103,17 +103,17 @@ void ScRedlineOptionsTabPage::Reset( const SfxItemSet* /* rSet */ )
{
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
- sal_uLong nColor = aAppOptions.GetTrackContentColor();
- m_pContentColorLB->SelectEntry(Color(nColor));
+ Color nColor = aAppOptions.GetTrackContentColor();
+ m_pContentColorLB->SelectEntry(nColor);
nColor = aAppOptions.GetTrackMoveColor();
- m_pMoveColorLB->SelectEntry(Color(nColor));
+ m_pMoveColorLB->SelectEntry(nColor);
nColor = aAppOptions.GetTrackInsertColor();
- m_pInsertColorLB->SelectEntry(Color(nColor));
+ m_pInsertColorLB->SelectEntry(nColor);
nColor = aAppOptions.GetTrackDeleteColor();
- m_pRemoveColorLB->SelectEntry(Color(nColor));
+ m_pRemoveColorLB->SelectEntry(nColor);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/sidebar/CellBorderUpdater.cxx b/sc/source/ui/sidebar/CellBorderUpdater.cxx
index cc7edb54d63a..3f06f92eb7b8 100644
--- a/sc/source/ui/sidebar/CellBorderUpdater.cxx
+++ b/sc/source/ui/sidebar/CellBorderUpdater.cxx
@@ -45,7 +45,7 @@ void CellBorderUpdater::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool
ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create());
pVirDev->SetOutputSizePixel(aBmpSize);
pVirDev->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ;
- pVirDev->SetFillColor( COL_BLACK);
+ pVirDev->SetFillColor(COL_BLACK);
Point aTL(2, 1), aTR(42,1), aBL(2, 41), aBR(42, 41), aHL(2,21), aHR(42, 21), aVT(22,1), aVB(22, 41);
if(bLeft)
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index dad666ff6b02..12c9d94241ad 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -8366,7 +8366,7 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
ScScenarioFlags nFlags;
rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
- rAny <<= static_cast<sal_Int32>(aColor.GetColor());
+ rAny <<= aColor;
}
}
else if ( pEntry->nWID == SC_WID_UNO_PROTECT )
@@ -8443,7 +8443,7 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_TABCOLOR )
{
- rAny <<= sal_Int32(rDoc.GetTabBgColor(nTab).GetColor());
+ rAny <<= rDoc.GetTabBgColor(nTab);
}
else if ( pEntry->nWID == SC_WID_UNO_CODENAME )
{
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index b3078655ffc6..50fb8a76e326 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -882,7 +882,7 @@ void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XColorS
throw lang::IllegalArgumentException();
pEntry->SetType(eType);
- pEntry->SetColor(xEntry->getColor());
+ pEntry->SetColor(Color(xEntry->getColor()));
switch (eType)
{
case COLORSCALE_FORMULA:
@@ -1011,7 +1011,7 @@ ScColorScaleEntry* ScColorScaleEntryObj::getCoreObject()
util::Color ScColorScaleEntryObj::getColor()
{
Color aColor = getCoreObject()->GetColor();
- return aColor.GetColor();
+ return sal_Int32(aColor);
}
void ScColorScaleEntryObj::setColor(util::Color aColor)
@@ -1318,22 +1318,19 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert
break;
case DataBar_Color:
{
- sal_Int32 nColor = getCoreObject()->GetDataBarData()->maPositiveColor.GetColor();
- aAny <<= nColor;
+ aAny <<= getCoreObject()->GetDataBarData()->maPositiveColor;
}
break;
case AxisColor:
{
- sal_Int32 nAxisColor = getCoreObject()->GetDataBarData()->maAxisColor.GetColor();
- aAny <<= nAxisColor;
+ aAny <<= getCoreObject()->GetDataBarData()->maAxisColor;
}
break;
case NegativeColor:
{
if (getCoreObject()->GetDataBarData()->mbNeg && getCoreObject()->GetDataBarData()->mpNegativeColor)
{
- sal_Int32 nNegativeColor = getCoreObject()->GetDataBarData()->mpNegativeColor->GetColor();
- aAny <<= nNegativeColor;
+ aAny <<= *getCoreObject()->GetDataBarData()->mpNegativeColor;
}
}
break;
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 01528c65697c..fefdcc3773b7 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -422,7 +422,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
{
OUString aColorName;
Color aColor = aViewOpt.GetGridColor(&aColorName);
- aRet <<= static_cast<sal_Int64>(aColor.GetColor());
+ aRet <<= aColor;
}
else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
aRet <<= aViewOpt.GetOption( VOPT_PAGEBREAKS );
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 094d1d4d4557..d2538279d043 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1828,7 +1828,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
}
else if ( aPropertyName == SC_UNO_GRIDCOLOR )
{
- sal_Int32 nIntVal = 0;
+ Color nIntVal;
if ( aValue >>= nIntVal )
aNewOpt.SetGridColor( nIntVal, OUString() );
}
@@ -1908,7 +1908,7 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName
else if ( aPropertyName == SC_UNO_SHOWOBJ ) aRet <<= static_cast<sal_Int16>( rOpt.GetObjMode( VOBJ_TYPE_OLE ) );
else if ( aPropertyName == SC_UNO_SHOWCHARTS ) aRet <<= static_cast<sal_Int16>( rOpt.GetObjMode( VOBJ_TYPE_CHART ) );
else if ( aPropertyName == SC_UNO_SHOWDRAW ) aRet <<= static_cast<sal_Int16>( rOpt.GetObjMode( VOBJ_TYPE_DRAW ) );
- else if ( aPropertyName == SC_UNO_GRIDCOLOR ) aRet <<= static_cast<sal_Int32>( rOpt.GetGridColor().GetColor() );
+ else if ( aPropertyName == SC_UNO_GRIDCOLOR ) aRet <<= rOpt.GetGridColor();
else if ( aPropertyName == SC_UNO_VISAREA ) aRet <<= GetVisArea();
else if ( aPropertyName == SC_UNO_ZOOMTYPE ) aRet <<= GetZoomType();
else if ( aPropertyName == SC_UNO_ZOOMVALUE ) aRet <<= GetZoom();
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 19688010aad9..b56ceff1c540 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -164,7 +164,7 @@ public:
{
table::BorderLine aBorderLine;
if ( getBorderLine( aBorderLine ) )
- return uno::makeAny( OORGBToXLRGB( aBorderLine.Color ) );
+ return uno::makeAny( OORGBToXLRGB( Color(aBorderLine.Color) ) );
throw uno::RuntimeException("No Implementation available" );
}
void SAL_CALL setColor( const uno::Any& _color ) override
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index c40224a04f04..783baa466705 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -41,7 +41,6 @@
#include "vbapalette.hxx"
#include <document.hxx>
-#define COLORMAST 0xFFFFFF
typedef std::map< sal_Int32, sal_Int32 > PatternMap;
typedef std::pair< sal_Int32, sal_Int32 > PatternPair;
using namespace ::com::sun::star;
@@ -82,7 +81,7 @@ static PatternMap aPatternMap( lcl_getPatternMap() );
ScVbaInterior::ScVbaInterior( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xProps, ScDocument* pScDoc ) : ScVbaInterior_BASE( xParent, xContext ), m_xProps(xProps), m_pScDoc( pScDoc )
{
// auto color
- m_aPattColor = sal_uInt32(0x0);
+ m_aPattColor = Color(0);
m_nPattern = 0;
if ( !m_xProps.is() )
throw lang::IllegalArgumentException("properties", uno::Reference< uno::XInterface >(), 2 );
@@ -120,18 +119,18 @@ ScVbaInterior::SetMixedColor()
if( aPatternColor.hasValue() )
{
sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
- m_aPattColor = nPatternColor;
+ m_aPattColor = Color(nPatternColor);
}
- sal_Int32 nPatternColor = m_aPattColor.GetColor();
+ Color nPatternColor = m_aPattColor;
// back color
Color aBackColor( GetBackColor() );
// set mixed color
Color aMixedColor;
if( nPattern > 0 )
- aMixedColor = GetPatternColor( Color(nPatternColor), aBackColor, static_cast<sal_uInt32>(nPattern) );
+ aMixedColor = GetPatternColor( nPatternColor, aBackColor, static_cast<sal_uInt32>(nPattern) );
else
aMixedColor = GetPatternColor( aBackColor, aBackColor, static_cast<sal_uInt32>(nPattern) );
- sal_Int32 nMixedColor = aMixedColor.GetColor() & COLORMAST;
+ Color nMixedColor = aMixedColor.GetRGBColor();
m_xProps->setPropertyValue( BACKCOLOR , uno::makeAny( nMixedColor ) );
}
@@ -319,7 +318,7 @@ ScVbaInterior::GetBackColor()
if( aColor.hasValue() )
{
nColor = GetAttributeData( aColor );
- aBackColor = nColor;
+ aBackColor = Color(nColor);
}
else
{
@@ -328,7 +327,7 @@ ScVbaInterior::GetBackColor()
if( aAny >>= nColor )
{
nColor = XLRGBToOORGB( nColor );
- aBackColor = nColor;
+ aBackColor = Color(nColor);
SetUserDefinedAttributes( BACKCOLOR, SetAttributeData( nColor ) );
}
}
@@ -342,7 +341,7 @@ ScVbaInterior::getPatternColor()
if( aPatternColor.hasValue() )
{
sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
- return uno::makeAny( OORGBToXLRGB( nPatternColor ) );
+ return uno::makeAny( OORGBToXLRGB( Color(nPatternColor) ) );
}
return uno::makeAny( sal_Int32( 0 ) );
}
@@ -374,7 +373,7 @@ ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex )
if( nColorIndex == 0 )
return;
- sal_Int32 nPattColor = 0;
+ Color nPattColor;
GetIndexColor( nColorIndex ) >>= nPattColor;
setPatternColor( uno::makeAny( OORGBToXLRGB( nPattColor ) ) );
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index 3bb8d9f28c6b..de7f0aaf3319 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -31,20 +31,20 @@ using namespace ::ooo::vba;
/** Standard EGA colors, bright. */
#define EXC_PALETTE_EGA_COLORS_LIGHT \
- 0x000000, 0xFFFFFF, 0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF
-/** Standard EGA colors, dark. */
+ Color(0x000000), Color(0xFFFFFF), Color(0xFF0000), Color(0x00FF00), Color(0x0000FF), Color(0xFFFF00), Color(0xFF00FF), Color(0x00FFFF)
+/** Standard EGA colors), dark. */
#define EXC_PALETTE_EGA_COLORS_DARK \
- 0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080
+ Color(0x800000), Color(0x008000), Color(0x000080), Color(0x808000), Color(0x800080), Color(0x008080), Color(0xC0C0C0), Color(0x808080)
static const Color spnDefColorTable8[] =
{
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 16 */ EXC_PALETTE_EGA_COLORS_DARK,
-/* 24 */ 0x9999FF, 0x993366, 0xFFFFCC, 0xCCFFFF, 0x660066, 0xFF8080, 0x0066CC, 0xCCCCFF,
-/* 32 */ 0x000080, 0xFF00FF, 0xFFFF00, 0x00FFFF, 0x800080, 0x800000, 0x008080, 0x0000FF,
-/* 40 */ 0x00CCFF, 0xCCFFFF, 0xCCFFCC, 0xFFFF99, 0x99CCFF, 0xFF99CC, 0xCC99FF, 0xFFCC99,
-/* 48 */ 0x3366FF, 0x33CCCC, 0x99CC00, 0xFFCC00, 0xFF9900, 0xFF6600, 0x666699, 0x969696,
-/* 56 */ 0x003366, 0x339966, 0x003300, 0x333300, 0x993300, 0x993366, 0x333399, 0x333333
+/* 24 */ Color(0x9999FF), Color(0x993366), Color(0xFFFFCC), Color(0xCCFFFF), Color(0x660066), Color(0xFF8080), Color(0x0066CC), Color(0xCCCCFF),
+/* 32 */ Color(0x000080), Color(0xFF00FF), Color(0xFFFF00), Color(0x00FFFF), Color(0x800080), Color(0x800000), Color(0x008080), Color(0x0000FF),
+/* 40 */ Color(0x00CCFF), Color(0xCCFFFF), Color(0xCCFFCC), Color(0xFFFF99), Color(0x99CCFF), Color(0xFF99CC), Color(0xCC99FF), Color(0xFFCC99),
+/* 48 */ Color(0x3366FF), Color(0x33CCCC), Color(0x99CC00), Color(0xFFCC00), Color(0xFF9900), Color(0xFF6600), Color(0x666699), Color(0x969696),
+/* 56 */ Color(0x003366), Color(0x339966), Color(0x003300), Color(0x333300), Color(0x993300), Color(0x993366), Color(0x333399), Color(0x333333)
};
typedef ::cppu::WeakImplHelper< container::XIndexAccess > XIndexAccess_BASE;
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index f8f5cb10250d..6c735a9a4362 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2071,7 +2071,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
case SID_FRAME_LINECOLOR:
{
// handled together because both need the cell border information for decisions
- Color aCol = 0;
+ Color aCol;
editeng::SvxBorderLine aLine(nullptr,0,SvxBorderLineStyle::SOLID);
bool bCol = false;
bool bColDisable = false, bStyleDisable = false;
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 52c6f456d97b..1b7bdb769d87 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -3325,7 +3325,7 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe
pSettings[SC_GRIDCOLOR].Name = SC_UNO_GRIDCOLOR;
OUString aColorName;
Color aColor = pOptions->GetGridColor(&aColorName);
- pSettings[SC_GRIDCOLOR].Value <<= static_cast<sal_Int64>(aColor.GetColor());
+ pSettings[SC_GRIDCOLOR].Value <<= aColor;
pSettings[SC_SHOWPAGEBR].Name = SC_UNO_SHOWPAGEBR;
pSettings[SC_SHOWPAGEBR].Value <<= pOptions->GetOption( VOPT_PAGEBREAKS );
pSettings[SC_COLROWHDR].Name = SC_UNO_COLROWHDR;
@@ -3454,10 +3454,9 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
pOptions->SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) );
else if ( sName == SC_UNO_GRIDCOLOR )
{
- sal_Int64 nColor = 0;
- if (rSettings[i].Value >>= nColor)
+ Color aColor;
+ if (rSettings[i].Value >>= aColor)
{
- Color aColor(static_cast<sal_uInt32>(nColor));
// #i47435# set automatic grid color explicitly
if( aColor == COL_AUTO )
aColor = SC_STD_GRIDCOLOR;
More information about the Libreoffice-commits
mailing list