sc/source/filter/inc/stylesbuffer.hxx | 18 +++++++++--------- sc/source/filter/inc/viewsettings.hxx | 2 +- sc/source/filter/inc/worksheetsettings.hxx | 4 ++-- sc/source/filter/oox/stylesbuffer.cxx | 27 +++++++++++++++------------ 4 files changed, 27 insertions(+), 24 deletions(-)
New commits: commit 0eeb6f59cc7b3822c12a39e7261f44d7d7d32262 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Jul 28 17:01:42 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Aug 4 10:30:33 2023 +0200 sc: rename oox::xls::Color to oox::xls::XlsColor It's annoying that the class name is so similar to the commonly used class Color, even when it is in its own namespace. To avoid unneccesary conflicts and confusion, it was renamed. (Similar would be also good for oox::drawingml::Color) Change-Id: I68dcaf951b7faf089cb2b13d94576007f40c441e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155109 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 7f265875ef784d717f5a534bdca2cd36fdce7ecb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155155 Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index 643ca392f535..b158fc995be8 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -83,7 +83,7 @@ public: virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx ) const override; }; -class Color : public ::oox::drawingml::Color +class XlsColor : public ::oox::drawingml::Color { public: /** Sets the color to automatic. */ @@ -107,7 +107,7 @@ public: bool isAuto() const { return isPlaceHolder(); } }; -SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ); +SequenceInputStream& operator>>( SequenceInputStream& rStrm, XlsColor& orColor ); /** Stores all colors of the color palette. */ class ColorPalette : public WorkbookHelper @@ -136,8 +136,8 @@ private: /** Contains all XML font attributes, e.g. from a font or rPr element. */ struct FontModel { - OUString maName; /// Font name. - Color maColor; /// Font color. + OUString maName; /// Font name. + XlsColor maColor; /// Font color. sal_Int32 mnScheme; /// Major/minor scheme font. sal_Int32 mnFamily; /// Font family. sal_Int32 mnCharSet; /// Windows font character set. @@ -378,7 +378,7 @@ private: /** Contains XML attributes of a single border line. */ struct BorderLineModel { - Color maColor; /// Borderline color. + XlsColor maColor; /// Borderline color. sal_Int32 mnStyle; /// Border line style. bool mbUsed; /// True = line format used. @@ -471,9 +471,9 @@ typedef std::shared_ptr< Border > BorderRef; /** Contains XML pattern fill attributes from the patternFill element. */ struct PatternFillModel { - Color maPatternColor; /// Pattern foreground color. - Color maFilterPatternColor; /// Pattern foreground for color filter. - Color maFillColor; /// Background fill color. + XlsColor maPatternColor; /// Pattern foreground color. + XlsColor maFilterPatternColor; /// Pattern foreground for color filter. + XlsColor maFillColor; /// Background fill color. sal_Int32 mnPattern; /// Pattern identifier (e.g. solid). bool mbPattColorUsed; /// True = pattern foreground color used. bool mbFillColorUsed; /// True = background fill color used. @@ -488,7 +488,7 @@ struct PatternFillModel /** Contains XML gradient fill attributes from the gradientFill element. */ struct GradientFillModel { - typedef ::std::map< double, Color > ColorMap; + typedef ::std::map<double, XlsColor> ColorMap; sal_Int32 mnType; /// Gradient type, linear or path. double mfAngle; /// Rotation angle for type linear. diff --git a/sc/source/filter/inc/viewsettings.hxx b/sc/source/filter/inc/viewsettings.hxx index 2382f5b54112..70797967afd1 100644 --- a/sc/source/filter/inc/viewsettings.hxx +++ b/sc/source/filter/inc/viewsettings.hxx @@ -42,7 +42,7 @@ struct SheetViewModel typedef RefMap< sal_Int32, PaneSelectionModel > PaneSelectionModelMap; PaneSelectionModelMap maPaneSelMap; /// Selections of all panes. - Color maGridColor; /// Grid color. + XlsColor maGridColor; /// Grid color. ScAddress maFirstPos; /// First visible cell. ScAddress maSecondPos; /// First visible cell in additional panes. sal_Int32 mnWorkbookViewId; /// Index into list of workbookView elements. diff --git a/sc/source/filter/inc/worksheetsettings.hxx b/sc/source/filter/inc/worksheetsettings.hxx index a785145bf07f..2985d4b95b3d 100644 --- a/sc/source/filter/inc/worksheetsettings.hxx +++ b/sc/source/filter/inc/worksheetsettings.hxx @@ -28,8 +28,8 @@ namespace oox::xls { /** Sheet and outline settings. */ struct SheetSettingsModel { - OUString maCodeName; /// VBA module codename. - Color maTabColor; /// Sheet tab color. + OUString maCodeName; /// VBA module codename. + XlsColor maTabColor; /// Sheet tab color. bool mbFilterMode; /// True = sheet contains active filter. bool mbApplyStyles; /// True = automatic styles when creating outlines. bool mbSummaryBelow; /// True = row outline symbols below group. diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index fe3e8f8a4b62..dc4e625b84c4 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -240,37 +240,40 @@ ExcelGraphicHelper::ExcelGraphicHelper( const WorkbookHelper& rHelper ) : return getStyles().getPaletteColor( nPaletteIdx ); } -void Color::setAuto() +void XlsColor::setAuto() { clearTransformations(); setSchemeClr( XML_phClr ); } -void Color::setRgb( ::Color nRgbValue, double fTint ) +void XlsColor::setRgb( ::Color nRgbValue, double fTint ) { clearTransformations(); setSrgbClr( sal_uInt32(nRgbValue) & 0xFFFFFF ); - if( fTint != 0.0 ) addExcelTintTransformation( fTint ); + if (fTint != 0.0) + addExcelTintTransformation(fTint); } -void Color::setTheme( sal_Int32 nThemeIdx, double fTint ) +void XlsColor::setTheme( sal_Int32 nThemeIdx, double fTint ) { clearTransformations(); static const sal_Int32 spnColorTokens[] = { XML_lt1, XML_dk1, XML_lt2, XML_dk2, XML_accent1, XML_accent2, XML_accent3, XML_accent4, XML_accent5, XML_accent6, XML_hlink, XML_folHlink }; setSchemeClr( STATIC_ARRAY_SELECT( spnColorTokens, nThemeIdx, XML_TOKEN_INVALID ) ); - if( fTint != 0.0 ) addExcelTintTransformation( fTint ); + if (fTint != 0.0) + addExcelTintTransformation( fTint ); } -void Color::setIndexed( sal_Int32 nPaletteIdx, double fTint ) +void XlsColor::setIndexed( sal_Int32 nPaletteIdx, double fTint ) { clearTransformations(); setPaletteClr( nPaletteIdx ); - if( fTint != 0.0 ) addExcelTintTransformation( fTint ); + if (fTint != 0.0) + addExcelTintTransformation(fTint); } -void Color::importColor( const AttributeList& rAttribs ) +void XlsColor::importColor( const AttributeList& rAttribs ) { // tdf#113271 The order of import color is very important in case of more than one color attributes was provided. // This order (theme -> rgb -> indexed -> auto) is not documented and was gathered experimentally based on MS Excel 2013. @@ -293,7 +296,7 @@ void Color::importColor( const AttributeList& rAttribs ) } } -void Color::importColor( SequenceInputStream& rStrm ) +void XlsColor::importColor( SequenceInputStream& rStrm ) { sal_uInt8 nFlags, nIndex; sal_Int16 nTint; @@ -332,12 +335,12 @@ void Color::importColor( SequenceInputStream& rStrm ) } } -void Color::importColorId( SequenceInputStream& rStrm ) +void XlsColor::importColorId( SequenceInputStream& rStrm ) { setIndexed( rStrm.readInt32() ); } -SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ) +SequenceInputStream& operator>>( SequenceInputStream& rStrm, XlsColor& orColor ) { orColor.importColor( rStrm ); return rStrm; @@ -1671,7 +1674,7 @@ void GradientFillModel::readGradient( SequenceInputStream& rStrm ) void GradientFillModel::readGradientStop( SequenceInputStream& rStrm, bool bDxf ) { - Color aColor; + XlsColor aColor; double fPosition; if( bDxf ) {