diff options
author | Henry Castro <hcastro@collabora.com> | 2023-08-30 10:16:37 -0400 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-31 18:15:16 +0200 |
commit | 091d74c16e33a1c4cf3e456363965528392f7033 (patch) | |
tree | 7eb81e04503ed8e5031ae54cff5dbbea6a118daf /svx | |
parent | 985559a9d8e1e0bd0b6bddc1776c0c06fb029160 (diff) |
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 <hcastro@collabora.com>
Change-Id: I191b9591ad796d0dd9509c0fb10b11c16f72e1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156296
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/ParseContext.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
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 { |