diff options
author | Jim Raykowski <raykowj@gmail.com> | 2019-05-25 16:08:40 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2019-06-13 23:06:26 +0200 |
commit | c81055eb075efffa9cd123913a684ac3258903d5 (patch) | |
tree | 4d7af5110ee5817724bce9bfe8236970491e03fa /svx | |
parent | 547c8a8a8935204bed319b959dd040d6413bdf74 (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>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunocontroller.cxx | 5 |
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; } |