summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-20 15:56:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-23 06:28:00 +0000
commitaa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3 (patch)
tree8b2a5207e77fa4054a37b33c25378c23a00af8ed /basctl
parentb722f3d6fc72877e8caaaae7291d5d736ddc494d (diff)
tdf#97527 - vcl: reference-count Menu
some places are marked with "dodgy"- need to check those to see what is going on, because they are leaving dangling pointers behind in the Menu class Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b Reviewed-on: https://gerrit.libreoffice.org/26516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2b.cxx10
-rw-r--r--basctl/source/basicide/bastypes.cxx28
2 files changed, 19 insertions, 19 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index d1159c878b03..b33e9bd4a771 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1479,9 +1479,9 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
if ( pBrk )
{
// test if break point is enabled...
- PopupMenu aBrkPropMenu( IDEResId( RID_POPUP_BRKPROPS ) );
- aBrkPropMenu.CheckItem( RID_ACTIV, pBrk->bEnabled );
- switch ( aBrkPropMenu.Execute( this, aPos ) )
+ ScopedVclPtrInstance<PopupMenu> aBrkPropMenu( IDEResId( RID_POPUP_BRKPROPS ) );
+ aBrkPropMenu->CheckItem( RID_ACTIV, pBrk->bEnabled );
+ switch ( aBrkPropMenu->Execute( this, aPos ) )
{
case RID_ACTIV:
{
@@ -1502,8 +1502,8 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
}
else
{
- PopupMenu aBrkListMenu( IDEResId( RID_POPUP_BRKDLG ) );
- switch ( aBrkListMenu.Execute( this, aPos ) )
+ ScopedVclPtrInstance<PopupMenu> aBrkListMenu( IDEResId( RID_POPUP_BRKDLG ) );
+ switch ( aBrkListMenu->Execute( this, aPos ) )
{
case RID_BRKDLG:
{
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 1aefb7571677..88c1e9d23801 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -480,19 +480,19 @@ void TabBar::Command( const CommandEvent& rCEvt )
::TabBar::MouseButtonDown( aMouseEvent ); // base class
}
- PopupMenu aPopup( IDEResId( RID_POPUP_TABBAR ) );
+ ScopedVclPtrInstance<PopupMenu> aPopup( IDEResId( RID_POPUP_TABBAR ) );
if ( GetPageCount() == 0 )
{
- aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_RENAMECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_HIDECURPAGE, false);
+ aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_HIDECURPAGE, false);
}
if ( StarBASIC::IsRunning() )
{
- aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_RENAMECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_MODULEDLG, false);
+ aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_MODULEDLG, false);
}
if (Shell* pShell = GetShell())
@@ -504,10 +504,10 @@ void TabBar::Command( const CommandEvent& rCEvt )
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) ||
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryReadOnly( aOULibName ) ) )
{
- aPopup.EnableItem(aPopup.GetItemId( 0 ), false);
- aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_RENAMECURRENT, false);
- aPopup.RemoveDisabledEntries();
+ aPopup->EnableItem(aPopup->GetItemId( 0 ), false);
+ aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false);
+ aPopup->RemoveDisabledEntries();
}
if ( aDocument.isInVBAMode() )
{
@@ -523,8 +523,8 @@ void TabBar::Command( const CommandEvent& rCEvt )
SbModule* pActiveModule = pBasic->FindModule( it->second->GetName() );
if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
{
- aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, false);
- aPopup.EnableItem(SID_BASICIDE_RENAMECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false);
+ aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false);
}
}
}
@@ -532,7 +532,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
}
}
if (SfxDispatcher* pDispatcher = GetDispatcher())
- pDispatcher->Execute(aPopup.Execute(this, aPos));
+ pDispatcher->Execute(aPopup->Execute(this, aPos));
}
}