summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-05-01 10:08:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-05-01 14:42:04 +0100
commit26bda9f4a82c9b1956a10e3dc52a99bc2f850ada (patch)
tree37766d78617725fdf87084cebb13a93111b35a6c
parent1680b036c5a9bf50b10580ee995f91ca6f873ef5 (diff)
convert message box return types to an enum
Change-Id: I20889dc94aac1119c1ee9da873ce911887c1c335
-rw-r--r--basctl/source/basicide/baside3.cxx2
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx20
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx6
-rw-r--r--include/vcl/msgbox.hxx22
-rw-r--r--include/vcl/vclenum.hxx14
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx2
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx4
-rw-r--r--sd/source/ui/func/fuoaprms.cxx2
-rw-r--r--sd/source/ui/func/fuprlout.cxx2
-rw-r--r--sd/source/ui/view/Outliner.cxx2
-rw-r--r--svx/source/form/datanavi.cxx4
-rw-r--r--sw/source/ui/fldui/fldedt.cxx2
-rw-r--r--uui/source/iahndl-errorhandler.cxx10
-rw-r--r--uui/source/iahndl.cxx10
-rw-r--r--vcl/source/window/msgbox.cxx30
15 files changed, 62 insertions, 70 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 6cafb44b1579..debf652b0ce0 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -931,7 +931,7 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
- AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
+ AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
SetImage( QueryBox::GetStandardImage() );
}
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index d263417cb5e6..c35fba5f4568 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -39,7 +39,7 @@
#include <tools/urlobj.hxx>
-#define BUTTONID_MORE BUTTONID_RETRY + 1
+#define RET_MORE RET_RETRY + 1
#define DIALOG_WIDTH 220
#define OUTER_MARGIN 6
@@ -458,12 +458,12 @@ namespace
sal_uInt16 nButtonID = 0;
switch ( _eType )
{
- case BUTTON_YES: nButtonID = BUTTONID_YES; break;
- case BUTTON_NO: nButtonID = BUTTONID_NO; break;
- case BUTTON_OK: nButtonID = BUTTONID_OK; break;
- case BUTTON_CANCEL: nButtonID = BUTTONID_CANCEL; break;
- case BUTTON_RETRY: nButtonID = BUTTONID_RETRY; break;
- case BUTTON_HELP: nButtonID = BUTTONID_HELP; break;
+ case BUTTON_YES: nButtonID = RET_YES; break;
+ case BUTTON_NO: nButtonID = RET_NO; break;
+ case BUTTON_OK: nButtonID = RET_OK; break;
+ case BUTTON_CANCEL: nButtonID = RET_CANCEL; break;
+ case BUTTON_RETRY: nButtonID = RET_RETRY; break;
+ case BUTTON_HELP: nButtonID = RET_HELP; break;
default:
OSL_FAIL( "lcl_addButton: invalid button id!" );
break;
@@ -623,7 +623,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle )
else
{
OSL_ENSURE( WB_OK & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" );
- AddButton( BUTTON_OK, BUTTONID_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
}
if ( !m_sHelpURL.isEmpty() )
@@ -666,8 +666,8 @@ void OSQLMessageBox::impl_addDetailsButton()
if ( bMoreDetailsAvailable )
{
- AddButton( BUTTON_MORE, BUTTONID_MORE, 0 );
- PushButton* pButton = GetPushButton( BUTTONID_MORE );
+ AddButton( BUTTON_MORE, RET_MORE, 0 );
+ 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 ) );
pButton->SetUniqueId( UID_SQLERROR_BUTTONMORE );
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 5a3d72485066..f6a0ac614298 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -365,9 +365,9 @@ void ORelationTableView::lookForUiActivities()
OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),String(),0);
aDlg.SetText(sTitle);
aDlg.RemoveButton(aDlg.GetButtonId(0));
- aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), BUTTONID_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), BUTTONID_YES, 0);
- aDlg.AddButton(BUTTON_CANCEL,BUTTONID_CANCEL,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(BUTTON_CANCEL,RET_CANCEL,0);
sal_uInt16 nRet = aDlg.Execute();
if( nRet == RET_CANCEL)
{
diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 594d248a6acd..93689f806fba 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -29,28 +29,6 @@ class VclMultiLineEdit;
class FixedImage;
class CheckBox;
-// -----------------
-// - MessBox-Types -
-// -----------------
-
-// Return-Werte von Execute
-//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
-
-#define RET_CANCEL 0
-#define RET_OK 1
-#define RET_YES 2
-#define RET_NO 3
-#define RET_RETRY 4
-#define RET_IGNORE 5
-
-#define BUTTONID_OK RET_OK
-#define BUTTONID_CANCEL RET_CANCEL
-#define BUTTONID_YES RET_YES
-#define BUTTONID_NO RET_NO
-#define BUTTONID_RETRY RET_RETRY
-#define BUTTONID_IGNORE RET_IGNORE
-#define BUTTONID_HELP 10
-
// -----------
// - MessBox -
// -----------
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index e0760b131c01..d37b11b71881 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -132,6 +132,20 @@ enum VclPackType
VCL_PACK_END = 1
};
+// Return Values from Dialog::Execute
+//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
+
+enum VclResponseType
+{
+ RET_CANCEL = 0,
+ RET_OK = 1,
+ RET_YES = 2,
+ RET_NO = 3,
+ RET_RETRY = 4,
+ RET_IGNORE = 5,
+ RET_HELP = 10
+};
+
#endif // _VCL_VCLENUM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 42d048f01725..f9e468bbf668 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -817,7 +817,7 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, sal_u
short ScDPShowDetailDlg::Execute()
{
- return maLbDims.GetEntryCount() ? ModalDialog::Execute() : RET_CANCEL;
+ return maLbDims.GetEntryCount() ? ModalDialog::Execute() : static_cast<short>(RET_CANCEL);
}
OUString ScDPShowDetailDlg::GetDimensionName() const
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 2153af4c2e7f..3a50ba4510d9 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -729,8 +729,8 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
// The dialog is made modal with respect to the whole application.
QueryBox aQuestionBox ( NULL, (WB_YES_NO | WB_DEF_YES), String(SdResId(nStringId)));
aQuestionBox.SetImage (QueryBox::GetStandardImage());
- sal_uInt16 nBoxResult = aQuestionBox.Execute();
- if(nBoxResult != BUTTONID_YES)
+ short nBoxResult = aQuestionBox.Execute();
+ if (nBoxResult != RET_YES)
break;
}
while( true );
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index bb031057ad82..3efc8aecf4eb 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -450,7 +450,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
SfxAbstractDialog* pDlg = pFact ? pFact->CreatSdActionDialog( NULL, &aSet, mpView ) : 0;
- sal_uInt16 nResult = pDlg ? pDlg->Execute() : RET_CANCEL;
+ short nResult = pDlg ? pDlg->Execute() : static_cast<short>(RET_CANCEL);
if( nResult == RET_OK )
{
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index 9df2ef1ee815..67ae4cae1c7d 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -149,7 +149,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractSdPresLayoutDlg* pDlg = pFact ? pFact->CreateSdPresLayoutDlg(mpDocSh, NULL, aSet ) : 0;
- sal_uInt16 nResult = pDlg ? pDlg->Execute() : RET_CANCEL;
+ sal_uInt16 nResult = pDlg ? pDlg->Execute() : static_cast<short>(RET_CANCEL);
switch (nResult)
{
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 1bd2eff6650a..d6b9e608ebca 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1151,7 +1151,7 @@ bool Outliner::ShowWrapArroundDialog (void)
String(SdResId(nStringId)));
aQuestionBox.SetImage (QueryBox::GetStandardImage());
sal_uInt16 nBoxResult = ShowModalMessageBox(aQuestionBox);
- bDoWrapArround = (nBoxResult == BUTTONID_YES);
+ bDoWrapArround = (nBoxResult == RET_YES);
}
return bDoWrapArround;
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index b523d22f36e7..71986a62782f 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -3689,8 +3689,8 @@ namespace svxform
{
SetText( Application::GetDisplayName() );
SetImage( QueryBox::GetStandardImage() );
- AddButton( SVX_RESSTR( RID_STR_DATANAV_LINKWARN_BUTTON ), BUTTONID_OK, BUTTONDIALOG_DEFBUTTON );
- AddButton( BUTTON_CANCEL, BUTTONID_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ AddButton( SVX_RESSTR( RID_STR_DATANAV_LINKWARN_BUTTON ), RET_OK, BUTTONDIALOG_DEFBUTTON );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
}
//............................................................................
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 41320d4c774e..b376360a1fdf 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -248,7 +248,7 @@ IMPL_LINK_NOARG(SwFldEditDlg, OKHdl)
short SwFldEditDlg::Execute()
{
// without TabPage no dialog
- return GetTabPage() ? Dialog::Execute() : RET_CANCEL;
+ return GetTabPage() ? Dialog::Execute() : static_cast<short>(RET_CANCEL);
}
/*--------------------------------------------------------------------
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index 3208d23eba6a..beedaab3ed22 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -106,19 +106,19 @@ executeErrorDialog(
sal_uInt16 aResult = xBox->Execute();
switch( aResult )
{
- case BUTTONID_OK:
+ case RET_OK:
aResult = ERRCODE_BUTTON_OK;
break;
- case BUTTONID_CANCEL:
+ case RET_CANCEL:
aResult = ERRCODE_BUTTON_CANCEL;
break;
- case BUTTONID_YES:
+ case RET_YES:
aResult = ERRCODE_BUTTON_YES;
break;
- case BUTTONID_NO:
+ case RET_NO:
aResult = ERRCODE_BUTTON_NO;
break;
- case BUTTONID_RETRY:
+ case RET_RETRY:
aResult = ERRCODE_BUTTON_RETRY;
break;
}
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 77fa9baa2587..c14784b2d50a 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1080,19 +1080,19 @@ executeMessageBox(
sal_uInt16 aResult = xBox.Execute();
switch( aResult )
{
- case BUTTONID_OK:
+ case RET_OK:
aResult = ERRCODE_BUTTON_OK;
break;
- case BUTTONID_CANCEL:
+ case RET_CANCEL:
aResult = ERRCODE_BUTTON_CANCEL;
break;
- case BUTTONID_YES:
+ case RET_YES:
aResult = ERRCODE_BUTTON_YES;
break;
- case BUTTONID_NO:
+ case RET_NO:
aResult = ERRCODE_BUTTON_NO;
break;
- case BUTTONID_RETRY:
+ case RET_RETRY:
aResult = ERRCODE_BUTTON_RETRY;
break;
}
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index c7f7da7a31ab..9e27767e43f5 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -83,8 +83,8 @@ void MessBox::ImplInitButtons()
else // WB_DEF_OK
nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- AddButton( BUTTON_OK, BUTTONID_OK, nOKFlags );
- AddButton( BUTTON_CANCEL, BUTTONID_CANCEL, nCancelFlags );
+ AddButton( BUTTON_OK, RET_OK, nOKFlags );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_YES_NO )
{
@@ -94,8 +94,8 @@ void MessBox::ImplInitButtons()
nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
nNoFlags |= BUTTONDIALOG_CANCELBUTTON;
- AddButton( BUTTON_YES, BUTTONID_YES, nYesFlags );
- AddButton( BUTTON_NO, BUTTONID_NO, nNoFlags );
+ AddButton( BUTTON_YES, RET_YES, nYesFlags );
+ AddButton( BUTTON_NO, RET_NO, nNoFlags );
}
else if ( nStyle & WB_YES_NO_CANCEL )
{
@@ -106,9 +106,9 @@ void MessBox::ImplInitButtons()
else
nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- AddButton( BUTTON_YES, BUTTONID_YES, nYesFlags );
- AddButton( BUTTON_NO, BUTTONID_NO, nNoFlags );
- AddButton( BUTTON_CANCEL, BUTTONID_CANCEL, nCancelFlags );
+ AddButton( BUTTON_YES, RET_YES, nYesFlags );
+ AddButton( BUTTON_NO, RET_NO, nNoFlags );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_RETRY_CANCEL )
{
@@ -117,8 +117,8 @@ void MessBox::ImplInitButtons()
else // WB_DEF_RETRY
nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- AddButton( BUTTON_RETRY, BUTTONID_RETRY, nRetryFlags );
- AddButton( BUTTON_CANCEL, BUTTONID_CANCEL, nCancelFlags );
+ AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
@@ -132,15 +132,15 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_DEF_IGNORE )
nIgnoreFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- AddButton( BUTTON_ABORT, BUTTONID_CANCEL, nAbortFlags );
- AddButton( BUTTON_RETRY, BUTTONID_RETRY, nRetryFlags );
- AddButton( BUTTON_IGNORE, BUTTONID_IGNORE, nIgnoreFlags );
+ AddButton( BUTTON_ABORT, RET_CANCEL, nAbortFlags );
+ AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags );
+ AddButton( BUTTON_IGNORE, RET_IGNORE, nIgnoreFlags );
}
else if ( nStyle & WB_OK )
{
nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- AddButton( BUTTON_OK, BUTTONID_OK, nOKFlags );
+ AddButton( BUTTON_OK, RET_OK, nOKFlags );
}
}
@@ -208,7 +208,7 @@ void MessBox::ImplPosControls()
{
if ( !mbHelpBtn )
{
- AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
+ AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
mbHelpBtn = sal_True;
}
}
@@ -216,7 +216,7 @@ void MessBox::ImplPosControls()
{
if ( mbHelpBtn )
{
- RemoveButton( BUTTONID_HELP );
+ RemoveButton( RET_HELP );
mbHelpBtn = sal_False;
}
}