Kaydet (Commit) 0045ee9b authored tarafından Noel Grandin's avatar Noel Grandin

convert ColorPickerMode to scoped enum

and drop unused Add constant

Change-Id: I4e4f0d35e4d081883b78e0205ffd7086c9cadf04
Reviewed-on: https://gerrit.libreoffice.org/46587Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 65102921
......@@ -424,7 +424,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, Button*, void)
std::unique_ptr<SvColorDialog> pColorDlg(new SvColorDialog( GetParentDialog() ));
pColorDlg->SetColor (aCurrentColor);
pColorDlg->SetMode( svtools::ColorPickerMode_MODIFY );
pColorDlg->SetMode( svtools::ColorPickerMode::Modify );
if( pColorDlg->Execute() == RET_OK )
{
......
......@@ -28,8 +28,9 @@ namespace vcl { class Window; }
namespace svtools
{
// SELECT is the default
enum ColorPickerMode { ColorPickerMode_SELECT = 0, ColorPickerMode_ADD = 1, ColorPickerMode_MODIFY = 2 };
// Select is the default.
// These values must match the constants used in ColorPickerDialog in cui/source/dialogs/colorpicker.cxx
enum class ColorPickerMode { Select = 0, Modify = 2 };
}
class SVT_DLLPUBLIC SvColorDialog final
......@@ -41,14 +42,14 @@ public:
void SetColor( const Color& rColor );
const Color& GetColor() const { return maColor;}
void SetMode( sal_Int16 eMode );
void SetMode( svtools::ColorPickerMode eMode );
short Execute();
private:
VclPtr<vcl::Window> mpParent;
Color maColor;
sal_Int16 meMode;
svtools::ColorPickerMode meMode;
};
#endif // INCLUDED_SVTOOLS_COLRDLG_HXX
......
......@@ -39,7 +39,7 @@ using namespace ::com::sun::star::ui::dialogs;
SvColorDialog::SvColorDialog( vcl::Window* pWindow )
: mpParent( pWindow )
, meMode( svtools::ColorPickerMode_SELECT )
, meMode( svtools::ColorPickerMode::Select )
{
}
......@@ -53,7 +53,7 @@ void SvColorDialog::SetColor( const Color& rColor )
}
void SvColorDialog::SetMode( sal_Int16 eMode )
void SvColorDialog::SetMode( svtools::ColorPickerMode eMode )
{
meMode = eMode;
}
......@@ -76,7 +76,7 @@ short SvColorDialog::Execute()
props[0].Name = sColor;
props[0].Value <<= (sal_Int32) maColor.GetColor();
props[1].Name = "Mode";
props[1].Value <<= meMode;
props[1].Value <<= static_cast<sal_Int16>(meMode);
xPropertyAccess->setPropertyValues( props );
......
......@@ -311,7 +311,7 @@ void PaletteManager::PopupColorPicker(const OUString& aCommand, const Color& rIn
OUString aCommandCopy = aCommand;
SvColorDialog aColorDlg( nullptr );
aColorDlg.SetColor(rInitialColor);
aColorDlg.SetMode(svtools::ColorPickerMode_MODIFY);
aColorDlg.SetMode(svtools::ColorPickerMode::Modify);
if( aColorDlg.Execute() == RET_OK )
{
if (mpBtnUpdater)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment