summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-08-30 10:16:37 -0400
committerHenry Castro <hcastro@collabora.com>2023-09-01 19:09:28 +0200
commit47d77c822fb58f9617379969b078c8a6230767d6 (patch)
tree9cfcab46421841cceaf3a790f4a5e14d89918ce3 /svx/source
parent50f36b75cee6591a00102c6e9fa71ba91df5bbd8 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156423 Tested-by: Jenkins
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/form/ParseContext.cxx16
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
{