diff options
author | Philippe Jung <phil.jung@free.fr> | 2015-05-26 16:26:35 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-28 08:44:31 +0000 |
commit | 1379e2feaad6344999358bbfb271edbaea66ce2a (patch) | |
tree | f2d15c298b21e8aa83ec4bbc025ca0561896906e /basctl | |
parent | f9e0e3a4eb8a23bfb9fb66055511c53d120e6579 (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 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basobj2.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 28 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 6 |
7 files changed, 27 insertions, 27 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 6079ed448b02..d602a7439d37 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -305,7 +305,7 @@ bool ModulWindow::BasicExecute() { if ( !aDocument.allowMacros() ) { - MessageDialog(this, IDE_RESSTR(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute(); return false; } } @@ -443,7 +443,7 @@ bool ModulWindow::LoadBasic() bDone = true; } else - MessageDialog(this, IDE_RESSTR(RID_STR_COULDNTREAD)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_COULDNTREAD))->Execute(); } return bDone; } @@ -489,7 +489,7 @@ bool ModulWindow::SaveBasicSource() bDone = true; } else - MessageDialog(this, IDEResId(RID_STR_COULDNTWRITE)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_COULDNTWRITE))->Execute(); } return bDone; diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index a37b00dd16c3..19c052d928b4 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -834,7 +834,7 @@ bool DialogWindow::SaveDialog() } } else - MessageDialog(this, IDE_RESSTR(RID_STR_COULDNTWRITE)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_COULDNTWRITE))->Execute(); } return bDone; diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 530d0fc26c5c..987c1aa65ae8 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -67,7 +67,7 @@ void Organize( sal_Int16 tabId ) aDesc = pCurWin->CreateEntryDescriptor(); vcl::Window* pParent = Application::GetDefDialogParent(); - OrganizeDialog(pParent, tabId, aDesc).Execute(); + ScopedVclPtrInstance<OrganizeDialog>::Create(pParent, tabId, aDesc)->Execute(); } bool IsValidSbxName( const OUString& rName ) @@ -331,7 +331,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument, { // error bError = true; - MessageDialog(NULL, IDEResId(RID_STR_ERRORCHOOSEMACRO)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(nullptr, IDEResId(RID_STR_ERRORCHOOSEMACRO))->Execute(); } } } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 5fc8268a77ec..77febec71f3a 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -558,7 +558,7 @@ TabBarAllowRenamingReturnCode TabBar::AllowRenaming() bool const bValid = IsValidSbxName(GetEditText()); if ( !bValid ) - MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute(); return bValid ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO; } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 7dbd9836d6e7..23e2597c413f 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -632,7 +632,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) ); if ( aDocument.isDocument() && !aDocument.allowMacros() ) { - MessageDialog(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute(); return 0; } } @@ -641,7 +641,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) { if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) ) { - MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute(); m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) ); m_pMacroNameEdit->GrabFocus(); return 0; @@ -709,7 +709,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) { if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) ) { - MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute(); m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) ); m_pMacroNameEdit->GrabFocus(); return 1; diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 68499f3ca18a..70c4f583d4cc 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -269,7 +269,7 @@ bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) OUString aLibName = GetEntryText( pEntry, 0 ); if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB))->Execute(); return false; } @@ -279,7 +279,7 @@ bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) || ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_LIBISREADONLY)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_LIBISREADONLY))->Execute(); return false; } @@ -329,7 +329,7 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName ) } catch (const container::ElementExistException& ) { - MessageDialog(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED))->Execute(); return false; } catch (const container::NoSuchElementException& ) @@ -342,9 +342,9 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName ) if ( !bValid ) { if ( rNewName.getLength() > 30 ) - MessageDialog(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG))->Execute(); else - MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute(); } return bValid; @@ -357,7 +357,7 @@ IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler) EndDialog(1); else { - MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute(); m_pEdit->GrabFocus(); } return 0; @@ -854,7 +854,7 @@ void LibPage::InsertLib() } if ( !pLibDlg ) - MessageDialog(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO)->Execute(); else { bool bChanges = false; @@ -891,7 +891,7 @@ void LibPage::InsertLib() // check, if the library is the Standard library if ( aLibName == "Standard" ) { - MessageDialog(this, IDE_RESSTR(RID_STR_REPLACESTDLIB)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_REPLACESTDLIB))->Execute(); continue; } @@ -903,7 +903,7 @@ void LibPage::InsertLib() aErrStr = aErrStr.replaceAll("XX", aLibName); aErrStr += "\n"; aErrStr += IDE_RESSTR(RID_STR_LIBISREADONLY); - MessageDialog(this, aErrStr).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute(); continue; } @@ -920,7 +920,7 @@ void LibPage::InsertLib() aErrStr = aErrStr.replaceAll("XX", aLibName); aErrStr += "\n" ; aErrStr += IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED); - MessageDialog(this, aErrStr).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute(); continue; } } @@ -939,7 +939,7 @@ void LibPage::InsertLib() { OUString aErrStr( IDE_RESSTR(RID_STR_NOIMPORT) ); aErrStr = aErrStr.replaceAll("XX", aLibName); - MessageDialog(this, aErrStr).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute(); continue; } } @@ -1513,15 +1513,15 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument, if ( aLibName.getLength() > 30 ) { - MessageDialog(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString()).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString())->Execute(); } else if ( !IsValidSbxName( aLibName ) ) { - MessageDialog(pWin, IDEResId(RID_STR_BADSBXNAME).toString()).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_BADSBXNAME).toString())->Execute(); } else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) ) { - MessageDialog(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString()).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString())->Execute(); } else { diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 504545e2dc70..0da8cdb3d640 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -91,7 +91,7 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT { if ( !IsValidSbxName(rNewText) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute(); return false; } @@ -835,7 +835,7 @@ void ObjectPage::NewDialog() if ( aDocument.hasDialog( aLibName, aDlgName ) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute(); } else { @@ -1047,7 +1047,7 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument, } catch (const container::ElementExistException& ) { - MessageDialog(pWin, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)).Execute(); + ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute(); } catch (const container::NoSuchElementException& ) { |