basctl/source/basicide/baside3.cxx | 2 +- basctl/source/basicide/basides1.cxx | 12 ++++++------ basctl/source/basicide/basides2.cxx | 8 ++++---- basctl/source/basicide/basides3.cxx | 6 +++--- basctl/source/basicide/basidesh.cxx | 11 ++++++++++- basctl/source/basicide/layout.cxx | 8 ++++++++ basctl/source/basicide/layout.hxx | 1 + basctl/source/inc/basidesh.hxx | 16 ++++++++-------- 8 files changed, 41 insertions(+), 23 deletions(-)
New commits: commit 33414c8bf7a4eb8fa912bc0062237637a8e05be2 Author: Michael Meeks <michael.me...@collabora.com> Date: Fri May 15 19:03:44 2015 +0100 tdf#91239 - return VclPtr's from Create Fn.s and add missing dispose logic. Change-Id: I802b841040f608b5586704745cc9817603fb1879 diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 3d7587a..6ccdcab 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -1200,7 +1200,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP ); if( bSuccess ) { - DialogWindow* pNewDlgWin = pShell->CreateDlgWin( rDocument, aLibName, aNewDlgName ); + VclPtr<DialogWindow> pNewDlgWin = pShell->CreateDlgWin( rDocument, aLibName, aNewDlgName ); pShell->SetCurWindow( pNewDlgWin, true ); } diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 1013be9..f99f7bb 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -485,14 +485,14 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) break; case SID_BASICIDE_NEWMODULE: { - ModulWindow* pWin = CreateBasWin( m_aCurDocument, m_aCurLibName, OUString() ); + VclPtr<ModulWindow> pWin = CreateBasWin( m_aCurDocument, m_aCurLibName, OUString() ); DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" ); SetCurWindow( pWin, true ); } break; case SID_BASICIDE_NEWDIALOG: { - DialogWindow* pWin = CreateDlgWin( m_aCurDocument, m_aCurLibName, OUString() ); + VclPtr<DialogWindow> pWin = CreateDlgWin( m_aCurDocument, m_aCurLibName, OUString() ); DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" ); SetCurWindow( pWin, true ); } @@ -1088,12 +1088,12 @@ void Shell::ManageToolbars() } } -BaseWindow* Shell::FindApplicationWindow() +VclPtr<BaseWindow> Shell::FindApplicationWindow() { return FindWindow( ScriptDocument::getApplicationScriptDocument() ); } -BaseWindow* Shell::FindWindow( +VclPtr<BaseWindow> Shell::FindWindow( ScriptDocument const& rDocument, OUString const& rLibName, OUString const& rName, ItemType eType, bool bFindSuspended @@ -1147,7 +1147,7 @@ long Shell::CallBasicBreakHdl( StarBASIC* pBasic ) return nRet; } -ModulWindow* Shell::ShowActiveModuleWindow( StarBASIC* pBasic ) +VclPtr<ModulWindow> Shell::ShowActiveModuleWindow( StarBASIC* pBasic ) { SetCurLib( ScriptDocument::getApplicationScriptDocument(), OUString(), false ); @@ -1158,7 +1158,7 @@ ModulWindow* Shell::ShowActiveModuleWindow( StarBASIC* pBasic ) DBG_ASSERT( pActiveModule, "Kein aktives Modul im ErrorHdl?!" ); if ( pActiveModule ) { - ModulWindow* pWin = 0; + VclPtr<ModulWindow> pWin; SbxObject* pParent = pActiveModule->GetParent(); if (StarBASIC* pLib = dynamic_cast<StarBASIC*>(pParent)) { diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx index e05869a..cfe05b3 100644 --- a/basctl/source/basicide/basides2.cxx +++ b/basctl/source/basicide/basides2.cxx @@ -129,12 +129,12 @@ void Shell::SetMDITitle() } } -ModulWindow* Shell::CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName ) +VclPtr<ModulWindow> Shell::CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName ) { bCreatingWindow = true; sal_uLong nKey = 0; - ModulWindow* pWin = 0; + VclPtr<ModulWindow> pWin; OUString aLibName( rLibName ); OUString aModName( rModName ); @@ -203,14 +203,14 @@ ModulWindow* Shell::CreateBasWin( const ScriptDocument& rDocument, const OUStrin return pWin; } -ModulWindow* Shell::FindBasWin ( +VclPtr<ModulWindow> Shell::FindBasWin ( ScriptDocument const& rDocument, OUString const& rLibName, OUString const& rName, bool bCreateIfNotExist, bool bFindSuspended ) { if (BaseWindow* pWin = FindWindow(rDocument, rLibName, rName, TYPE_MODULE, bFindSuspended)) - return static_cast<ModulWindow*>(pWin); + return VclPtr<ModulWindow>(static_cast<ModulWindow*>(pWin)); return bCreateIfNotExist ? CreateBasWin(rDocument, rLibName, rName) : 0; } diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx index 8479fd8..cd84dd4 100644 --- a/basctl/source/basicide/basides3.cxx +++ b/basctl/source/basicide/basides3.cxx @@ -35,12 +35,12 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; -DialogWindow* Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName ) +VclPtr<DialogWindow> Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName ) { bCreatingWindow = true; sal_uLong nKey = 0; - DialogWindow* pWin = 0; + VclPtr<DialogWindow> pWin; OUString aLibName( rLibName ); OUString aDlgName( rDlgName ); @@ -107,7 +107,7 @@ DialogWindow* Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUStri return pWin; } -DialogWindow* Shell::FindDlgWin ( +VclPtr<DialogWindow> Shell::FindDlgWin ( ScriptDocument const& rDocument, OUString const& rLibName, OUString const& rName, bool bCreateIfNotExist, bool bFindSuspended diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 1cd01cd..b427e2c 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -225,7 +225,6 @@ Shell::~Shell() SetWindow( 0 ); SetCurWindow( 0 ); - pTabBar.disposeAndClear(); aObjectCatalog.disposeAndClear(); aScrollBarBox.disposeAndClear(); aVScrollBar.disposeAndClear(); @@ -247,6 +246,10 @@ Shell::~Shell() GetExtraData()->ShellInCriticalSection() = false; nShellCount--; + + pDialogLayout.disposeAndClear(); + pModulLayout.disposeAndClear(); + pTabBar.disposeAndClear(); } void Shell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ ) @@ -761,7 +764,7 @@ void Shell::UpdateWindows() OUString aDlgName = pDlgNames[ j ]; // this find only looks for non-suspended windows; // suspended windows are handled in CreateDlgWin - DialogWindow* pWin = FindDlgWin( *doc, aLibName, aDlgName, false ); + VclPtr<DialogWindow> pWin = FindDlgWin( *doc, aLibName, aDlgName, false ); if ( !pWin ) pWin = CreateDlgWin( *doc, aLibName, aDlgName ); if ( !pNextActiveWindow && pLibInfoItem && pLibInfoItem->GetCurrentName() == aDlgName && diff --git a/basctl/source/basicide/layout.cxx b/basctl/source/basicide/layout.cxx index 2bca3ce..a42c99c 100644 --- a/basctl/source/basicide/layout.cxx +++ b/basctl/source/basicide/layout.cxx @@ -60,6 +60,8 @@ Layout::~Layout() void Layout::dispose() { + aLeftSide.dispose(); + aBottomSide.dispose(); pChild.clear(); Window::dispose(); } @@ -178,6 +180,12 @@ Layout::SplittedSide::SplittedSide (Layout* pParent, Side eSide) : InitSplitter(*aSplitter.get()); } +void Layout::SplittedSide::dispose() +{ + aSplitter.disposeAndClear(); + for (auto i = vItems.begin(); i != vItems.end(); ++i) + i->pSplit.disposeAndClear(); +} // Add() -- adds a new window to the side (after construction) void Layout::SplittedSide::Add (DockingWindow* pWin, Size const& rSize) diff --git a/basctl/source/basicide/layout.hxx b/basctl/source/basicide/layout.hxx index e25cb11..51e2ffd 100644 --- a/basctl/source/basicide/layout.hxx +++ b/basctl/source/basicide/layout.hxx @@ -86,6 +86,7 @@ private: bool IsEmpty () const; long GetSize () const; void ArrangeIn (Rectangle const&); + void dispose(); private: // the layout window diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index 3ae9b5b..a3794b9 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -120,10 +120,10 @@ private: void ManageToolbars(); void ArrangeTabBar(); - ModulWindow* CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName ); - DialogWindow* CreateDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName ); + VclPtr<ModulWindow> CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName ); + VclPtr<DialogWindow> CreateDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName ); - ModulWindow* ShowActiveModuleWindow( StarBASIC* pBasic ); + VclPtr<ModulWindow> ShowActiveModuleWindow( StarBASIC* pBasic ); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ) SAL_OVERRIDE; @@ -193,11 +193,11 @@ public: bool CallBasicErrorHdl( StarBASIC* pBasic ); long CallBasicBreakHdl( StarBASIC* pBasic ); - BaseWindow* FindWindow( const ScriptDocument& rDocument, const OUString& rLibName = OUString(), const OUString& rName = OUString(), ItemType nType = TYPE_UNKNOWN, bool bFindSuspended = false ); - DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, bool bCreateIfNotExist = false, bool bFindSuspended = false ); - ModulWindow* FindBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, bool bCreateIfNotExist = false, bool bFindSuspended = false ); - BaseWindow* FindApplicationWindow(); - bool NextPage( bool bPrev = false ); + VclPtr<BaseWindow> FindWindow( const ScriptDocument& rDocument, const OUString& rLibName = OUString(), const OUString& rName = OUString(), ItemType nType = TYPE_UNKNOWN, bool bFindSuspended = false ); + VclPtr<DialogWindow> FindDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, bool bCreateIfNotExist = false, bool bFindSuspended = false ); + VclPtr<ModulWindow> FindBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, bool bCreateIfNotExist = false, bool bFindSuspended = false ); + VclPtr<BaseWindow> FindApplicationWindow(); + bool NextPage( bool bPrev = false ); bool IsAppBasicModified () const { return m_bAppBasicModified; } void SetAppBasicModified (bool bModified = true) { m_bAppBasicModified = bModified; } commit 72e6c70738a8c78f824319ec2bbf864e9997806b Author: Julien Nabet <serval2...@yahoo.fr> Date: Fri May 15 18:05:08 2015 +0100 tdf#91239 - add missing disposeAndClear logic for basctl. Change-Id: If5c8fbf453e47921b472a987e9e6cff283464dcf diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 1c01f29..1cd01cd 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -225,6 +225,12 @@ Shell::~Shell() SetWindow( 0 ); SetCurWindow( 0 ); + pTabBar.disposeAndClear(); + aObjectCatalog.disposeAndClear(); + aScrollBarBox.disposeAndClear(); + aVScrollBar.disposeAndClear(); + aHScrollBar.disposeAndClear(); + for (WindowTable::iterator it = aWindowTable.begin(); it != aWindowTable.end(); ++it) { // no store; does already happen when the BasicManagers are destroyed _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits