diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-12-15 14:56:09 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-12-15 14:31:42 +0100 |
commit | 86de82ae54a243743b3775d44281dd02fcad6014 (patch) | |
tree | dfaa89c33721f6516c9dc98cf90a7e965e5e6acb /vcl | |
parent | 5a422821200e19f99cdcad5c7b4e7462cb04f722 (diff) |
tdf#138932: don't modify KEY_DECIMAL for password box
Change-Id: I24c3e8e9f53111e893475e2d282120ce4bb678e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107751
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/winproc.cxx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index aab2cb21bb21..d6f1b1e18bc2 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -37,6 +37,7 @@ #include <vcl/wrkwin.hxx> #include <vcl/floatwin.hxx> #include <vcl/toolkit/dialog.hxx> +#include <vcl/toolkit/edit.hxx> #include <vcl/help.hxx> #include <vcl/dockwin.hxx> #include <vcl/menu.hxx> @@ -876,16 +877,6 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, return true; } - // #i1820# use locale specific decimal separator - if( nEvCode == KEY_DECIMAL ) - { - if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() ) - { - OUString aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() ); - nCharCode = static_cast<sal_uInt16>(aSep[0]); - } - } - bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1(); // determine last input time @@ -970,6 +961,20 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, if ( !pChild ) return false; + // #i1820# use locale specific decimal separator + if (nEvCode == KEY_DECIMAL) + { + // tdf#138932: don't modify the meaning of the key for password box + bool bPass = false; + if (auto pEdit = dynamic_cast<Edit*>(pChild.get())) + bPass = pEdit->IsPassword(); + if (!bPass && Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep()) + { + OUString aSep(pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep()); + nCharCode = static_cast<sal_uInt16>(aSep[0]); + } + } + // RTL: mirror cursor keys const OutputDevice *pChildOutDev = pChild->GetOutDev(); if( (aKeyCode.GetCode() == KEY_LEFT || aKeyCode.GetCode() == KEY_RIGHT) && |