[Libreoffice-commits] core.git: include/tools sc/inc sc/qa sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu Feb 22 06:22:39 UTC 2018
include/tools/color.hxx | 2 +-
sc/inc/chgtrack.hxx | 4 ++--
sc/inc/detfunc.hxx | 12 ++++++------
sc/qa/unit/subsequent_export-test.cxx | 2 +-
sc/source/core/tool/detfunc.cxx | 26 +++++++++++++-------------
sc/source/filter/excel/xestyle.cxx | 8 ++++----
sc/source/filter/excel/xiescher.cxx | 2 +-
sc/source/filter/excel/xistyle.cxx | 20 ++++++++++----------
sc/source/filter/excel/xlchart.cxx | 10 +++++-----
sc/source/filter/excel/xlstyle.cxx | 14 +++++++-------
sc/source/filter/ftools/fapihelper.cxx | 4 ++--
sc/source/filter/inc/fapihelper.hxx | 11 ++---------
sc/source/filter/inc/xistyle.hxx | 11 +++--------
sc/source/filter/inc/xlstyle.hxx | 17 +++++++----------
sc/source/ui/app/inputhdl.cxx | 10 +++++-----
sc/source/ui/app/rfindlst.cxx | 24 ++++++++++++------------
sc/source/ui/app/scmod.cxx | 6 +++---
sc/source/ui/inc/rfindlst.hxx | 10 +++++-----
sc/source/ui/miscdlgs/anyrefdg.cxx | 4 ++--
sc/source/ui/unoobj/cellsuno.cxx | 5 ++---
sc/source/ui/vba/vbapalette.cxx | 2 +-
sc/source/ui/view/gridwin4.cxx | 2 +-
sc/source/ui/view/output.cxx | 4 ++--
sc/source/ui/view/viewdata.cxx | 8 ++++----
24 files changed, 101 insertions(+), 117 deletions(-)
New commits:
commit 8e7226233940a201c76c6a43e0648603d17961f4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Feb 21 09:34:19 2018 +0200
ColorData->Color in sc
and fix the sal_Int32() conversion operator in Color, which was
always returning 0
Change-Id: I0aefaedc34ee0a8bccd43238ccfe8196d2dd5c5c
Reviewed-on: https://gerrit.libreoffice.org/50051
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index cb88d61a6c70..823c90909310 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -62,7 +62,7 @@ public:
constexpr explicit operator sal_Int32() const
{
- return sal_Int32(sal_uInt32());
+ return sal_Int32(mnColor);
}
bool operator<(const Color& b) const
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index fa0da691da9e..fd465155e1ce 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -49,12 +49,12 @@ private:
const std::set<OUString>& rUsers;
OUString aLastUserName;
sal_uInt16 nLastUserIndex;
- ColorData nColor;
+ Color nColor;
public:
ScActionColorChanger( const ScChangeTrack& rTrack );
void Update( const ScChangeAction& rAction );
- ColorData GetColor() const { return nColor; }
+ Color GetColor() const { return nColor; }
};
enum ScChangeActionType
diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx
index 8ae90c217cf0..41a47effbb95 100644
--- a/sc/inc/detfunc.hxx
+++ b/sc/inc/detfunc.hxx
@@ -50,9 +50,9 @@ enum ScDetectiveObjType
class SC_DLLPUBLIC ScDetectiveFunc
{
- static ColorData nArrowColor;
- static ColorData nErrorColor;
- static ColorData nCommentColor;
+ static Color nArrowColor;
+ static Color nErrorColor;
+ static Color nCommentColor;
static bool bColorsInitialized;
ScDocument* pDoc;
@@ -144,9 +144,9 @@ public:
void InsertObject( ScDetectiveObjType eType, const ScAddress& rPosition,
const ScRange& rSource, bool bRedLine );
- static ColorData GetArrowColor();
- static ColorData GetErrorColor();
- static ColorData GetCommentColor();
+ static Color GetArrowColor();
+ static Color GetErrorColor();
+ static Color GetCommentColor();
static void InitializeColors();
static bool IsColorsInitialized();
static void AppendChangTrackNoteSeparator(OUString &str);
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 2bf2cb8d8fd0..c1480acf67ad 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2678,7 +2678,7 @@ void ScExportTest::testSheetTabColorsXLSX()
}
}
- const ColorData aXclColors[] =
+ const Color aXclColors[] =
{
0x0000B050, // green
0x00FF0000, // red
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 8ba2a4ac075d..4ddf9c623622 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -121,9 +121,9 @@ private:
SfxItemSet aCaptionSet;
};
-ColorData ScDetectiveFunc::nArrowColor = 0;
-ColorData ScDetectiveFunc::nErrorColor = 0;
-ColorData ScDetectiveFunc::nCommentColor = 0;
+Color ScDetectiveFunc::nArrowColor = 0;
+Color ScDetectiveFunc::nErrorColor = 0;
+Color ScDetectiveFunc::nCommentColor = 0;
bool ScDetectiveFunc::bColorsInitialized = false;
static bool lcl_HasThickLine( const SdrObject& rObj )
@@ -488,8 +488,8 @@ bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
else
rAttrSet.Put( XLineWidthItem( 0 ) ); // single reference
- ColorData nColorData = ( bRed ? GetErrorColor() : GetArrowColor() );
- rAttrSet.Put( XLineColorItem( OUString(), Color( nColorData ) ) );
+ Color nColor = ( bRed ? GetErrorColor() : GetArrowColor() );
+ rAttrSet.Put( XLineColorItem( OUString(), Color( nColor ) ) );
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
@@ -553,8 +553,8 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
else
rAttrSet.Put( XLineWidthItem( 0 ) ); // single reference
- ColorData nColorData = ( bRed ? GetErrorColor() : GetArrowColor() );
- rAttrSet.Put( XLineColorItem( OUString(), Color( nColorData ) ) );
+ Color nColor = ( bRed ? GetErrorColor() : GetArrowColor() );
+ rAttrSet.Put( XLineColorItem( OUString(), Color( nColor ) ) );
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
@@ -1498,8 +1498,8 @@ void ScDetectiveFunc::UpdateAllArrowColors()
if ( bArrow || bError )
{
- ColorData nColorData = ( bError ? GetErrorColor() : GetArrowColor() );
- pObject->SetMergedItem( XLineColorItem( OUString(), Color( nColorData ) ) );
+ Color nColor = ( bError ? GetErrorColor() : GetArrowColor() );
+ pObject->SetMergedItem( XLineColorItem( OUString(), Color( nColor ) ) );
// repaint only
pObject->ActionChanged();
@@ -1579,7 +1579,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject,
FindFrameForObject( pObject, rSource ); // modifies rSource
}
- ColorData nObjColor = pObject->GetMergedItem(XATTR_LINECOLOR).GetColorValue().GetColor();
+ Color nObjColor = pObject->GetMergedItem(XATTR_LINECOLOR).GetColorValue().GetColor();
if ( nObjColor == GetErrorColor() && nObjColor != GetArrowColor() )
rRedLine = true;
}
@@ -1631,21 +1631,21 @@ void ScDetectiveFunc::InsertObject( ScDetectiveObjType eType,
}
}
-ColorData ScDetectiveFunc::GetArrowColor()
+Color ScDetectiveFunc::GetArrowColor()
{
if (!bColorsInitialized)
InitializeColors();
return nArrowColor;
}
-ColorData ScDetectiveFunc::GetErrorColor()
+Color ScDetectiveFunc::GetErrorColor()
{
if (!bColorsInitialized)
InitializeColors();
return nErrorColor;
}
-ColorData ScDetectiveFunc::GetCommentColor()
+Color ScDetectiveFunc::GetCommentColor()
{
if (!bColorsInitialized)
InitializeColors();
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 25cda7d56db7..3a95c4b23a40 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -253,7 +253,7 @@ public:
/** Returns the RGB color data for a (non-zero-based) Excel palette entry.
@return The color from current or default palette or COL_AUTO, if nothing else found. */
- ColorData GetColorData( sal_uInt16 nXclIndex ) const;
+ Color GetColor( sal_uInt16 nXclIndex ) const;
/** Returns true, if all colors of the palette are equal to default palette colors. */
bool IsDefaultPalette() const;
@@ -461,7 +461,7 @@ void XclExpPaletteImpl::GetMixedColors(
}
}
-ColorData XclExpPaletteImpl::GetColorData( sal_uInt16 nXclIndex ) const
+Color XclExpPaletteImpl::GetColor( sal_uInt16 nXclIndex ) const
{
if( nXclIndex >= EXC_COLOR_USEROFFSET )
{
@@ -469,7 +469,7 @@ ColorData XclExpPaletteImpl::GetColorData( sal_uInt16 nXclIndex ) const
if( nIdx < maPalette.size() )
return maPalette[ nIdx ].maColor.GetColor();
}
- return mrDefPal.GetDefColorData( nXclIndex );
+ return mrDefPal.GetDefColor( nXclIndex );
}
bool XclExpPaletteImpl::IsDefaultPalette() const
@@ -798,7 +798,7 @@ void XclExpPalette::GetMixedColors(
Color XclExpPalette::GetColor( sal_uInt16 nXclIndex ) const
{
- return Color(mxImpl->GetColorData( nXclIndex ));
+ return Color(mxImpl->GetColor( nXclIndex ));
}
void XclExpPalette::Save( XclExpStream& rStrm )
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 2b75c82a94d4..8a84cfcf4c20 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3219,7 +3219,7 @@ XclImpSimpleDffConverter::~XclImpSimpleDffConverter()
bool XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const
{
- ColorData nColor = GetPalette().GetColorData( nIndex );
+ Color nColor = GetPalette().GetColor( nIndex );
if( nColor == COL_AUTO )
return false;
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 7cafcf70e7fd..8b54b6241afd 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -72,23 +72,23 @@ using ::std::vector;
using namespace ::com::sun::star;
typedef ::cppu::WeakImplHelper< container::XIndexAccess > XIndexAccess_BASE;
-typedef ::std::vector< ColorData > ColorDataVec;
+typedef ::std::vector< Color > ColorVec;
class PaletteIndex : public XIndexAccess_BASE
{
public:
- explicit PaletteIndex( const ColorDataVec& rColorDataTable ) : maColorData( rColorDataTable ) {}
+ explicit PaletteIndex( const ColorVec& rColorTable ) : maColor( rColorTable ) {}
// Methods XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() override
{
- return maColorData.size();
+ return maColor.size();
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override
{
//--Index; // apparently the palette is already 1 based
- return uno::makeAny( sal_Int32( maColorData[ Index ] ) );
+ return uno::makeAny( sal_Int32( maColor[ Index ] ) );
}
// Methods XElementAccess
@@ -98,11 +98,11 @@ public:
}
virtual sal_Bool SAL_CALL hasElements() override
{
- return (maColorData.size() > 0);
+ return (maColor.size() > 0);
}
private:
- ColorDataVec maColorData;
+ ColorVec maColor;
};
void
@@ -112,10 +112,10 @@ XclImpPalette::ExportPalette()
{
// copy values in color palette
sal_Int16 nColors = maColorTable.size();
- ColorDataVec aColors;
+ ColorVec aColors;
aColors.resize( nColors );
for( sal_uInt16 nIndex = 0; nIndex < nColors; ++nIndex )
- aColors[ nIndex ] = GetColorData( nIndex );
+ aColors[ nIndex ] = GetColor( nIndex );
uno::Reference< beans::XPropertySet > xProps( pDocShell->GetModel(), uno::UNO_QUERY );
if ( xProps.is() )
@@ -138,7 +138,7 @@ void XclImpPalette::Initialize()
maColorTable.clear();
}
-ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const
+Color XclImpPalette::GetColor( sal_uInt16 nXclIndex ) const
{
if( nXclIndex >= EXC_COLOR_USEROFFSET )
{
@@ -146,7 +146,7 @@ ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const
if( nIx < maColorTable.size() )
return maColorTable[ nIx ];
}
- return GetDefColorData( nXclIndex );
+ return GetDefColor( nXclIndex );
}
void XclImpPalette::ReadPalette( XclImpStream& rStrm )
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index b4c65de0c546..b583c2df42ff 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -884,8 +884,8 @@ void XclChPropSetHelper::ReadMarkerProperties(
rMarkerFmt.mnMarkerSize = XclTools::GetTwipsFromHmm( nApiSize );
// symbol colors
- rMarkerFmt.maLineColor = ScfApiHelper::ConvertFromApiColor( aApiSymbol.BorderColor );
- rMarkerFmt.maFillColor = ScfApiHelper::ConvertFromApiColor( aApiSymbol.FillColor );
+ rMarkerFmt.maLineColor = Color( aApiSymbol.BorderColor );
+ rMarkerFmt.maFillColor = Color( aApiSymbol.FillColor );
}
}
@@ -949,7 +949,7 @@ void XclChPropSetHelper::WriteLineProperties(
}
// line color
- sal_Int32 nApiColor = ScfApiHelper::ConvertToApiColor( rLineFmt.maColor );
+ sal_Int32 nApiColor = sal_Int32( rLineFmt.maColor );
// try to insert the dash style and receive its name
uno::Any aDashNameAny;
@@ -1081,9 +1081,9 @@ void XclChPropSetHelper::WriteMarkerProperties(
aApiSymbol.Size = awt::Size( nApiSize, nApiSize );
// symbol colors
- aApiSymbol.FillColor = ScfApiHelper::ConvertToApiColor( rMarkerFmt.maFillColor );
+ aApiSymbol.FillColor = sal_Int32( rMarkerFmt.maFillColor );
aApiSymbol.BorderColor = ::get_flag( rMarkerFmt.mnFlags, EXC_CHMARKERFORMAT_NOLINE ) ?
- aApiSymbol.FillColor : ScfApiHelper::ConvertToApiColor( rMarkerFmt.maLineColor );
+ aApiSymbol.FillColor : sal_Int32( rMarkerFmt.maLineColor );
// set the property
rPropSet.SetProperty( EXC_CHPROP_SYMBOL, aApiSymbol );
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index 7c7b54253931..3c32027ce5cc 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -42,13 +42,13 @@
0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080
/** Default color table for BIFF2. */
-static const ColorData spnDefColorTable2[] =
+static const Color spnDefColorTable2[] =
{
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT
};
/** Default color table for BIFF3/BIFF4. */
-static const ColorData spnDefColorTable3[] =
+static const Color spnDefColorTable3[] =
{
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
@@ -56,7 +56,7 @@ static const ColorData spnDefColorTable3[] =
};
/** Default color table for BIFF5/BIFF7. */
-static const ColorData spnDefColorTable5[] =
+static const Color spnDefColorTable5[] =
{
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
@@ -69,7 +69,7 @@ static const ColorData spnDefColorTable5[] =
};
/** Default color table for BIFF8. */
-static const ColorData spnDefColorTable8[] =
+static const Color spnDefColorTable8[] =
{
/* 0 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
@@ -134,9 +134,9 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) :
}
}
-ColorData XclDefaultPalette::GetDefColorData( sal_uInt16 nXclIndex ) const
+Color XclDefaultPalette::GetDefColor( sal_uInt16 nXclIndex ) const
{
- ColorData nColor;
+ Color nColor;
if( nXclIndex < mnTableSize )
nColor = mpnColorTable[ nXclIndex ];
else switch( nXclIndex )
@@ -153,7 +153,7 @@ ColorData XclDefaultPalette::GetDefColorData( sal_uInt16 nXclIndex ) const
case EXC_COLOR_NOTETEXT: nColor = mnNoteText; break;
case EXC_COLOR_FONTAUTO: nColor = COL_AUTO; break;
default:
- SAL_WARN("sc", "XclDefaultPalette::GetDefColorData - unknown default color index: " << nXclIndex );
+ SAL_WARN("sc", "XclDefaultPalette::GetDefColor - unknown default color index: " << nXclIndex );
nColor = COL_AUTO;
}
return nColor;
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index b7fbf428d24a..0d09cfb5c2a5 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -201,7 +201,7 @@ bool ScfPropertySet::GetColorProperty( Color& rColor, const OUString& rPropName
{
sal_Int32 nApiColor = 0;
bool bRet = GetProperty( nApiColor, rPropName );
- rColor = ScfApiHelper::ConvertFromApiColor( nApiColor );
+ rColor = Color( nApiColor );
return bRet;
}
@@ -324,7 +324,7 @@ void ScfPropSetHelper::ReadValue( Color& rColor )
{
sal_Int32 nApiColor(0);
ReadValue( nApiColor );
- rColor = ScfApiHelper::ConvertFromApiColor( nApiColor );
+ rColor = Color( nApiColor );
}
void ScfPropSetHelper::ReadValue( bool& rbValue )
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 4610650744d5..0648da426305 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -47,13 +47,6 @@ class SfxObjectShell;
class ScfApiHelper
{
public:
- /** Converts a tools color to a UNO color value. */
- static sal_Int32 ConvertToApiColor( const Color& rColor )
- { return static_cast< sal_Int32 >( rColor.GetColor() ); }
- /** Converts a UNO color value to a tools color. */
- static Color ConvertFromApiColor( sal_Int32 nApiColor )
- { return Color( static_cast< ColorData >( nApiColor ) ); }
-
/** Converts a non-empty vector into a UNO sequence containing elements of the same type. */
template< typename Type >
static css::uno::Sequence< Type >
@@ -188,7 +181,7 @@ public:
/** Puts the passed color into the property set. */
void SetColorProperty( const OUString& rPropName, const Color& rColor )
- { SetProperty( rPropName, ScfApiHelper::ConvertToApiColor( rColor ) ); }
+ { SetProperty( rPropName, sal_Int32( rColor ) ); }
/** Puts the passed properties into the property set. Tries to use the XMultiPropertySet interface.
@param rPropNames The property names. MUST be ordered alphabetically.
@@ -247,7 +240,7 @@ public:
void WriteValue( const css::uno::Any& rAny );
/** Writes a color value to the value sequence. */
void WriteValue( const Color& rColor )
- { WriteValue( ScfApiHelper::ConvertToApiColor( rColor ) ); }
+ { WriteValue( sal_Int32( rColor ) ); }
/** Writes a C++ boolean value to the value sequence. */
void WriteValue( bool rbValue );
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index da818321dabd..68fec485b95d 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -49,23 +49,18 @@ public:
/** Clears all buffered data, used to set up for a new sheet. */
void Initialize();
- /** Returns the RGB color data for a (non-zero-based) Excel palette entry.
- @descr First looks for a color read from file, then looks for a default color.
- @return The color from current or default palette or COL_AUTO, if nothing else found. */
- ColorData GetColorData( sal_uInt16 nXclIndex ) const;
/** Returns the color for a (non-zero-based) Excel palette entry.
@descr First looks for a color read from file, then looks for a default color.
@return The color from current or default palette or COL_AUTO, if nothing else found. */
- Color GetColor( sal_uInt16 nXclIndex ) const
- { return Color( GetColorData( nXclIndex ) ); }
+ Color GetColor( sal_uInt16 nXclIndex ) const;
/** Reads a PALETTE record. */
void ReadPalette( XclImpStream& rStrm );
private:
void ExportPalette();
- typedef ::std::vector< ColorData > ColorDataVec;
- ColorDataVec maColorTable; /// Colors read from file.
+ typedef ::std::vector< Color > ColorVec;
+ ColorVec maColorTable; /// Colors read from file.
const XclImpRoot& mrRoot;
};
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index 1e20c5c396d8..1ff7b9a8c1f7 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -257,22 +257,19 @@ public:
/** Returns the color count in the current palette. */
sal_uInt32 GetColorCount() const { return mnTableSize - EXC_COLOR_USEROFFSET; }
- /** Returns the default RGB color data for a (non-zero-based) Excel color or COL_AUTO on error. */
- ColorData GetDefColorData( sal_uInt16 nXclIndex ) const;
/** Returns the default color for a (non-zero-based) Excel color or COL_AUTO on error. */
- Color GetDefColor( sal_uInt16 nXclIndex ) const
- { return Color( GetDefColorData( nXclIndex ) ); }
+ Color GetDefColor( sal_uInt16 nXclIndex ) const;
/** Returns true, if the passed Excel color index is a system color. */
bool IsSystemColor( sal_uInt16 nXclIndex ) const { return nXclIndex >= mnTableSize; }
private:
- const ColorData* mpnColorTable; /// The table with RGB values.
- ColorData mnWindowText; /// System window text color.
- ColorData mnWindowBack; /// System window background color.
- ColorData mnFaceColor; /// System button background color.
- ColorData mnNoteText; /// Note text color.
- ColorData mnNoteBack; /// Note background color.
+ const Color* mpnColorTable; /// The table with RGB values.
+ Color mnWindowText; /// System window text color.
+ Color mnWindowBack; /// System window background color.
+ Color mnFaceColor; /// System button background color.
+ Color mnNoteText; /// Note text color.
+ Color mnNoteBack; /// Note background color.
sal_uInt32 mnTableSize; /// The color table size.
};
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9038903d57d1..d25fde7b8bd3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -377,11 +377,11 @@ handle_r1c1:
pRangeFindList.reset(new ScRangeFindList( pDocSh->GetTitle() ));
}
- ColorData nColorData = pRangeFindList->Insert( ScRangeFindData( aRange, nFlags, nStart, nPos ) );
+ Color nColor = pRangeFindList->Insert( ScRangeFindData( aRange, nFlags, nStart, nPos ) );
ESelection aSel( 0, nStart, 0, nPos );
SfxItemSet aSet( mpEditEngine->GetEmptyItemSet() );
- aSet.Put( SvxColorItem( Color( nColorData ),
+ aSet.Put( SvxColorItem( Color( nColor ),
EE_CHAR_COLOR ) );
mpEditEngine->QuickSetAttribs( aSet, aSel );
++nCount;
@@ -434,7 +434,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
ScRangeFindData& rData = pRangeFindList->GetObject( nIndex );
sal_Int32 nOldStart = rData.nSelStart;
sal_Int32 nOldEnd = rData.nSelEnd;
- ColorData nNewColor = pRangeFindList->FindColor( rNew, nIndex );
+ Color nNewColor = pRangeFindList->FindColor( rNew, nIndex );
ScRange aJustified = rNew;
aJustified.PutInOrder(); // Always display Ref in the Formula the right way
@@ -448,7 +448,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
lcl_Replace( pTopView, aNewStr, aOldSel );
lcl_Replace( pTableView, aNewStr, aOldSel );
- aSet.Put( SvxColorItem( Color( nNewColor ), EE_CHAR_COLOR ) );
+ aSet.Put( SvxColorItem( nNewColor, EE_CHAR_COLOR ) );
mpEditEngine->QuickSetAttribs( aSet, aOldSel );
bInRangeUpdate = true;
@@ -459,7 +459,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
rData.aRef = rNew;
rData.nSelEnd = rData.nSelEnd + nDiff;
- rData.nColorData = nNewColor;
+ rData.nColor = nNewColor;
sal_uInt16 nCount = static_cast<sal_uInt16>(pRangeFindList->Count());
for (sal_uInt16 i=nIndex+1; i<nCount; i++)
diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx
index 9cb7bbb7a1df..bf4d9a719f3d 100644
--- a/sc/source/ui/app/rfindlst.cxx
+++ b/sc/source/ui/app/rfindlst.cxx
@@ -22,7 +22,7 @@
#define SC_RANGECOLORS 8
-static const ColorData aColNames[SC_RANGECOLORS] =
+static const Color aColNames[SC_RANGECOLORS] =
{ COL_LIGHTBLUE, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_GREEN,
COL_BLUE, COL_RED, COL_MAGENTA, COL_BROWN };
@@ -33,7 +33,7 @@ ScRangeFindList::ScRangeFindList(const OUString& rName) :
{
}
-ColorData ScRangeFindList::Insert( const ScRangeFindData &rNew )
+Color ScRangeFindList::Insert( const ScRangeFindData &rNew )
{
std::vector<ScRangeFindData>::iterator it=maEntries.begin();
for( ; it!=maEntries.end(); ++it)
@@ -42,28 +42,28 @@ ColorData ScRangeFindList::Insert( const ScRangeFindData &rNew )
break;
}
ScRangeFindData insertData(rNew);
- insertData.nColorData = ( it != maEntries.end() ? it->nColorData :
+ insertData.nColor = ( it != maEntries.end() ? it->nColor :
ScRangeFindList::GetColorName( maEntries.size() ) );
maEntries.push_back(insertData);
nIndexColor = maEntries.size() - 1;
- return insertData.nColorData;
+ return insertData.nColor;
}
-ColorData ScRangeFindList::GetColorName( const size_t nIndex )
+Color ScRangeFindList::GetColorName( const size_t nIndex )
{
return aColNames[nIndex % SC_RANGECOLORS];
}
-ColorData ScRangeFindList::FindColor( const ScRange& rRef, const size_t nIndex )
+Color ScRangeFindList::FindColor( const ScRange& rRef, const size_t nIndex )
{
sal_Int32 nOldCntr = 0;
sal_Int32 nNewCntr = 0;
- ColorData nOldColor = 0;
- ColorData nNewColor = 0;
+ Color nOldColor = 0;
+ Color nNewColor = 0;
DBG_ASSERT( (nIndex < maEntries.size()), "nIndex out of range!" );
- nOldColor = maEntries[nIndex].nColorData;
+ nOldColor = maEntries[nIndex].nColor;
nNewColor = ScRangeFindList::GetColorName( nIndex );
std::vector<ScRangeFindData>::iterator it=maEntries.begin();
@@ -72,15 +72,15 @@ ColorData ScRangeFindList::FindColor( const ScRange& rRef, const size_t nIndex )
if(it->aRef == rRef)
break;
- if (it->nColorData == nOldColor )
+ if (it->nColor == nOldColor )
nOldCntr++;
- if (it->nColorData == nNewColor )
+ if (it->nColor == nNewColor )
nNewCntr++;
}
if ( it != maEntries.end() )
- return it->nColorData;
+ return it->nColor;
if ( nOldCntr == 1 )
return nOldColor;
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 6bb119ec345b..84f95950744c 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -223,10 +223,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, Configura
{
const svtools::ColorConfig& rColors = GetColorConfig();
bool bArrows =
- ( ScDetectiveFunc::GetArrowColor() != static_cast<ColorData>(rColors.GetColorValue(svtools::CALCDETECTIVE).nColor) ||
- ScDetectiveFunc::GetErrorColor() != static_cast<ColorData>(rColors.GetColorValue(svtools::CALCDETECTIVEERROR).nColor) );
+ ( ScDetectiveFunc::GetArrowColor() != rColors.GetColorValue(svtools::CALCDETECTIVE).nColor ||
+ ScDetectiveFunc::GetErrorColor() != rColors.GetColorValue(svtools::CALCDETECTIVEERROR).nColor );
bool bComments =
- ( ScDetectiveFunc::GetCommentColor() != static_cast<ColorData>(rColors.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor) );
+ ( ScDetectiveFunc::GetCommentColor() != rColors.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor );
if ( bArrows || bComments )
{
ScDetectiveFunc::InitializeColors(); // get the new colors
diff --git a/sc/source/ui/inc/rfindlst.hxx b/sc/source/ui/inc/rfindlst.hxx
index ddb15a81ddac..4d8922b86bbe 100644
--- a/sc/source/ui/inc/rfindlst.hxx
+++ b/sc/source/ui/inc/rfindlst.hxx
@@ -30,10 +30,10 @@ struct ScRangeFindData
ScRefFlags nFlags;
sal_Int32 nSelStart;
sal_Int32 nSelEnd;
- ColorData nColorData;
+ Color nColor;
ScRangeFindData( const ScRange& rR, ScRefFlags nF, sal_Int32 nS, sal_Int32 nE ) :
- aRef(rR), nFlags(nF), nSelStart(nS), nSelEnd(nE), nColorData(0) {}
+ aRef(rR), nFlags(nF), nSelStart(nS), nSelEnd(nE) {}
};
class ScRangeFindList
@@ -47,7 +47,7 @@ public:
ScRangeFindList(const OUString& rName);
sal_uLong Count() const { return maEntries.size(); }
- ColorData Insert( const ScRangeFindData &rNew );
+ Color Insert( const ScRangeFindData &rNew );
ScRangeFindData& GetObject( sal_uLong nIndex ) { return maEntries[nIndex]; }
@@ -56,8 +56,8 @@ public:
const OUString& GetDocName() const { return aDocName; }
bool IsHidden() const { return bHidden; }
- static ColorData GetColorName(const size_t nIndex);
- ColorData FindColor(const ScRange& rRef, const size_t nIndex);
+ static Color GetColorName(const size_t nIndex);
+ Color FindColor(const ScRange& rRef, const size_t nIndex);
};
#endif
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 1e4e5103547c..8a9c71ee6eb6 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -145,7 +145,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference(const OUString& rStr)
for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
ScRange* pRangeEntry = aRangeList[ i ];
- ColorData aColName = ScRangeFindList::GetColorName( i );
+ Color aColName = ScRangeFindList::GetColorName( i );
pTabViewShell->AddHighlightRange( *pRangeEntry, aColName );
}
}
@@ -228,7 +228,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference(const OUString& rStr)
aRange.aStart = aRef.toAbs(aPos);
aRange.aEnd = aRange.aStart;
}
- ColorData aColName=ScRangeFindList::GetColorName(nIndex++);
+ Color aColName=ScRangeFindList::GetColorName(nIndex++);
pTabViewShell->AddHighlightRange(aRange, aColName);
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 430e07b663d4..a22b16ee5467 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -8289,10 +8289,9 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_TABCOLOR )
{
- sal_Int32 nColor = COL_AUTO;
- if ( aValue >>= nColor )
+ Color aColor = COL_AUTO;
+ if ( aValue >>= aColor )
{
- const Color aColor( static_cast< ColorData >( nColor ) );
if ( rDoc.GetTabBgColor( nTab ) != aColor )
rFunc.SetTabBgColor( nTab, aColor, true, true );
}
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index 557b00937e0b..3bb8d9f28c6b 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -36,7 +36,7 @@ using namespace ::ooo::vba;
#define EXC_PALETTE_EGA_COLORS_DARK \
0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080
-static const ColorData spnDefColorTable8[] =
+static const Color spnDefColorTable8[] =
{
/* 8 */ EXC_PALETTE_EGA_COLORS_LIGHT,
/* 16 */ EXC_PALETTE_EGA_COLORS_DARK,
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 3792fcaeb5fc..b5b5a1215639 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -848,7 +848,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
if ( aRef.aStart.Tab() >= nTab && aRef.aEnd.Tab() <= nTab )
aOutputData.DrawRefMark( aRef.aStart.Col(), aRef.aStart.Row(),
aRef.aEnd.Col(), aRef.aEnd.Row(),
- Color( rData.nColorData ),
+ rData.nColor,
true );
}
}
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index fa9469259a09..e01710039ad3 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -79,7 +79,7 @@ using namespace com::sun::star;
#define SC_AUTHORCOLORCOUNT 9
-static const ColorData nAuthorColor[ SC_AUTHORCOLORCOUNT ] = {
+static const Color nAuthorColor[ SC_AUTHORCOLORCOUNT ] = {
COL_LIGHTRED, COL_LIGHTBLUE, COL_LIGHTMAGENTA,
COL_GREEN, COL_RED, COL_BLUE,
COL_BROWN, COL_MAGENTA, COL_CYAN };
@@ -96,7 +96,7 @@ ScActionColorChanger::ScActionColorChanger( const ScChangeTrack& rTrack ) :
void ScActionColorChanger::Update( const ScChangeAction& rAction )
{
- ColorData nSetColor;
+ Color nSetColor;
switch (rAction.GetType())
{
case SC_CAT_INSERT_COLS:
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2cc4ebab02c7..4c42ecad42fc 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -638,12 +638,12 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
else if (sName == SC_UNONAME_TABCOLOR)
{
// There are documents out there that have their tab color defined as a view setting.
- sal_Int32 nColor = COL_AUTO;
- aSettings[i].Value >>= nColor;
- if (static_cast<ColorData>(nColor) != COL_AUTO)
+ Color aColor = COL_AUTO;
+ aSettings[i].Value >>= aColor;
+ if (aColor != COL_AUTO)
{
ScDocument* pDoc = rViewData.GetDocument();
- pDoc->SetTabBgColor(nTab, Color(static_cast<ColorData>(nColor)));
+ pDoc->SetTabBgColor(nTab, aColor);
}
}
// Fallback to common SdrModel processing
More information about the Libreoffice-commits
mailing list