[Libreoffice-commits] core.git: cppcanvas/source cui/source dbaccess/source drawinglayer/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 7 08:00:59 UTC 2018


 cppcanvas/source/mtfrenderer/implrenderer.cxx |    6 +++---
 cppcanvas/source/mtfrenderer/textaction.cxx   |    4 ++--
 cui/source/dialogs/colorpicker.cxx            |   16 ++++++++--------
 cui/source/options/optcolor.cxx               |    4 ++--
 cui/source/tabpages/tpcolor.cxx               |    6 +++---
 dbaccess/source/ui/browser/brwctrlr.cxx       |    2 +-
 dbaccess/source/ui/inc/HtmlReader.hxx         |    2 +-
 dbaccess/source/ui/inc/RtfReader.hxx          |    2 +-
 dbaccess/source/ui/misc/HtmlReader.cxx        |    6 +++---
 dbaccess/source/ui/misc/RtfReader.cxx         |    2 +-
 drawinglayer/source/tools/wmfemfhelper.cxx    |    8 ++++----
 11 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit 856c57f20f9b07c686a854e0ccbb6ee3b0ee4791
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 7 08:45:49 2018 +0200

    use more Color in cppcanvas..drawinglayer
    
    Change-Id: Ib0f15e8d4c01c1d2059cf32cc882042766d2a682
    Reviewed-on: https://gerrit.libreoffice.org/50861
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 5d45c82b0f59..806353dbe543 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -912,21 +912,21 @@ namespace cppcanvas
                 ::Color aTextColor = vcl::unotools::doubleSequenceToColor(
                     rState.textColor, xColorSpace );
 
-                aReliefColor = ::COL_LIGHTGRAY;
+                aReliefColor = COL_LIGHTGRAY;
 
                 // we don't have a automatic color, so black is always
                 // drawn on white (literally copied from
                 // vcl/source/gdi/outdev3.cxx)
                 if( aTextColor == COL_BLACK )
                 {
-                    aTextColor = ::COL_WHITE;
+                    aTextColor = COL_WHITE;
                     rParms.mrStates.getState().textColor =
                         vcl::unotools::colorToDoubleSequence(
                             aTextColor, xColorSpace );
                 }
 
                 if( aTextColor == COL_WHITE )
-                    aReliefColor = ::COL_BLACK;
+                    aReliefColor = COL_BLACK;
                 aReliefColor.SetTransparency( aTextColor.GetTransparency() );
             }
 
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index cc5c382187dc..7444c06c0012 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -1610,7 +1610,7 @@ namespace cppcanvas
                 mnOutlineWidth( calcOutlineWidth(rState,rVDev) ),
                 maFillColor(
                     vcl::unotools::colorToDoubleSequence(
-                        ::COL_WHITE,
+                        COL_WHITE,
                         rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() )),
                 maTextLineInfo( tools::createTextLineInfo( rVDev, rState ) ),
                 maLinesOverallSize(),
@@ -1652,7 +1652,7 @@ namespace cppcanvas
                 mnOutlineWidth( calcOutlineWidth(rState,rVDev) ),
                 maFillColor(
                     vcl::unotools::colorToDoubleSequence(
-                        ::COL_WHITE,
+                        COL_WHITE,
                         rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() )),
                 maTextLineInfo( tools::createTextLineInfo( rVDev, rState ) ),
                 maLinesOverallSize(),
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index fae025ce55d0..2619fa1c6f3a 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -436,7 +436,7 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate )
         mdX = double(nX) / double(aSize.Width() - 1.0);
         mdY = double(aSize.Height() - 1.0 - nY) / double(aSize.Height() - 1.0);
 
-        maColor = mxBitmap->GetPixel(Point(nX, nY)).GetColor();
+        maColor = mxBitmap->GetPixel(Point(nX, nY));
     }
 }
 
