summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-09 16:52:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-09 17:19:33 +0100
commit9b7dfb10641ba7978ffcbd1db0507163411ae027 (patch)
treeb768052d8e5c51cba247e6cc46d0ac0cca3bf573
parent98da362f1691734437cb37f902fb1cdab613ac0a (diff)
EndSaveFocus does nothing on the !bRestore case
Change-Id: I8e199535803faf364469f9b9df46f339febe25c6
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/source/window/floatwin.cxx2
-rw-r--r--vcl/source/window/menubarwindow.cxx7
-rw-r--r--vcl/source/window/menufloatingwindow.cxx1
-rw-r--r--vcl/source/window/window2.cxx12
5 files changed, 7 insertions, 17 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 3224d33879a5..86ff2b76b905 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1133,7 +1133,7 @@ public:
bool IsCompoundControl() const;
static VclPtr<vcl::Window> SaveFocus();
- static void EndSaveFocus( const VclPtr<vcl::Window>& xFocusWin, bool bRestore = true );
+ static void EndSaveFocus(const VclPtr<vcl::Window>& xFocusWin);
void CaptureMouse();
void ReleaseMouse();
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();
}
}