summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 08:45:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 09:00:34 +0100
commit856c57f20f9b07c686a854e0ccbb6ee3b0ee4791 (patch)
tree1f7e1c4b49b20f02ddb464d7e58515af8ce150b1 /cui
parenta498b12dc1723b072a165f8c528c377024fd4c98 (diff)
use more Color in cppcanvas..drawinglayer
Change-Id: Ib0f15e8d4c01c1d2059cf32cc882042766d2a682 Reviewed-on: https://gerrit.libreoffice.org/50861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/colorpicker.cxx16
-rw-r--r--cui/source/options/optcolor.cxx4
-rw-r--r--cui/source/tabpages/tpcolor.cxx6
3 files changed, 13 insertions, 13 deletions
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 );
}
}
}