[Libreoffice-commits] core.git: Branch 'feature/vclref' - 2 commits - sfx2/source vcl/source

2015-03-17 Thread Michael Meeks
 sfx2/source/toolbox/tbxitem.cxx |4 ++--
 vcl/source/control/combobox.cxx |6 +++---
 vcl/source/control/ilstbox.cxx  |1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit d007a2e161e640f2d5d6205c0bb952042f608140
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Mar 17 17:45:07 2015 +

fix explicit delete.

Change-Id: I6d12eb32e9c8fcb403473c41b3a6eb2f29fe8639

diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index c73547e..7921069 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -274,9 +274,9 @@ void SAL_CALL SfxToolBoxControl::dispose() throw 
(::com::sun::star::uno::Runtime
 
 // Remove and destroy our item window at our toolbox
 SolarMutexGuard aGuard;
-vcl::Window* pWindow = pImpl-pBox-GetItemWindow( pImpl-nTbxId );
+VclPtr vcl::Window  pWindow = pImpl-pBox-GetItemWindow( pImpl-nTbxId 
);
 pImpl-pBox-SetItemWindow( pImpl-nTbxId, 0 );
-delete pWindow;
+pWindow.disposeAndClear();
 
 // Dispose an open sub toolbar. It's possible that we have an open
 // sub toolbar while we get disposed. Therefore we have to dispose
commit bd21b01f4fc603ed6508d4c8268d7aaf4dcc5952
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Mar 17 16:58:15 2015 +

fix ilistbox dispose.

Change-Id: Icc5b6e924dfeec7a7da4f654d79b17fe91ce1418

diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index f1724dc..6d4b9f7 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -75,9 +75,9 @@ void ComboBox::dispose()
 {
 mpSubEdit.disposeAndClear();
 
-ImplListBox *pImplLB = mpImplLB;
-mpImplLB = NULL;
-delete pImplLB;
+VclPtr ImplListBox  pImplLB = mpImplLB;
+mpImplLB.clear();
+pImplLB.disposeAndClear();
 
 mpFloatWin.disposeAndClear();
 mpBtn.disposeAndClear();
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index d32a4ec..ae8df9f 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2172,7 +2172,6 @@ void ImplListBox::dispose()
 mpHScrollBar.disposeAndClear();
 mpVScrollBar.disposeAndClear();
 mpScrollBarBox.disposeAndClear();
-maLBWindow.clear();
 maLBWindow.disposeAndClear();
 Control::dispose();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/vclref' - 2 commits - sfx2/source vcl/source

2015-03-13 Thread Michael Meeks
 sfx2/source/appl/workwin.cxx |   11 +--
 sfx2/source/inc/workwin.hxx  |2 +-
 vcl/source/window/window.cxx |7 +++
 3 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 392f77ca7547d104b08cd4ded6a6b3ccfab6066b
Author: Michael Meeks michael.me...@collabora.com
Date:   Fri Mar 13 22:20:44 2015 +

add some more helpful paranoia to disposeOnce.

Change-Id: I46f2bf5115f2b80990fdcac75bd31615c4221b9e

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ad74ba0..423dd0e 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -142,6 +142,13 @@ void Window::disposeOnce()
 if (!mpWindowImpl || mpWindowImpl-mbInDispose)
 return;
 mpWindowImpl-mbInDispose = true;
+
+// catch badness where our Window was not wrapped safely
+// in a VclPtr cosily.
+assert( mnRefCnt0 );
+
+// hold a ref in case something silly happens during dispose.
+VclPtrWindow aRef(this);
 dispose();
 }
 
commit 539d89b9b3f15f1cb284e401ed7d921364464140
Author: Michael Meeks michael.me...@collabora.com
Date:   Fri Mar 13 22:20:21 2015 +

convert a problematic array to VclPtr.

Change-Id: Ia8b6984a8a9bdf6f32cf5ebfc971a6921796eece

diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index e7246b6..cbe39da 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -606,7 +606,6 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, 
SfxBindings rB, SfxWorkWindow*
 m_aTbxTypeName( private:resource/toolbar/ ),
 m_aProgressBarResName( private:resource/progressbar/progressbar )
 {
-memset(pSplit, 0, sizeof(pSplit));
 DBG_ASSERT (pBindings, No Bindings!);
 
 pBindings-SetWorkWindow_Impl( this );
@@ -633,10 +632,10 @@ SfxWorkWindow::~SfxWorkWindow()
 // Delete SplitWindows
 for ( sal_uInt16 n=0; nSFX_SPLITWINDOWS_MAX; n++ )
 {
-SfxSplitWindow *p = pSplit[n];
+VclPtrSfxSplitWindow p = pSplit[n];
 if (p-GetWindowCount())
 ReleaseChild_Impl(*p);
-delete p;
+pSplit[n].disposeAndClear();
 }
 
 // Delete help structure for Child-Windows
@@ -677,8 +676,8 @@ void SfxWorkWindow::DeleteControllers_Impl()
 for ( n=0; nSFX_SPLITWINDOWS_MAX; n++ )
 {
 SfxSplitWindow *p = pSplit[n];
-   if (p-GetWindowCount())
-p-Lock();
+if (p-GetWindowCount())
+p-Lock();
 }
 
 // Delete Child-Windows
@@ -2534,7 +2533,7 @@ bool SfxWorkWindow::IsAutoHideMode( const SfxSplitWindow 
*pSplitWin )
 {
 for ( sal_uInt16 n=0; nSFX_SPLITWINDOWS_MAX; n++ )
 {
-if ( pSplit[n] != pSplitWin  pSplit[n]-IsAutoHide( true ) )
+if ( pSplit[n].get() != pSplitWin  pSplit[n]-IsAutoHide( true ) )
 return true;
 }
 return false;
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index f222f11..2ed93bc 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -215,7 +215,7 @@ protected:
 Rectangle   aClientArea;
 Rectangle   aUpperClientArea;
 SfxWorkWindow*  pParent;
-SfxSplitWindow* pSplit[SFX_SPLITWINDOWS_MAX];
+VclPtrSfxSplitWindow  pSplit[SFX_SPLITWINDOWS_MAX];
 SfxChildList_Impl   aChildren;
 SfxChildWindows_ImplaChildWins;
 SfxBindings*pBindings;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits