summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-05-26 16:26:35 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-05-28 09:55:08 +0100
commitbe8a02364c82df5252a1ced49db29f855c85677a (patch)
tree71ab14185b350d2a593df55713b6b7f5d4ab5eca /sfx2
parent71079c49ec377ecca2a4410a41d3de3dcd7e07ff (diff)
Rewrite all calls like Dialog(params).Execute()
Replace all calls looking like ADialog(some params).Execute() by ScopedVclPtrInstance<ADialog>::Create(some parms)->Execute() Change-Id: I0b6f0a9ea5ef0a749ffa30ce131e9dc989604639 Reviewed-on: https://gerrit.libreoffice.org/15915 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appserv.cxx2
-rw-r--r--sfx2/source/appl/lnkbase2.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/newstyle.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx12
-rw-r--r--sfx2/source/doc/templatedlg.cxx18
-rw-r--r--sfx2/source/view/viewprn.cxx8
7 files changed, 23 insertions, 23 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index b60da280bf12..40c80143dc92 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1258,7 +1258,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
SvtModuleOptions aModuleOpt;
if ( !aModuleOpt.IsImpress() )
{
- MessageDialog( 0, SFX2_RESSTR( STR_MODULENOTINSTALLED )).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create( nullptr, SFX2_RESSTR( STR_MODULENOTINSTALLED ))->Execute();
return;
}
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 3c899b35c91e..ac35800f3d99 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -545,7 +545,7 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName )
else
return false;
- MessageDialog(pImpl->m_pParentWin, sError).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(pImpl->m_pParentWin, sError)->Execute();
}
}
else if( !pImpl->m_bIsConnect )
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index bda4806c4c89..0e47101b7385 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1652,7 +1652,7 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr
if ( bIsFromTypeBox ) // LoseFocus of TypeBox
pLine->m_bTypeLostFocus = true;
vcl::Window* pParent = GetParent()->GetParent();
- if (MessageDialog(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL).Execute() == RET_OK)
+ if (ScopedVclPtrInstance<MessageDialog>::Create(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL)->Execute() == RET_OK)
pLine->m_aTypeBox->SelectEntryPos( m_aTypeBox->GetEntryPos( reinterpret_cast<void*>(CUSTOM_TYPE_TEXT) ) );
else
pLine->m_aValueEdit->GrabFocus();
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index 0824e3d3c09d..464d12a6a5b3 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -37,7 +37,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
{
if ( !pStyle->IsUserDefined() )
{
- MessageDialog( this, SfxResId( STR_POOL_STYLE_NAME ), VCL_MESSAGE_INFO ).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create( this, SfxResId( STR_POOL_STYLE_NAME ), VCL_MESSAGE_INFO )->Execute();
return 0;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index f4ba28b17d79..f35c470dbaed 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -872,7 +872,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
case SID_CANCELCHECKOUT:
{
- if (MessageDialog(NULL, SfxResId(STR_QUERY_CANCELCHECKOUT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() == RET_YES)
+ if (ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_QUERY_CANCELCHECKOUT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() == RET_YES)
{
CancelCheckOut( );
@@ -1398,7 +1398,7 @@ void SfxObjectShell::ImplSign( bool bScriptingContent )
)
{
// Only OASIS and OOo6.x formats will be handled further
- MessageDialog( NULL, SfxResId( STR_INFO_WRONGDOCFORMAT ), VCL_MESSAGE_INFO ).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create( nullptr, SfxResId( STR_INFO_WRONGDOCFORMAT ), VCL_MESSAGE_INFO )->Execute();
return;
}
@@ -1432,8 +1432,8 @@ void SfxObjectShell::ImplSign( bool bScriptingContent )
if ( nVersion >= SvtSaveOptions::ODFVER_012 )
{
- if ( (bHasSign && MessageDialog(NULL, SfxResId(STR_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() == RET_YES)
- || (!bHasSign && MessageDialog(NULL, SfxResId(RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() == RET_YES) )
+ if ( (bHasSign && ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() == RET_YES)
+ || (!bHasSign && ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() == RET_YES) )
{
sal_uInt16 nId = SID_SAVEDOC;
if ( !GetMedium() || GetMedium()->GetName().isEmpty() )
@@ -1449,7 +1449,7 @@ void SfxObjectShell::ImplSign( bool bScriptingContent )
|| SotStorage::GetVersion( GetMedium()->GetStorage() ) <= SOFFICE_FILEFORMAT_60 ) )
{
// Only OASIS format will be handled further
- MessageDialog( NULL, SfxResId( STR_INFO_WRONGDOCFORMAT ), VCL_MESSAGE_INFO ).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create( nullptr, SfxResId( STR_INFO_WRONGDOCFORMAT ), VCL_MESSAGE_INFO )->Execute();
return;
}
}
@@ -1464,7 +1464,7 @@ void SfxObjectShell::ImplSign( bool bScriptingContent )
}
else
{
- MessageDialog(NULL, SfxResId(STR_XMLSEC_ODF12_EXPECTED)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_XMLSEC_ODF12_EXPECTED))->Execute();
return;
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index d86ffc0b09fe..4b1952f813ae 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -942,7 +942,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
{
OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString());
aMsg = aMsg.replaceFirst("$1",pFolder->maTitle);
- MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$2",aTemplateList))->Execute();
}
}
}
@@ -965,7 +965,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
{
OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString());
aMsg = aMsg.replaceFirst("$1",mpLocalView->getCurRegionName());
- MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$2",aTemplateList))->Execute();
}
}
@@ -1054,7 +1054,7 @@ void SfxTemplateManagerDlg::OnTemplateExport()
if (!aTemplateList.isEmpty())
{
OUString aText( SfxResId(STR_MSG_ERROR_EXPORT).toString() );
- MessageDialog(this, aText.replaceFirst("$1",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aText.replaceFirst("$1",aTemplateList))->Execute();
}
}
}
@@ -1216,7 +1216,7 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
if (!aTemplateList.isEmpty())
{
OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_TEMPLATE).toString() );
- MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$1",aTemplateList))->Execute();
}
}
@@ -1280,7 +1280,7 @@ void SfxTemplateManagerDlg::OnFolderDelete()
if (!aFolderList.isEmpty())
{
OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_FOLDER).toString() );
- MessageDialog(this, aMsg.replaceFirst("$1",aFolderList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$1",aFolderList))->Execute();
}
}
@@ -1301,7 +1301,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (!mpLocalView->isNonRootRegionVisible() && maSelFolders.empty())
{
- MessageDialog(this, SfxResId(STR_MSG_ERROR_SELECT_FOLDER)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, SfxResId(STR_MSG_ERROR_SELECT_FOLDER))->Execute();
return;
}
@@ -1480,7 +1480,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
OUString aDst = mpLocalView->getRegionItemName(nItemId);
OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",aDst);
- MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst( "$2",aTemplateList))->Execute();
}
}
}
@@ -1534,7 +1534,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
OUString aMsg(SfxResId(STR_MSG_ERROR_REMOTE_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",mpRemoteView->getCurRegionName());
aMsg = aMsg.replaceFirst("$2",mpLocalView->getRegionItemName(nItemId));
- MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$1",aTemplateList))->Execute();
}
}
}
@@ -1590,7 +1590,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
OUString aDst = mpLocalView->getRegionItemName(nItemId);
OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",aDst);
- MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst( "$2",aTemplateList))->Execute();
}
}
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 5655d61b7a50..3f238fb9d965 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -343,7 +343,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
// "real" problem (not simply printing cancelled by user)
OUString aMsg( SfxResId(STR_NOSTARTPRINTER).toString() );
if ( !m_bApi )
- MessageDialog(mpViewShell->GetWindow(), aMsg).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(mpViewShell->GetWindow(), aMsg)->Execute();
// intentionally no break
}
case view::PrintableState_JOB_ABORTED :
@@ -521,7 +521,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter )
// Ask if possible, if page format should be taken over from printer.
if ( ( bOriChg || bPgSzChg ) &&
- RET_YES == MessageDialog(NULL, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() )
+ RET_YES == ScopedVclPtrInstance<MessageDialog>::Create(nullptr, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() )
{
// Flags with changes for <SetPrinter(SfxPrinter*)> are maintained
nChangedFlags |= nNewOpt;
@@ -794,7 +794,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
// no valid printer either in ItemSet or at the document
if ( !bSilent )
- MessageDialog(NULL, SfxResId(STR_NODEFPRINTER)).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_NODEFPRINTER))->Execute();
rReq.SetReturnValue(SfxBoolItem(0,false));
@@ -806,7 +806,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
// if printer is busy, abort configuration
if ( !bSilent )
- MessageDialog(NULL, SfxResId(STR_ERROR_PRINTER_BUSY), VCL_MESSAGE_INFO).Execute();
+ ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_ERROR_PRINTER_BUSY), VCL_MESSAGE_INFO)->Execute();
rReq.SetReturnValue(SfxBoolItem(0,false));
return;