[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - svtools/source vcl/source

2015-07-16 Thread Michael Meeks
 svtools/source/misc/dialogcontrolling.cxx |   18 ++
 vcl/source/window/event.cxx   |6 --
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit fe1e767e3397da41051a20ae6c80be5e123d07ba
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Jul 14 12:51:04 2015 +0100

tdf#92706 - avoid dbaccess wizard crash.

Hold a VclPtr on the window, make reset cleaner, and don't crash
removing listeners from disposed windows.

Change-Id: I3efb71117fc45562d5c740578f5e33dabb2684fe
Reviewed-on: https://gerrit.libreoffice.org/17038
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/svtools/source/misc/dialogcontrolling.cxx 
b/svtools/source/misc/dialogcontrolling.cxx
index b381c43..ca62804 100644
--- a/svtools/source/misc/dialogcontrolling.cxx
+++ b/svtools/source/misc/dialogcontrolling.cxx
@@ -49,13 +49,13 @@ namespace svt
 
 struct DialogController_Data
 {
-vcl::Window rInstigator;
-::std::vector VclPtrvcl::Window aConcernedWindows;
+VclPtrvcl::Window  xInstigator;
+::std::vector VclPtrvcl::Window  aConcernedWindows;
 PWindowEventFilter  pEventFilter;
 PWindowOperator pOperator;
 
-DialogController_Data( vcl::Window _rInstigator, const 
PWindowEventFilter _pEventFilter, const PWindowOperator _pOperator )
-:rInstigator( _rInstigator )
+DialogController_Data( vcl::Window _xInstigator, const 
PWindowEventFilter _pEventFilter, const PWindowOperator _pOperator )
+:xInstigator( _xInstigator )
 ,pEventFilter( _pEventFilter )
 ,pOperator( _pOperator )
 {
@@ -66,14 +66,14 @@ namespace svt
 //= DialogController
 
 
-DialogController::DialogController( vcl::Window _rInstigator, const 
PWindowEventFilter _pEventFilter,
+DialogController::DialogController( vcl::Window _xInstigator, const 
PWindowEventFilter _pEventFilter,
 const PWindowOperator _pOperator )
-:m_pImpl( new DialogController_Data( _rInstigator, _pEventFilter, 
_pOperator ) )
+:m_pImpl( new DialogController_Data( _xInstigator, _pEventFilter, 
_pOperator ) )
 {
 DBG_ASSERT( m_pImpl-pEventFilter.get()  m_pImpl-pOperator.get(),
 DialogController::DialogController: invalid filter and/or 
operator! );
 
-m_pImpl-rInstigator.AddEventListener( LINK( this, DialogController, 
OnWindowEvent ) );
+m_pImpl-xInstigator-AddEventListener( LINK( this, DialogController, 
OnWindowEvent ) );
 }
 
 
@@ -85,7 +85,9 @@ namespace svt
 
 void DialogController::reset()
 {
-m_pImpl-rInstigator.RemoveEventListener( LINK( this, 
DialogController, OnWindowEvent ) );
+if (m_pImpl-xInstigator)
+m_pImpl-xInstigator-RemoveEventListener( LINK( this, 
DialogController, OnWindowEvent ) );
+m_pImpl-xInstigator.clear();
 m_pImpl-aConcernedWindows.clear();
 m_pImpl-pEventFilter.reset();
 m_pImpl-pOperator.reset();
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 61c11ab..852cc0c 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -249,7 +249,8 @@ void Window::AddEventListener( const Link rEventListener 
)
 
 void Window::RemoveEventListener( const Link rEventListener )
 {
-mpWindowImpl-maEventListeners.removeListener( rEventListener );
+if (mpWindowImpl)
+mpWindowImpl-maEventListeners.removeListener( rEventListener );
 }
 
 void Window::AddChildEventListener( const Link rEventListener )
@@ -259,7 +260,8 @@ void Window::AddChildEventListener( const Link 
rEventListener )
 
 void Window::RemoveChildEventListener( const Link rEventListener )
 {
-mpWindowImpl-maChildEventListeners.removeListener( rEventListener );
+if (mpWindowImpl)
+mpWindowImpl-maChildEventListeners.removeListener( rEventListener );
 }
 
 ImplSVEvent * Window::PostUserEvent( const Link rLink, void* pCaller, bool 
bReferenceLink )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - svtools/source vcl/source

2015-06-04 Thread Tomaž Vajngerl
 svtools/source/control/ruler.cxx |   40 +++
 vcl/source/window/status.cxx |2 -
 2 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit a3091c319d45c3793910ad88c9442e1f3949575f
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Jun 4 18:12:01 2015 +0900

fix cherry-pick from master

Change-Id: I8c75292755877e678cadbda8cf5b2307150fa90c

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 69bc040..ed0995e 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -1469,7 +1469,7 @@ void Ruler::ImplUpdate( bool bMustCalc )
 {
 // clear lines in this place so they aren't considered at recalculation
 if (!mbFormat)
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 
 // set flags
 if (bMustCalc)
@@ -1483,7 +1483,7 @@ void Ruler::ImplUpdate( bool bMustCalc )
 // otherwise trigger update
 if (IsReallyVisible()  IsUpdateMode())
 {
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 }
 
@@ -1879,7 +1879,7 @@ bool Ruler::ImplStartDrag( RulerSelection* pHitTest, 
sal_uInt16 nModifier )
 mbDrag = true;
 mnStartDragPos = mnDragPos;
 StartTracking();
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 return true;
 }
 else
@@ -1946,7 +1946,7 @@ void Ruler::ImplDrag( const Point rPos )
 Drag();
 
 // and redraw
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 
 // reset the data as before cancel
 *mpDragData = aTempData;
@@ -1967,7 +1967,7 @@ void Ruler::ImplDrag( const Point rPos )
 
 // redraw
 if (mbFormat)
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 }
 
@@ -1996,7 +1996,7 @@ void Ruler::ImplEndDrag()
 mnStartDragPos  = 0;
 
 // redraw
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 void Ruler::MouseButtonDown( const MouseEvent rMEvt )
@@ -2010,7 +2010,7 @@ void Ruler::MouseButtonDown( const MouseEvent rMEvt )
 // update ruler
 if ( mbFormat )
 {
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 if ( maExtraRect.IsInside( aMousePos ) )
@@ -2119,7 +2119,7 @@ void Ruler::MouseMove( const MouseEvent rMEvt )
 
 if (mbFormat)
 {
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 }
 
@@ -2176,7 +2176,7 @@ void Ruler::Resize()
 if ( bVisible  !mpData-pLines.empty() )
 {
 mnUpdateFlags |= RULER_UPDATE_LINES;
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 // recalculate some values if the height/width changes
@@ -2199,7 +2199,7 @@ void Ruler::Resize()
 if ( bVisible )
 {
 if ( nNewHeight )
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 else if ( mpData-bAutoPageWidth )
 {
 // only at AutoPageWidth muss we redraw
@@ -2226,7 +2226,7 @@ void Ruler::Resize()
 aRect.Right()   = RULER_OFF + mnVirHeight;
 }
 
-Invalidate(aRect, InvalidateFlags::NoErase);
+Invalidate(aRect, INVALIDATE_NOERASE);
 }
 }
 
@@ -2318,13 +2318,13 @@ void Ruler::Activate()
 
 // update positionlies - draw is delayed
 mnUpdateFlags |= RULER_UPDATE_LINES;
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 void Ruler::Deactivate()
 {
 // clear positionlines
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 
 mbActive = false;
 }
@@ -2344,7 +2344,7 @@ bool Ruler::StartDocDrag( const MouseEvent rMEvt, 
RulerType eDragType )
 // update ruler
 if ( mbFormat )
 {
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 if ( nMouseClicks == 1 )
@@ -2409,7 +2409,7 @@ RulerType Ruler::GetType( const Point rPos, sal_uInt16* 
pAryPos )
 // update ruler
 if ( IsReallyVisible()  mbFormat )
 {
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 
 (void)ImplHitTest(rPos, aHitTest);
@@ -2459,7 +2459,7 @@ void Ruler::SetBorderPos( long nOff )
 mnBorderOff = nOff;
 
 if ( IsReallyVisible()  IsUpdateMode() )
-Invalidate(InvalidateFlags::NoErase);
+Invalidate(INVALIDATE_NOERASE);
 }
 }
 }
@@ -2534,7 +2534,7 @@ void Ruler::SetExtraType( RulerExtra eNewExtraType, 
sal_uInt16 nStyle )
 meExtraType  = eNewExtraType;
 mnExtraStyle = nStyle;
 if