summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/bastypes.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide/bastypes.cxx')
-rw-r--r--basctl/source/basicide/bastypes.cxx39
1 files changed, 29 insertions, 10 deletions
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 854621f0adda..6efa5cb29a19 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -56,10 +56,18 @@ BaseWindow::BaseWindow( vcl::Window* pParent, const ScriptDocument& rDocument, c
BaseWindow::~BaseWindow()
{
+ disposeOnce();
+}
+
+void BaseWindow::dispose()
+{
if ( pShellVScrollBar )
pShellVScrollBar->SetScrollHdl( Link() );
if ( pShellHScrollBar )
pShellHScrollBar->SetScrollHdl( Link() );
+ pShellVScrollBar.clear();
+ pShellHScrollBar.clear();
+ vcl::Window::dispose();
}
@@ -274,6 +282,17 @@ DockingWindow::DockingWindow (Layout* pParent) :
nShowCount(0)
{ }
+DockingWindow::~DockingWindow()
+{
+ disposeOnce();
+}
+
+void DockingWindow::dispose()
+{
+ pLayout.clear();
+ ::DockingWindow::dispose();
+}
+
// Sets the position and the size of the docking window. This property is saved
// when the window is floating. Called by Layout.
void DockingWindow::ResizeIfDocking (Point const& rPos, Size const& rSize)
@@ -521,7 +540,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
{
Shell::WindowTable& aWindowTable = pShell->GetWindowTable();
Shell::WindowTableIt it = aWindowTable.find( GetCurPageId() );
- if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second))
+ if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second.get()))
{
SbModule* pActiveModule = pBasic->FindModule( it->second->GetName() );
if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
@@ -785,8 +804,8 @@ bool QueryDel( const OUString& rName, const ResId& rId, vcl::Window* pParent )
aNameBuf.append('\'');
aNameBuf.insert(0, '\'');
aQuery = aQuery.replaceAll("XX", aNameBuf.makeStringAndClear());
- MessageDialog aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- return ( aQueryBox.Execute() == RET_YES );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ return ( aQueryBox->Execute() == RET_YES );
}
bool QueryDelMacro( const OUString& rName, vcl::Window* pParent )
@@ -822,19 +841,19 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
do
{
// password dialog
- SfxPasswordDialog aDlg(Application::GetDefDialogParent());
- aDlg.SetMinLen( 1 );
+ ScopedVclPtrInstance< SfxPasswordDialog > aDlg(Application::GetDefDialogParent());
+ aDlg->SetMinLen( 1 );
// set new title
if ( bNewTitle )
{
OUString aTitle(IDE_RESSTR(RID_STR_ENTERPASSWORD));
aTitle = aTitle.replaceAll("XX", rLibName);
- aDlg.SetText( aTitle );
+ aDlg->SetText( aTitle );
}
// execute dialog
- nRet = aDlg.Execute();
+ nRet = aDlg->Execute();
// verify password
if ( nRet == RET_OK )
@@ -844,14 +863,14 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY );
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( rLibName ) && !xPasswd->isLibraryPasswordVerified( rLibName ) )
{
- rPassword = aDlg.GetPassword();
+ rPassword = aDlg->GetPassword();
// OUString aOUPassword( rPassword );
bOK = xPasswd->verifyLibraryPassword( rLibName, rPassword );
if ( !bOK )
{
- MessageDialog aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
+ aErrorBox->Execute();
}
}
}