[Libreoffice-commits] core.git: 2 commits - basctl/source cui/source dbaccess/source fpicker/source include/vcl sc/source sfx2/source svx/source sw/source uui/source vcl/source vcl/unx
Noel Grandin
noel at peralex.com
Thu May 7 06:28:21 PDT 2015
basctl/source/basicide/baside3.cxx | 14 ++---
cui/source/customize/cfg.cxx | 8 +-
dbaccess/source/ui/dlg/sqlmessage.cxx | 6 +-
dbaccess/source/ui/misc/UITools.cxx | 2
dbaccess/source/ui/relationdesign/RelationTableView.cxx | 6 +-
fpicker/source/office/iodlgimp.cxx | 2
include/vcl/btndlg.hxx | 25 ++++++---
include/vcl/button.hxx | 38 +++++++------
sc/source/ui/pagedlg/tphfedit.cxx | 2
sfx2/source/doc/querytemplate.cxx | 4 -
svx/source/dialog/prtqry.cxx | 6 +-
sw/source/uibase/shells/textsh1.cxx | 10 +--
uui/source/alreadyopen.cxx | 12 ++--
uui/source/filechanged.cxx | 4 -
uui/source/lockfailed.cxx | 4 -
uui/source/openlocked.cxx | 6 +-
uui/source/trylater.cxx | 6 +-
vcl/source/control/button.cxx | 10 +--
vcl/source/control/menubtn.cxx | 4 -
vcl/source/window/btndlg.cxx | 26 ++++-----
vcl/source/window/msgbox.cxx | 44 ++++++++--------
vcl/unx/x11/x11sys.cxx | 2
22 files changed, 127 insertions(+), 114 deletions(-)
New commits:
commit 0776b33f79327936e0bbf26acc73f2f0db45b9c8
Author: Noel Grandin <noel at peralex.com>
Date: Wed May 6 14:34:03 2015 +0200
convert PUSHBUTTON_DROPDOWN constants to scoped enum
Change-Id: Iae363b8478ef2d560ae661af06ba989f27adc093
Reviewed-on: https://gerrit.libreoffice.org/15650
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 99cf5b0..6420288 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -100,7 +100,7 @@ SvtFileDialogURLSelector::SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFi
SetStyle( GetStyle() | WB_NOPOINTERFOCUS | WB_RECTSTYLE | WB_SMALLSTYLE );
SetModeImage( _pDlg->GetButtonImage( _nButtonId ) );
SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
- SetDropDown( PUSHBUTTON_DROPDOWN_TOOLBOX );
+ SetDropDown( PushButtonDropdownStyle::Toolbox );
}
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index bfa3f20..e0fc178 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -76,9 +76,9 @@ public:
static OUString GetStandardText( StandardButtonType eButton );
- bool SetModeImage( const Image& rImage );
+ bool SetModeImage( const Image& rImage );
const Image GetModeImage( ) const;
- bool HasImage() const;
+ bool HasImage() const;
void SetImageAlign( ImageAlign eAlign );
ImageAlign GetImageAlign() const;
@@ -100,8 +100,12 @@ protected:
// - PushButton-Types -
-#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
-#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
+enum class PushButtonDropdownStyle
+{
+ NONE = 0x0000,
+ Toolbox = 0x0001,
+ MenuButton = 0x0002,
+};
// - PushButton -
@@ -113,7 +117,7 @@ protected:
SymbolType meSymbol;
TriState meState;
TriState meSaveValue;
- sal_uInt16 mnDDStyle;
+ PushButtonDropdownStyle mnDDStyle;
bool mbPressed;
bool mbInUserDraw;
Link<> maToggleHdl;
@@ -125,7 +129,7 @@ protected:
const Rectangle& rRect, bool bLayout, bool bMenuBtnSep);
SAL_DLLPRIVATE void ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout = false);
using Button::ImplGetTextStyle;
- SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
SAL_DLLPRIVATE bool IsImage() const { return Button::HasImage(); }
@@ -174,8 +178,8 @@ public:
SymbolType GetSymbol() const { return meSymbol; }
void SetSymbolAlign( SymbolAlign eAlign );
- void SetDropDown( sal_uInt16 nStyle );
- sal_uInt16 GetDropDown() const { return mnDDStyle; }
+ void SetDropDown( PushButtonDropdownStyle nStyle );
+ PushButtonDropdownStyle GetDropDown() const { return mnDDStyle; }
void SetState( TriState eState );
TriState GetState() const { return meState; }
@@ -197,7 +201,7 @@ public:
void SetToggleHdl( const Link<>& rLink ) { maToggleHdl = rLink; }
const Link<>& GetToggleHdl() const { return maToggleHdl; }
- virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
+ virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
};
inline void PushButton::Check( bool bCheck )
@@ -278,10 +282,10 @@ private:
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
- bool mbChecked;
- bool mbSaveValue;
- bool mbRadioCheck;
- bool mbStateChanged;
+ bool mbChecked;
+ bool mbSaveValue;
+ bool mbRadioCheck;
+ bool mbStateChanged;
Link<> maToggleHdl;
// when mbLegacyNoTextAlign is set then the old behaviour where
// the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
@@ -315,7 +319,7 @@ public:
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
- virtual void FillLayoutData() const SAL_OVERRIDE;
+ virtual void FillLayoutData() const SAL_OVERRIDE;
virtual const vcl::Font&
GetCanonicalFont( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
virtual const Color&
@@ -349,7 +353,7 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
- void Toggle();
+ void Toggle();
bool IsStateChanged() const { return mbStateChanged; }
@@ -435,7 +439,7 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- virtual void FillLayoutData() const SAL_OVERRIDE;
+ virtual void FillLayoutData() const SAL_OVERRIDE;
virtual const vcl::Font& GetCanonicalFont( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
@@ -463,7 +467,7 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
- void Toggle();
+ void Toggle();
void SetState( TriState eState );
TriState GetState() const { return meState; }
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 175d3c7..2e983ed 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -341,7 +341,7 @@ ScExtIButton::ScExtIButton(vcl::Window* pParent, WinBits nBits )
{
nSelected=0;
aIdle.SetPriority(SchedulerPriority::LOWEST);
- SetDropDown(PUSHBUTTON_DROPDOWN_TOOLBOX);
+ SetDropDown(PushButtonDropdownStyle::Toolbox);
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScExtIButton(vcl::Window *pParent, VclBuilder::stringmap &)
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 7bbe33a..b036aee 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -617,7 +617,7 @@ void PushButton::ImplInitPushButtonData()
meSymbol = SymbolType::DONTKNOW;
meState = TRISTATE_FALSE;
meSaveValue = TRISTATE_FALSE;
- mnDDStyle = 0;
+ mnDDStyle = PushButtonDropdownStyle::NONE;
mbPressed = false;
mbInUserDraw = false;
}
@@ -837,7 +837,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, sal_uLong nDrawFl
sal_uLong nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
if( nImageSep < 1 )
nImageSep = 1;
- if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
+ if ( mnDDStyle == PushButtonDropdownStyle::MenuButton )
{
long nSeparatorX = 0;
Rectangle aSymbolRect = aInRect;
@@ -887,7 +887,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, sal_uLong nDrawFl
aDecoView.DrawSymbol( aSymbolRect, meSymbol, aColor, nStyle );
}
- if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
+ if ( mnDDStyle == PushButtonDropdownStyle::Toolbox && !bLayout )
{
bool bBlack = false;
Color aArrowColor( COL_BLACK );
@@ -1547,7 +1547,7 @@ void PushButton::SetSymbolAlign( SymbolAlign eAlign )
ImplSetSymbolAlign( eAlign );
}
-void PushButton::SetDropDown( sal_uInt16 nStyle )
+void PushButton::SetDropDown( PushButtonDropdownStyle nStyle )
{
if ( mnDDStyle != nStyle )
{
@@ -1613,7 +1613,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
}
else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) )
aSize = GetModeImage().GetSizePixel();
- if( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
+ if( mnDDStyle == PushButtonDropdownStyle::MenuButton )
{
long nSymbolSize = GetTextHeight() / 2 + 1;
aSize.Width() += 2*nSymbolSize;
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 74c94c2..9e45256 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -28,7 +28,7 @@
void MenuButton::ImplInitMenuButtonData()
{
- mnDDStyle = PUSHBUTTON_DROPDOWN_MENUBUTTON;
+ mnDDStyle = PushButtonDropdownStyle::MenuButton;
mpMenuTimer = NULL;
mpMenu = NULL;
@@ -109,7 +109,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnMenuMode & MENUBUTTON_MENUMODE_TIMED )
{
// If the separated dropdown symbol is not hit, delay the popup execution
- if( mnDDStyle != PUSHBUTTON_DROPDOWN_MENUBUTTON || // no separator at all
+ if( mnDDStyle != PushButtonDropdownStyle::MenuButton || // no separator at all
rMEvt.GetPosPixel().X() <= ImplGetSeparatorX() )
{
if ( !mpMenuTimer )
commit 2c8dc0373377a6e801c9a9246ffdc3641f3be4ec
Author: Noel Grandin <noel at peralex.com>
Date: Wed May 6 14:21:26 2015 +0200
convert BUTTONDIALOG constants to scoped enum
Change-Id: Icbf73fe55ad604f762dd2b98fd39189bab82f061
Reviewed-on: https://gerrit.libreoffice.org/15648
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 1af65b6..afaa5e2 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -908,9 +908,9 @@ NameClashQueryBox::NameClashQueryBox( vcl::Window* pParent,
maMessText = rMessage;
AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_RENAME), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO, 0 );
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus );
+ AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO );
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
SetImage( QueryBox::GetStandardImage() );
}
@@ -932,10 +932,10 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( vcl::Window* pParent,
maMessText = rMessage;
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_ADD), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO, 0 );
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
- AddButton( StandardButtonType::Help, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus );
+ AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO );
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
+ AddButton( StandardButtonType::Help, RET_HELP, ButtonDialogFlags::Help, 4 );
SetImage( QueryBox::GetStandardImage() );
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 998621f..aa5bf2a 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -5385,10 +5385,10 @@ MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_R
SetImage( WarningBox::GetStandardImage() );
SetMessText( ReplaceIconName( aMessage ) );
RemoveButton( 1 );
- AddButton( StandardButtonType::Yes, 2, 0 );
- AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5, 0 );
- AddButton( StandardButtonType::No, 3, 0 );
- AddButton( StandardButtonType::Cancel, 4, 0 );
+ AddButton( StandardButtonType::Yes, 2);
+ AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5);
+ AddButton( StandardButtonType::No, 3);
+ AddButton( StandardButtonType::Cancel, 4);
}
SvxIconReplacementDialog :: SvxIconReplacementDialog(
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 36341e3..aa4f503 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -442,7 +442,7 @@ namespace
OSL_FAIL( "lcl_addButton: invalid button id!" );
break;
}
- _rDialog.AddButton( _eType, nButtonID, _bDefault ? BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON : 0 );
+ _rDialog.AddButton( _eType, nButtonID, _bDefault ? ButtonDialogFlags::Default | ButtonDialogFlags::Focus : ButtonDialogFlags::NONE );
}
}
@@ -593,7 +593,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle )
else
{
OSL_ENSURE( WB_OK & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" );
- AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton( StandardButtonType::OK, RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus );
}
if ( !m_sHelpURL.isEmpty() )
@@ -635,7 +635,7 @@ void OSQLMessageBox::impl_addDetailsButton()
if ( bMoreDetailsAvailable )
{
- AddButton( StandardButtonType::More, RET_MORE, 0 );
+ AddButton( StandardButtonType::More, RET_MORE);
PushButton* pButton = GetPushButton( RET_MORE );
OSL_ENSURE( pButton, "OSQLMessageBox::impl_addDetailsButton: just added this button, why isn't it there?" );
pButton->SetClickHdl( LINK( this, OSQLMessageBox, ButtonClickHdl ) );
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 397f2a6..71df15d 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1289,7 +1289,7 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _
ScopedVclPtrInstance< OSQLMessageBox > aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query);
if ( _bAll )
{
- aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
+ aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL);
aAsk->GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL);
}
return aAsk->Execute();
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 06f5839..71efb09 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -347,9 +347,9 @@ void ORelationTableView::lookForUiActivities()
ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
aDlg->SetText(sTitle);
aDlg->RemoveButton(aDlg->GetButtonId(0));
- aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
- aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL,0);
+ aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus);
+ aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES);
+ aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL);
sal_uInt16 nRet = aDlg->Execute();
if( nRet == RET_CANCEL)
{
diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
index db29f24..156a50d 100644
--- a/include/vcl/btndlg.hxx
+++ b/include/vcl/btndlg.hxx
@@ -23,17 +23,26 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <vcl/dllapi.h>
#include <vcl/dialog.hxx>
+#include <o3tl/typed_flags_set.hxx>
struct ImplBtnDlgItem;
class PushButton;
#define BUTTONDIALOG_BUTTON_NOTFOUND ((sal_uInt16)0xFFFF)
-#define BUTTONDIALOG_DEFBUTTON ((sal_uInt16)0x0001)
-#define BUTTONDIALOG_OKBUTTON ((sal_uInt16)0x0002)
-#define BUTTONDIALOG_CANCELBUTTON ((sal_uInt16)0x0004)
-#define BUTTONDIALOG_HELPBUTTON ((sal_uInt16)0x0008)
-#define BUTTONDIALOG_FOCUSBUTTON ((sal_uInt16)0x0010)
+enum class ButtonDialogFlags
+{
+ NONE = 0x0000,
+ Default = 0x0001,
+ OK = 0x0002,
+ Cancel = 0x0004,
+ Help = 0x0008,
+ Focus = 0x0010,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ButtonDialogFlags> : is_typed_flags<ButtonDialogFlags, 0x001f> {};
+}
class VCL_DLLPUBLIC ButtonDialog : public Dialog
{
@@ -52,8 +61,8 @@ public:
sal_uInt16 GetCurButtonId() const { return mnCurButtonId; }
- void AddButton( const OUString& rText, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
- void AddButton( StandardButtonType eType, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( const OUString& rText, sal_uInt16 nId, ButtonDialogFlags nBtnFlags = ButtonDialogFlags::NONE, long nSepPixel = 0 );
+ void AddButton( StandardButtonType eType, sal_uInt16 nId, ButtonDialogFlags nBtnFlags = ButtonDialogFlags::NONE, long nSepPixel = 0 );
void RemoveButton( sal_uInt16 nId );
void Clear();
@@ -87,7 +96,7 @@ private:
Link<> maClickHdl;
SAL_DLLPRIVATE void ImplInitButtonDialogData();
- SAL_DLLPRIVATE PushButton* ImplCreatePushButton( sal_uInt16 nBtnFlags );
+ SAL_DLLPRIVATE PushButton* ImplCreatePushButton( ButtonDialogFlags nBtnFlags );
SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
SAL_DLLPRIVATE void ImplPosControls();
diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx
index 3718e57..f61d806 100644
--- a/sfx2/source/doc/querytemplate.cxx
+++ b/sfx2/source/doc/querytemplate.cxx
@@ -34,8 +34,8 @@ QueryTemplateBox::QueryTemplateBox( vcl::Window* pParent, const OUString& rMessa
SetHelpId( HID_QUERY_LOAD_TEMPLATE );
AddButton( SfxResId( STR_QRYTEMPL_UPDATE_BTN ).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( SfxResId(STR_QRYTEMPL_KEEP_BTN).toString(), RET_NO, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus );
+ AddButton( SfxResId(STR_QRYTEMPL_KEEP_BTN).toString(), RET_NO, ButtonDialogFlags::Cancel );
}
} // end of namespace sfx2
diff --git a/svx/source/dialog/prtqry.cxx b/svx/source/dialog/prtqry.cxx
index 9a6d750..b67d591 100644
--- a/svx/source/dialog/prtqry.cxx
+++ b/svx/source/dialog/prtqry.cxx
@@ -30,10 +30,10 @@ SvxPrtQryBox::SvxPrtQryBox(vcl::Window* pParent) :
SetImage( QueryBox::GetStandardImage() );
AddButton(SVX_RESSTR(RID_SVXSTR_QRY_PRINT_SELECTION), RET_OK,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus);
- AddButton(SVX_RESSTR(RID_SVXSTR_QRY_PRINT_ALL), 2, 0);
- AddButton(StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
+ AddButton(SVX_RESSTR(RID_SVXSTR_QRY_PRINT_ALL), 2);
+ AddButton(StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel);
SetButtonHelpText( RET_OK, OUString() );
}
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 0893c42..6651087 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -261,15 +261,15 @@ static short lcl_AskRedlineMode(vcl::Window *pWin)
OUString( SW_RES( STR_REDLINE_TITLE ) ),
OUString( SW_RES( STR_REDLINE_MSG ) ) );
aQBox->SetImage( QueryBox::GetStandardImage() );
- const sal_uInt16 nBtnFlags = BUTTONDIALOG_DEFBUTTON |
- BUTTONDIALOG_OKBUTTON |
- BUTTONDIALOG_FOCUSBUTTON;
+ const ButtonDialogFlags nBtnFlags = ButtonDialogFlags::Default |
+ ButtonDialogFlags::OK |
+ ButtonDialogFlags::Focus;
aQBox->AddButton(OUString(SW_RES(STR_REDLINE_ACCEPT_ALL)), RET_OK, nBtnFlags);
aQBox->GetPushButton( RET_OK )->SetHelpId(HID_AUTOFORMAT_ACCEPT);
- aQBox->AddButton(OUString(SW_RES(STR_REDLINE_REJECT_ALL)), RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
+ aQBox->AddButton(OUString(SW_RES(STR_REDLINE_REJECT_ALL)), RET_CANCEL, ButtonDialogFlags::Cancel);
aQBox->GetPushButton( RET_CANCEL )->SetHelpId(HID_AUTOFORMAT_REJECT );
- aQBox->AddButton(OUString(SW_RES(STR_REDLINE_EDIT)), 2, 0);
+ aQBox->AddButton(OUString(SW_RES(STR_REDLINE_EDIT)), 2);
aQBox->GetPushButton( 2 )->SetHelpId(HID_AUTOFORMAT_EDIT_CHG);
aQBox->SetButtonHelpText( RET_OK, OUString() );
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx
index fa83bee..353fa3c 100644
--- a/uui/source/alreadyopen.cxx
+++ b/uui/source/alreadyopen.cxx
@@ -30,16 +30,16 @@ AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, ResMgr* pResMgr,
if ( bIsStoring )
{
AddButton( ResId(STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( ResId(STR_ALREADYOPEN_SAVE_BTN, *pResMgr).toString(), RET_NO, 0 );
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus );
+ AddButton( ResId(STR_ALREADYOPEN_SAVE_BTN, *pResMgr).toString(), RET_NO);
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
}
else
{
AddButton( ResId(STR_ALREADYOPEN_READONLY_BTN, *pResMgr).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( ResId(STR_ALREADYOPEN_OPEN_BTN, *pResMgr).toString(), RET_NO, 0 );
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus );
+ AddButton( ResId(STR_ALREADYOPEN_OPEN_BTN, *pResMgr).toString(), RET_NO);
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
}
SetButtonHelpText( RET_YES, OUString() );
diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx
index 9b9946c..33b5dee 100644
--- a/uui/source/filechanged.cxx
+++ b/uui/source/filechanged.cxx
@@ -28,8 +28,8 @@ FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, ResMgr* pResMgr
SetImage( QueryBox::GetStandardImage() );
AddButton(ResId(STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus);
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
SetButtonHelpText( RET_YES, OUString() );
SetMessText(ResId(STR_FILECHANGED_MSG, *pResMgr).toString());
diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx
index 875add5..77ceb7e 100644
--- a/uui/source/lockfailed.cxx
+++ b/uui/source/lockfailed.cxx
@@ -29,8 +29,8 @@ LockFailedQueryBox::LockFailedQueryBox( vcl::Window* pParent, ResMgr* pResMgr )
{
SetImage( ErrorBox::GetStandardImage() );
- AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_OKBUTTON );
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ AddButton( StandardButtonType::OK, RET_OK, ButtonDialogFlags::OK );
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
SetMessText(ResId(STR_LOCKFAILED_MSG, *pResMgr ).toString());
SetCheckBoxText(ResId(STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr).toString());
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index ca6883e..acb19a6 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -28,11 +28,11 @@ OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, ResMgr* pResMgr, c
SetImage( QueryBox::GetStandardImage() );
AddButton(ResId(STR_OPENLOCKED_OPENREADONLY_BTN, *pResMgr).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus);
- AddButton(ResId(STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr).toString(), RET_NO, 0);
+ AddButton(ResId(STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr).toString(), RET_NO);
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
SetButtonHelpText( RET_YES, OUString() );
SetButtonHelpText( RET_NO, OUString() );
diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx
index 3f5719f..90688a9 100644
--- a/uui/source/trylater.cxx
+++ b/uui/source/trylater.cxx
@@ -28,9 +28,9 @@ TryLaterQueryBox::TryLaterQueryBox( vcl::Window* pParent, ResMgr* pResMgr, const
SetImage( QueryBox::GetStandardImage() );
AddButton(ResId(STR_TRYLATER_RETRYSAVING_BTN, *pResMgr).toString(), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- AddButton(ResId(STR_TRYLATER_SAVEAS_BTN, *pResMgr).toString(), RET_NO, 0);
- AddButton( StandardButtonType::Cancel, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus);
+ AddButton(ResId(STR_TRYLATER_SAVEAS_BTN, *pResMgr).toString(), RET_NO);
+ AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
SetButtonHelpText( RET_YES, OUString() );
SetButtonHelpText( RET_NO, OUString() );
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 7846e41..bb0f0a3 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -73,23 +73,23 @@ void ButtonDialog::dispose()
Dialog::dispose();
}
-PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
+PushButton* ButtonDialog::ImplCreatePushButton( ButtonDialogFlags nBtnFlags )
{
PushButton* pBtn;
WinBits nStyle = 0;
- if ( nBtnFlags & BUTTONDIALOG_DEFBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Default )
nStyle |= WB_DEFBUTTON;
- if ( nBtnFlags & BUTTONDIALOG_CANCELBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Cancel )
pBtn = VclPtr<CancelButton>::Create( this, nStyle );
- else if ( nBtnFlags & BUTTONDIALOG_OKBUTTON )
+ else if ( nBtnFlags & ButtonDialogFlags::OK )
pBtn = VclPtr<OKButton>::Create( this, nStyle );
- else if ( nBtnFlags & BUTTONDIALOG_HELPBUTTON )
+ else if ( nBtnFlags & ButtonDialogFlags::Help )
pBtn = VclPtr<HelpButton>::Create( this, nStyle );
else
pBtn = VclPtr<PushButton>::Create( this, nStyle );
- if ( !(nBtnFlags & BUTTONDIALOG_HELPBUTTON) )
+ if ( !(nBtnFlags & ButtonDialogFlags::Help) )
pBtn->SetClickHdl( LINK( this, ButtonDialog, ImplClickHdl ) );
return pBtn;
@@ -274,7 +274,7 @@ void ButtonDialog::Click()
}
void ButtonDialog::AddButton( const OUString& rText, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+ ButtonDialogFlags nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
@@ -288,14 +288,14 @@ void ButtonDialog::AddButton( const OUString& rText, sal_uInt16 nId,
maItemList.push_back(pItem);
- if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Focus )
mnFocusButtonId = nId;
mbFormat = true;
}
void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+ ButtonDialogFlags nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
@@ -304,11 +304,11 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mnSepSize = nSepPixel;
if ( eType == StandardButtonType::OK )
- nBtnFlags |= BUTTONDIALOG_OKBUTTON;
+ nBtnFlags |= ButtonDialogFlags::OK;
else if ( eType == StandardButtonType::Help )
- nBtnFlags |= BUTTONDIALOG_HELPBUTTON;
+ nBtnFlags |= ButtonDialogFlags::Help;
else if ( (eType == StandardButtonType::Cancel) || (eType == StandardButtonType::Close) )
- nBtnFlags |= BUTTONDIALOG_CANCELBUTTON;
+ nBtnFlags |= ButtonDialogFlags::Cancel;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
// Standard-Buttons have the right text already
@@ -319,7 +319,7 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mpPushButton->SetText( Button::GetStandardText( eType ) );
}
- if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Focus )
mnFocusButtonId = nId;
maItemList.push_back(pItem);
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 8ddba99..0e7e088 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -62,18 +62,18 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
- sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- sal_uInt16 nRetryFlags = 0;
- sal_uInt16 nYesFlags = 0;
- sal_uInt16 nNoFlags = 0;
+ ButtonDialogFlags nOKFlags = ButtonDialogFlags::OK;
+ ButtonDialogFlags nCancelFlags = ButtonDialogFlags::Cancel;
+ ButtonDialogFlags nRetryFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nYesFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nNoFlags = ButtonDialogFlags::NONE;
if ( nStyle & WB_OK_CANCEL )
{
if ( nStyle & WB_DEF_CANCEL )
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_OK
- nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags );
@@ -81,10 +81,10 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_YES_NO )
{
if ( nStyle & WB_DEF_YES )
- nYesFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_NO
- nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- nNoFlags |= BUTTONDIALOG_CANCELBUTTON;
+ nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
+ nNoFlags |= ButtonDialogFlags::Cancel;
AddButton( StandardButtonType::Yes, RET_YES, nYesFlags );
AddButton( StandardButtonType::No, RET_NO, nNoFlags );
@@ -92,11 +92,11 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_YES_NO_CANCEL )
{
if ( nStyle & WB_DEF_YES )
- nYesFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_NO )
- nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Yes, RET_YES, nYesFlags );
AddButton( StandardButtonType::No, RET_NO, nNoFlags );
@@ -105,24 +105,24 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_RETRY_CANCEL )
{
if ( nStyle & WB_DEF_CANCEL )
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_RETRY
- nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags );
AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- sal_uInt16 nAbortFlags = 0;
- sal_uInt16 nIgnoreFlags = 0;
+ ButtonDialogFlags nAbortFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nIgnoreFlags = ButtonDialogFlags::NONE;
if ( nStyle & WB_DEF_CANCEL )
- nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nAbortFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_RETRY )
- nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_IGNORE )
- nIgnoreFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nIgnoreFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Abort, RET_CANCEL, nAbortFlags );
AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags );
@@ -130,7 +130,7 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_OK )
{
- nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
}
@@ -168,7 +168,7 @@ void MessBox::ImplPosControls()
{
if ( !mbHelpBtn )
{
- AddButton( StandardButtonType::Help, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
+ AddButton( StandardButtonType::Help, RET_HELP, ButtonDialogFlags::Help, 3 );
mbHelpBtn = true;
}
}
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 6723c63..e3eb453 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -141,7 +141,7 @@ int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMes
sal_uInt16 nButton = 0;
for( std::list< OUString >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- aWarn->AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
+ aWarn->AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? ButtonDialogFlags::Default : ButtonDialogFlags::NONE );
nButton++;
}
aWarn->SetFocusButton( (sal_uInt16)nDefButton+1 );
More information about the Libreoffice-commits
mailing list