@@ -807,7 +807,7 @@ void ColorSliderControl::SetValue(const Color& rColor, ColorMode eMode, double d
 class ColorPickerDialog : public ModalDialog
 {
 public:
-    ColorPickerDialog(vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode);
+    ColorPickerDialog(vcl::Window* pParent, Color nColor, sal_Int16 nMode);
     virtual ~ColorPickerDialog() override
     {
         disposeOnce();
@@ -821,7 +821,7 @@ public:
     DECL_LINK(ColorModifyEditHdl, Edit&, void);
     DECL_LINK(ModeModifyHdl, RadioButton&, void);
 
-    sal_Int32 GetColor() const;
+    Color GetColor() const;
 
     void setColorComponent(ColorComponent nComp, double dValue);
 
@@ -865,7 +865,7 @@ private:
     VclPtr<MetricField>    mpMFKey;
 };
 
-ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode )
+ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, Color nColor, sal_Int16 nMode )
 : ModalDialog( pParent, "ColorPicker", "cui/ui/colorpickerdialog.ui" )
 , mnDialogMode( nMode )
 , meMode( DefaultMode )
@@ -1001,9 +1001,9 @@ static int toInt( double dValue, double dRange )
     return static_cast< int >( std::floor((dValue * dRange) + 0.5 ) );
 }
 
-sal_Int32 ColorPickerDialog::GetColor() const
+Color ColorPickerDialog::GetColor() const
 {
-    return Color( toInt(mdRed,255.0), toInt(mdGreen,255.0), toInt(mdBlue,255.0) ).GetColor();
+    return Color( toInt(mdRed,255.0), toInt(mdGreen,255.0), toInt(mdBlue,255.0) );
 }
 
 void ColorPickerDialog::update_color( UpdateFlags n )
@@ -1088,7 +1088,7 @@ void ColorPickerDialog::update_color( UpdateFlags n )
 
     if (n & UpdateFlags::Hex) // update hex
     {
-        mpEDHex->SetColor(aColor.GetColor());
+        mpEDHex->SetColor(aColor);
     }
 
     {
@@ -1358,7 +1358,7 @@ private:
     OUString msTitle;
     const OUString msColorKey;
     const OUString msModeKey;
-    sal_Int32 mnColor;
+    Color mnColor;
     sal_Int16 mnMode;
     Reference<css::awt::XWindow> mxParent;
 };
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 535388b6fcbc..94e830fc44b4 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -422,7 +422,7 @@ void ColorConfigWindow_Impl::Entry::ColorChanged (
     ColorConfigValue& rValue
 ) {
     Color aColor = m_pColorList->GetSelectEntryColor();
-    rValue.nColor = aColor.GetColor();
+    rValue.nColor = aColor;
 }
 
 // color of an extended entry has changed
@@ -430,7 +430,7 @@ void ColorConfigWindow_Impl::Entry::ColorChanged (
     ExtendedColorConfigValue& rValue
 ) {
     Color aColor = m_pColorList->GetSelectEntryColor();
-    rValue.setColor(aColor.GetColor());
+    rValue.setColor(aColor);
     if (aColor == COL_AUTO)
     {
         rValue.setColor(rValue.getDefaultColor());
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 9afe095ed2a6..b5aa6d0f39ea 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -396,7 +396,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
         sal_Int32 nSize = aCustomColorList.getLength();
         aCustomColorList.realloc( nSize + 1 );
         aCustomColorNameList.realloc( nSize + 1 );
-        aCustomColorList[nSize] = aCurrentColor.GetColor();
+        aCustomColorList[nSize] = sal_Int32(aCurrentColor);
         aCustomColorNameList[nSize] = aName;
         officecfg::Office::Common::UserColors::CustomColor::set(aCustomColorList, batch);
         officecfg::Office::Common::UserColors::CustomColorName::set(aCustomColorNameList, batch);
@@ -629,14 +629,14 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
         m_pRcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
         m_pGcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
         m_pBcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-        m_pHexcustom->SetColor( aCurrentColor.GetColor() );
+        m_pHexcustom->SetColor( aCurrentColor );
 
         if( bUpdatePreset )
         {
             m_pRpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
             m_pGpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
             m_pBpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
-            m_pHexpreset->SetColor( aPreviousColor.GetColor() );
+            m_pHexpreset->SetColor( aPreviousColor );
         }
     }
 }
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index a23f0f9d2437..65fded7d83a4 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1826,7 +1826,7 @@ void SbaXDataBrowserController::ExecuteSearch()
     OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!");
     xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(false));
     xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(true));
-    xModelSet->setPropertyValue("CursorColor", makeAny(sal_Int32(COL_LIGHTRED)));
+    xModelSet->setPropertyValue("CursorColor", makeAny(COL_LIGHTRED));
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     VclPtr<AbstractFmSearchDialog> pDialog;
diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx
index 22ab02453061..89c142ae230c 100644
--- a/dbaccess/source/ui/inc/HtmlReader.hxx
+++ b/dbaccess/source/ui/inc/HtmlReader.hxx
@@ -41,7 +41,7 @@ namespace dbaui
                             getTypeSelectionPageFactory() override;
 
         void                TableDataOn(SvxCellHorJustify& eVal);
