[Libreoffice-commits] core.git: vcl/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 15 13:32:21 UTC 2020


 vcl/source/window/winproc.cxx |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 86de82ae54a243743b3775d44281dd02fcad6014
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Dec 15 14:56:09 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Dec 15 14:31:42 2020 +0100

    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 at collabora.com>

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) &&


More information about the Libreoffice-commits mailing list