summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-26 10:21:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-03 09:47:42 +0000
commit0b21f434b45c350cd9cc5b820226245d6824bf86 (patch)
tree2db24f59783e6a91bee55fb2cd75421836f6dd60 /basctl
parentc4c30cfac570aeb0f8ac91b36b986e438e2811bc (diff)
masses of MessBoxes not being disposed promptly
since... commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f Date: Thu May 28 21:35:43 2015 +0100 tdf#91702 - fix stack-based MessBox allocation. There is no special ScopedVclPtr<X>::Create or ScopedVclPtrInstance<X>::Create just VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo doesn't call dispose on the owned X (cherry picked from commit a860df25dd7bf62ecb6b3d3ed38803b981f56d52) Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f Reviewed-on: https://gerrit.libreoffice.org/27537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx6
-rw-r--r--basctl/source/basicide/baside2b.cxx2
-rw-r--r--basctl/source/basicide/baside3.cxx2
-rw-r--r--basctl/source/basicide/basides1.cxx6
-rw-r--r--basctl/source/basicide/basidesh.cxx2
-rw-r--r--basctl/source/basicide/basobj2.cxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx2
-rw-r--r--basctl/source/basicide/macrodlg.cxx6
-rw-r--r--basctl/source/basicide/moduldl2.cxx28
-rw-r--r--basctl/source/basicide/moduldlg.cxx6
10 files changed, 32 insertions, 32 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index a245c400478b..6d3e34f874d0 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -304,7 +304,7 @@ void ModulWindow::BasicExecute()
{
if ( !aDocument.allowMacros() )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute();
return;
}
}
@@ -434,7 +434,7 @@ void ModulWindow::LoadBasic()
ErrorHandler::HandleError( nError );
}
else
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_COULDNTREAD))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_COULDNTREAD))->Execute();
}
}
@@ -475,7 +475,7 @@ void ModulWindow::SaveBasicSource()
ErrorHandler::HandleError( nError );
}
else
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_COULDNTWRITE))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_COULDNTWRITE))->Execute();
}
}
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index c8bc435a4c6f..44f3b64786d9 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -481,7 +481,7 @@ bool EditorWindow::ImpCanModify()
{
// If in Trace-mode, abort the trace or refuse input
// Remove markers in the modules in Notify at Basic::Stoped
- if ( ScopedVclPtr<QueryBox>::Create( nullptr, WB_OK_CANCEL, IDEResId(RID_STR_WILLSTOPPRG).toString() )->Execute() == RET_OK )
+ if (ScopedVclPtrInstance<QueryBox>(nullptr, WB_OK_CANCEL, IDEResId(RID_STR_WILLSTOPPRG).toString())->Execute() == RET_OK)
{
rModulWindow.GetBasicStatus().bIsRunning = false;
StopBasic();
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 5fe34036f3be..185dba446794 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -827,7 +827,7 @@ void DialogWindow::SaveDialog()
}
}
else
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_COULDNTWRITE))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_COULDNTWRITE))->Execute();
}
}
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 8dee9c81913b..c8d9fa669c9e 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -97,7 +97,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
nActModWindows++;
}
- if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtr<QueryBox>::Create( pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES).toString() )->Execute() == RET_YES ) )
+ if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtrInstance<QueryBox>(pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES).toString())->Execute() == RET_YES ) )
{
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
@@ -110,7 +110,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
OUString aReplStr(IDE_RESSTR(RID_STR_SEARCHREPLACES));
aReplStr = aReplStr.replaceAll("XX", OUString::number(nFound));
- ScopedVclPtr<InfoBox>::Create( pCurWin, aReplStr )->Execute();
+ ScopedVclPtrInstance<InfoBox>(pCurWin, aReplStr)->Execute();
}
else
{
@@ -177,7 +177,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
SetCurWindow( pWin, true );
}
if ( !nFound && !bCanceled )
- ScopedVclPtr<InfoBox>::Create( pCurWin, IDEResId(RID_STR_SEARCHNOTFOUND).toString() )->Execute();
+ ScopedVclPtrInstance<InfoBox>(pCurWin, IDEResId(RID_STR_SEARCHNOTFOUND).toString())->Execute();
}
rReq.Done();
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 7619e5635765..66c7be6c17db 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -383,7 +383,7 @@ bool Shell::PrepareClose( bool bUI )
if( bUI )
{
vcl::Window *pParent = &GetViewFrame()->GetWindow();
- ScopedVclPtr<InfoBox>::Create( pParent, IDE_RESSTR(RID_STR_CANNOTCLOSE))->Execute();
+ ScopedVclPtrInstance<InfoBox>(pParent, IDE_RESSTR(RID_STR_CANNOTCLOSE))->Execute();
}
return false;
}
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 29d9824b1a5f..f903fcbea48b 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -69,7 +69,7 @@ void Organize( sal_Int16 tabId )
aDesc = pCurWin->CreateEntryDescriptor();
vcl::Window* pParent = Application::GetDefDialogParent();
- ScopedVclPtrInstance<OrganizeDialog>::Create(pParent, tabId, aDesc)->Execute();
+ ScopedVclPtrInstance<OrganizeDialog>(pParent, tabId, aDesc)->Execute();
}
bool IsValidSbxName( const OUString& rName )
@@ -329,7 +329,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
{
// error
bError = true;
- ScopedVclPtrInstance<MessageDialog>::Create(nullptr, IDEResId(RID_STR_ERRORCHOOSEMACRO))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(nullptr, IDEResId(RID_STR_ERRORCHOOSEMACRO))->Execute();
}
}
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index d0ab4a3c0658..0e6fd56efd51 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -541,7 +541,7 @@ TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
bool const bValid = IsValidSbxName(GetEditText());
if ( !bValid )
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(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 505192801b07..35dd1818dfbf 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -613,7 +613,7 @@ IMPL_LINK_TYPED( MacroChooser, ButtonHdl, Button *, pButton, void )
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
if ( aDocument.isDocument() && !aDocument.allowMacros() )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute();
return;
}
}
@@ -622,7 +622,7 @@ IMPL_LINK_TYPED( MacroChooser, ButtonHdl, Button *, pButton, void )
{
if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
m_pMacroNameEdit->GrabFocus();
return;
@@ -695,7 +695,7 @@ IMPL_LINK_TYPED( MacroChooser, ButtonHdl, Button *, pButton, void )
{
if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
m_pMacroNameEdit->GrabFocus();
return;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index e5773252edb9..97d2690bdf7b 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -271,7 +271,7 @@ bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
OUString aLibName = GetEntryText( pEntry, 0 );
if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB))->Execute();
return false;
}
@@ -281,7 +281,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 ) ) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_LIBISREADONLY))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_LIBISREADONLY))->Execute();
return false;
}
@@ -331,7 +331,7 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName )
}
catch (const container::ElementExistException& )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED))->Execute();
return false;
}
catch (const container::NoSuchElementException& )
@@ -344,9 +344,9 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName )
if ( !bValid )
{
if ( rNewName.getLength() > 30 )
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG))->Execute();
else
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
}
return bValid;
@@ -359,7 +359,7 @@ IMPL_LINK_NOARG_TYPED(NewObjectDialog, OkButtonHandler, Button*, void)
EndDialog(1);
else
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
m_pEdit->GrabFocus();
}
}
@@ -847,7 +847,7 @@ void LibPage::InsertLib()
}
if ( !pLibDlg )
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO)->Execute();
else
{
bool bChanges = false;
@@ -884,7 +884,7 @@ void LibPage::InsertLib()
// check, if the library is the Standard library
if ( aLibName == "Standard" )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_REPLACESTDLIB))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_REPLACESTDLIB))->Execute();
continue;
}
@@ -896,7 +896,7 @@ void LibPage::InsertLib()
aErrStr = aErrStr.replaceAll("XX", aLibName);
aErrStr += "\n";
aErrStr += IDE_RESSTR(RID_STR_LIBISREADONLY);
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
continue;
}
@@ -913,7 +913,7 @@ void LibPage::InsertLib()
aErrStr = aErrStr.replaceAll("XX", aLibName);
aErrStr += "\n" ;
aErrStr += IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED);
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
continue;
}
}
@@ -932,7 +932,7 @@ void LibPage::InsertLib()
{
OUString aErrStr( IDE_RESSTR(RID_STR_NOIMPORT) );
aErrStr = aErrStr.replaceAll("XX", aLibName);
- ScopedVclPtrInstance<MessageDialog>::Create(this, aErrStr)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
continue;
}
}
@@ -1498,15 +1498,15 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
if ( aLibName.getLength() > 30 )
{
- ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString())->Execute();
+ ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString())->Execute();
}
else if ( !IsValidSbxName( aLibName ) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_BADSBXNAME).toString())->Execute();
+ ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_BADSBXNAME).toString())->Execute();
}
else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString())->Execute();
+ ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString())->Execute();
}
else
{
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index a1eafce59e58..cf4e55776bd2 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -92,7 +92,7 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT
{
if ( !IsValidSbxName(rNewText) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute();
return false;
}
@@ -828,7 +828,7 @@ void ObjectPage::NewDialog()
if ( aDocument.hasDialog( aLibName, aDlgName ) )
{
- ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
}
else
{
@@ -1043,7 +1043,7 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
}
catch (const container::ElementExistException& )
{
- ScopedVclPtrInstance<MessageDialog>::Create(pWin, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
+ ScopedVclPtrInstance<MessageDialog>(pWin, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
}
catch (const container::NoSuchElementException& )
{