-        void                TableFontOn(css::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor);
+        void                TableFontOn(css::awt::FontDescriptor& _rFont, Color &_rTextColor);
         sal_Int16           GetWidthPixel( const HTMLOption& rOption );
         void                setTextEncoding();
         void                fetchOptions();
diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx
index 57a13497e590..c24ca3817c9a 100644
--- a/dbaccess/source/ui/inc/RtfReader.hxx
+++ b/dbaccess/source/ui/inc/RtfReader.hxx
@@ -29,7 +29,7 @@ namespace dbaui
 {
     class ORTFReader final : public SvRTFParser , public ODatabaseExport
     {
-        std::vector<sal_Int32>    m_vecColor;
+        std::vector<Color>    m_vecColor;
 
         bool                    CreateTable(int nToken);
         virtual void            NextToken( int nToken ) override; // base class
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index e195bc716b4f..ca24a9f1ea4e 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -320,7 +320,7 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
     }
 }
 
-void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
+void OHTMLReader::TableFontOn(FontDescriptor& _rFont, Color &_rTextColor)
 {
     const HTMLOptions& rHtmlOptions = GetOptions();
     for (const auto & rOption : rHtmlOptions)
@@ -331,7 +331,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
             {
                 Color aColor;
                 rOption.GetColor( aColor );
-                _rTextColor = sal_Int32(aColor.GetRGBColor());
+                _rTextColor = aColor.GetRGBColor();
             }
             break;
         case HtmlOptionId::FACE :
@@ -401,7 +401,7 @@ bool OHTMLReader::CreateTable(HtmlTokenId nToken)
 
     OUString aTableName;
     FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
-    sal_Int32 nTextColor = 0;
+    Color nTextColor;
     do
     {
         switch (nToken)
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index ed0b2da1cd3e..0c0d6d6edc65 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -122,7 +122,7 @@ void ORTFReader::NextToken( int nToken )
                             nTmpToken2 = GetNextToken();
                         }
                         while(aToken[0] != ';' && eState != SvParserState::Error && eState != SvParserState::Accepted);
-                        m_vecColor.push_back(sal_uInt32(aColor.GetRGBColor()));
+                        m_vecColor.push_back(aColor.GetRGBColor());
                         nTmpToken2 = GetNextToken();
                     }
                     while(nTmpToken2 == RTF_RED && eState != SvParserState::Error && eState != SvParserState::Accepted);
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index adfbc4549e80..9f1d84c0aca8 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -2464,7 +2464,7 @@ namespace wmfemfhelper
                 {
                     /** SIMPLE, DONE */
                     const MetaTextColorAction* pA = static_cast<const MetaTextColorAction*>(pAction);
-                    const bool bActivate(COL_TRANSPARENT != pA->GetColor().GetColor());
+                    const bool bActivate(COL_TRANSPARENT != pA->GetColor());
 
                     rPropertyHolders.Current().setTextColorActive(bActivate);
                     rPropertyHolders.Current().setTextColor(pA->GetColor().getBColor());
@@ -2482,7 +2482,7 @@ namespace wmfemfhelper
                         // emulate OutputDevice::SetTextFillColor(...) WITH argument
                         const Color& rFontFillColor = pA->GetColor();
                         rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
-                        rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
+                        rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor);
                     }
                     else
                     {
@@ -2594,7 +2594,7 @@ namespace wmfemfhelper
                     // older Metafiles have no MetaActionType::TEXTCOLOR which defines
                     // the FontColor now, so use the Font's color when not transparent
                     const Color& rFontColor = pA->GetFont().GetColor();
-                    const bool bActivate(COL_TRANSPARENT != rFontColor.GetColor());
+                    const bool bActivate(COL_TRANSPARENT != rFontColor);
 
                     if(bActivate)
                     {
@@ -2611,7 +2611,7 @@ namespace wmfemfhelper
                     {
                         const Color& rFontFillColor = pA->GetFont().GetFillColor();
                         rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
-                        rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
+                        rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor);
                     }
                     else
                     {


More information about the Libreoffice-commits mailing list