diff options
author | Eike Rathke <erack@redhat.com> | 2022-10-23 19:13:15 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-10-23 20:00:44 +0200 |
commit | cdded98b23698e5e2a5cfffd5638e395098fcc4a (patch) | |
tree | 21d0b091a1be26ad1afda51057a298f1fd93c8ba /cui | |
parent | 825242b48843d7d8e03e3dd41a58d6d93afb443e (diff) |
Related: tdf#147817 prevent date acceptance pattern with numeric ambiguity
i.e. matching input with numeric decinmal separator, like M.D
Change-Id: Ice977b3e92373829cd2f5df7c065d55bc49fc23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141686
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index d58176ff00eb..7b887b4e6965 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1719,6 +1719,18 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, weld::Entry&, rEd, void ) bool bY, bM, bD; bY = bM = bD = false; bool bSep = true; + if (aPat.getLength() == 3) + { + // Disallow a pattern that would match a numeric input with + // decimal separator, like M.D + const LanguageType eLang = m_xLocaleSettingLB->get_active_id(); + const LocaleDataWrapper aLocaleWrapper(( LanguageTag(eLang))); + if ( aPat[1] == aLocaleWrapper.getNumDecimalSep().toChar() + || aPat[1] == aLocaleWrapper.getNumDecimalSepAlt().toChar()) + { + bValid = false; + } + } for (sal_Int32 i = 0; i < aPat.getLength() && bValid; /*nop*/) { const sal_Int32 j = i; |