include/svx/ParseContext.hxx | 11 +++++++++-- svx/source/form/ParseContext.cxx | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-)
New commits: commit 47d77c822fb58f9617379969b078c8a6230767d6 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Aug 30 10:16:37 2023 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Fri Sep 1 19:09:28 2023 +0200 svx: add class "ONeutralParseContext" If Base SQL query: SELECT COUNT("test"."id") FROM Test Then changed to Spanish interface, it is required to have a neutral keyword localized, the "COUNT" will fail to detect column type, because the keyword in Spanish is "RECUENTO" Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I191b9591ad796d0dd9509c0fb10b11c16f72e1ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156296 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156423 Tested-by: Jenkins diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx index 4b8f451a8014..b5b8b7c84ea6 100644 --- a/include/svx/ParseContext.hxx +++ b/include/svx/ParseContext.hxx @@ -31,11 +31,12 @@ namespace svxform //= OSystemParseContext - class SAL_DLLPUBLIC_RTTI OSystemParseContext final : public ::connectivity::IParseContext + class SAL_DLLPUBLIC_RTTI OSystemParseContext : public ::connectivity::IParseContext { - private: + protected: ::std::vector< OUString > m_aLocalizedKeywords; + OSystemParseContext(bool bInit); public: SVXCORE_DLLPUBLIC OSystemParseContext(); @@ -57,6 +58,12 @@ namespace svxform }; + class SAL_DLLPUBLIC_RTTI ONeutralParseContext final : public OSystemParseContext + { + public: + SVXCORE_DLLPUBLIC ONeutralParseContext(); + SVXCORE_DLLPUBLIC virtual ~ONeutralParseContext(); + }; //= OParseContextClient diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx index 63634179142e..d231bfb3cd52 100644 --- a/svx/source/form/ParseContext.cxx +++ b/svx/source/form/ParseContext.cxx @@ -41,6 +41,11 @@ OSystemParseContext::OSystemParseContext() m_aLocalizedKeywords.push_back(SvxResId(RID_RSC_SQL_INTERNATIONAL[i])); } +OSystemParseContext::OSystemParseContext(bool /*bInit*/) + : IParseContext() +{ +} + OSystemParseContext::~OSystemParseContext() { } @@ -140,6 +145,17 @@ IParseContext::InternationalKeyCode OSystemParseContext::getIntlKeyCode(const OS return InternationalKeyCode::None; } +ONeutralParseContext::ONeutralParseContext() + : OSystemParseContext(false) +{ + std::locale aLocale = Translate::Create("svx", LanguageTag("en-US")); + for (size_t i = 0; i < SAL_N_ELEMENTS(RID_RSC_SQL_INTERNATIONAL); ++i) + m_aLocalizedKeywords.push_back(Translate::get(RID_RSC_SQL_INTERNATIONAL[i], aLocale)); +} + +ONeutralParseContext::~ONeutralParseContext() +{ +} namespace {