summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2019-05-25 16:08:40 -0800
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2019-06-18 14:10:02 +0200
commitd10b4015b07aa717b6377f46f58f29b9988ec84f (patch)
tree737491422b44888cf0042c0f4d5a33a7a2802c4b /svx
parent0620ccd4dc5422f8d3253c7b044a16043b00da35 (diff)
tdf#120170 Prevent escape key press focus to document
...from style, fontname, and fontsize comboboxes used in sidebar tool boxes when sidebar is undocked Windows build does not show this bug but Linux does for SAL_USE_VCLPLUGIN's gen, gtk, and gtk3. This patch checks the combobox parent object type for type sidebar tool box and if so skips the release focus call that sets focus to the frames container window which incorrectly sets focus to the document for Linux build. Probably a lower level fix for this but I'm not at that level yet :-) Change-Id: Ie33ea4238f7e8715fbd0389efd9185598a528ced Reviewed-on: https://gerrit.libreoffice.org/72970 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> (cherry picked from commit c81055eb075efffa9cd123913a684ac3258903d5) Reviewed-on: https://gerrit.libreoffice.org/74250 Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx6
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx5
2 files changed, 8 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0b1c52b88acf..125d6d21432e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -898,7 +898,8 @@ bool SvxStyleBox_Impl::EventNotify( NotifyEvent& rNEvt )
case KEY_ESCAPE:
SelectEntryPos( nCurSel );
- ReleaseFocus();
+ if ( typeid( *GetParent() ) != typeid( sfx2::sidebar::SidebarToolBox ) )
+ ReleaseFocus();
bHandled = true;
break;
}
@@ -1416,7 +1417,8 @@ bool SvxFontNameBox_Impl::EventNotify( NotifyEvent& rNEvt )
case KEY_ESCAPE:
SetText( aCurText );
- ReleaseFocus_Impl();
+ if ( typeid( *GetParent() ) != typeid( sfx2::sidebar::SidebarToolBox ) )
+ ReleaseFocus_Impl();
EndPreview();
break;
}
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 96ff89a22a3c..628a9585e922 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -39,6 +39,8 @@
#include <memory>
+#include <sfx2/sidebar/SidebarToolBox.hxx>
+
using namespace ::com::sun::star;
namespace {
@@ -230,7 +232,8 @@ bool SvxFontSizeBox_Impl::EventNotify( NotifyEvent& rNEvt )
case KEY_ESCAPE:
SetText( m_aCurText );
- ReleaseFocus_Impl();
+ if ( typeid( *GetParent() ) != typeid( sfx2::sidebar::SidebarToolBox ) )
+ ReleaseFocus_Impl();
bHandled = true;
break;
}