summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/moduldlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-03 17:53:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-04 16:27:12 +0100
commitf705047867c30cbcdf45fae2e035b304c42ce336 (patch)
treef4b139c97214170bab0fea2c5121b5168ea17e86 /basctl/source/basicide/moduldlg.cxx
parentc7bb99964bc29f146a8bc7f27f21a3b62a197b2d (diff)
weld new library dialog
Change-Id: I86c70a01e45a7e9f80c19f9a9b0e6307830ba722 Reviewed-on: https://gerrit.libreoffice.org/50685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl/source/basicide/moduldlg.cxx')
-rw-r--r--basctl/source/basicide/moduldlg.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index d0abbe481951..68c4b1b7526a 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -802,8 +802,8 @@ void ObjectPage::NewModule()
if ( GetSelection( aDocument, aLibName ) )
{
- createModImpl( static_cast<vcl::Window*>( this ), aDocument,
- *m_pBasicBox, aLibName, OUString(), true );
+ createModImpl(GetFrameWeld(), aDocument,
+ *m_pBasicBox, aLibName, OUString(), true);
}
}
@@ -816,12 +816,12 @@ void ObjectPage::NewDialog()
{
aDocument.getOrCreateLibrary( E_DIALOGS, aLibName );
- ScopedVclPtrInstance< NewObjectDialog > aNewDlg(this, ObjectMode::Dialog, true);
- aNewDlg->SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
+ NewObjectDialog aNewDlg(GetFrameWeld(), ObjectMode::Dialog, true);
+ aNewDlg.SetObjectName(aDocument.createObjectName(E_DIALOGS, aLibName));
- if (aNewDlg->Execute() != 0)
+ if (aNewDlg.run() != RET_CANCEL)
{
- OUString aDlgName = aNewDlg->GetObjectName();
+ OUString aDlgName = aNewDlg.GetObjectName();
if (aDlgName.isEmpty())
aDlgName = aDocument.createObjectName( E_DIALOGS, aLibName);
@@ -959,7 +959,7 @@ void LibDialog::SetStorageName( const OUString& rName )
}
// Helper function
-SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
+SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument,
TreeListBox& rBasicBox, const OUString& rLibName, const OUString& _aModName, bool bMain )
{
OSL_ENSURE( rDocument.isAlive(), "createModImpl: invalid document!" );
@@ -976,13 +976,13 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
if ( aModName.isEmpty() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
- ScopedVclPtrInstance< NewObjectDialog > aNewDlg(pWin, ObjectMode::Module, true);
- aNewDlg->SetObjectName( aModName );
+ NewObjectDialog aNewDlg(pWin, ObjectMode::Module, true);
+ aNewDlg.SetObjectName(aModName);
- if (aNewDlg->Execute() != 0)
+ if (aNewDlg.run() != RET_CANCEL)
{
- if (!aNewDlg->GetObjectName().isEmpty() )
- aModName = aNewDlg->GetObjectName();
+ if (!aNewDlg.GetObjectName().isEmpty())
+ aModName = aNewDlg.GetObjectName();
try
{
@@ -1043,7 +1043,7 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
}
catch (const container::ElementExistException& )
{
- std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pWin,
VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
xError->run();
}