diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-09 16:52:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-09 17:19:33 +0100 |
commit | 9b7dfb10641ba7978ffcbd1db0507163411ae027 (patch) | |
tree | b768052d8e5c51cba247e6cc46d0ac0cca3bf573 /vcl | |
parent | 98da362f1691734437cb37f902fb1cdab613ac0a (diff) |
EndSaveFocus does nothing on the !bRestore case
Change-Id: I8e199535803faf364469f9b9df46f339febe25c6
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/floatwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 12 |
4 files changed, 6 insertions, 16 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 82283c94337e..20b1579b0ad3 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -803,8 +803,6 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, const VclPt else { mbPopupModeTearOff = true; - if ( xFocusId != nullptr ) - Window::EndSaveFocus( xFocusId, false ); } mbPopupModeCanceled = bool(nFlags & FloatWinPopupEndFlags::Cancel); diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 7b6c3d08de70..28a554ff8650 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -466,8 +466,6 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b { if( !ImplGetSVData()->maWinData.mbNoSaveFocus ) { - // we didn't clean up last time - Window::EndSaveFocus( xSaveFocusId, false ); // clean up xSaveFocusId = nullptr; if( !bNoSaveFocus ) xSaveFocusId = Window::SaveFocus(); // only save focus when initially activated @@ -499,9 +497,10 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b { VclPtr<vcl::Window> xTempFocusId = xSaveFocusId; xSaveFocusId = nullptr; - Window::EndSaveFocus( xTempFocusId, bAllowRestoreFocus ); + if (bAllowRestoreFocus) + Window::EndSaveFocus(xTempFocusId); // #105406# restore focus to document if we could not save focus before - if( bDefaultToDocument && xTempFocusId == nullptr && bAllowRestoreFocus ) + if (bDefaultToDocument && xTempFocusId == nullptr && bAllowRestoreFocus) GrabFocusToDocument(); } } diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 16f7cc9e77f1..02b9d2f8d40b 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -401,7 +401,6 @@ void MenuFloatingWindow::StopExecute( VclPtr<vcl::Window> xFocusId ) // (could have been restored in Select) if ( xSaveFocusId != nullptr ) { - Window::EndSaveFocus( xFocusId, false ); xFocusId = xSaveFocusId; if ( xFocusId != nullptr ) { diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 2878e0ab09bc..17b48cbaba2c 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -421,17 +421,11 @@ VclPtr<vcl::Window> Window::SaveFocus() return nullptr; } -void Window::EndSaveFocus( const VclPtr<vcl::Window>& xFocusWin, bool bRestore ) +void Window::EndSaveFocus(const VclPtr<vcl::Window>& xFocusWin) { - if ( xFocusWin == nullptr ) - return; - else + if (xFocusWin && !xFocusWin->IsDisposed()) { - if ( !xFocusWin->IsDisposed() ) - { - if ( bRestore ) - xFocusWin->GrabFocus(); - } + xFocusWin->GrabFocus(); } } |