summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-08-30 10:16:37 -0400
committerAron Budea <aron.budea@collabora.com>2023-09-01 23:17:45 +0200
commitb36b4910301470f861e3b7a80683cf3fa4c390c5 (patch)
tree7a198fec3f143ab1c2fda17b287cf15c7d15f198
parent46a481772040063a4207a6ec691d8ddb9529108d (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> (cherry picked from commit 091d74c16e33a1c4cf3e456363965528392f7033)
-rw-r--r--include/svx/ParseContext.hxx11
-rw-r--r--svx/source/form/ParseContext.cxx16
2 files changed, 25 insertions, 2 deletions
diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx
index 18c23ad209ed..60344a7d9b66 100644
--- a/include/svx/ParseContext.hxx
+++ b/include/svx/ParseContext.hxx
@@ -31,11 +31,12 @@ namespace svxform
//= OSystemParseContext
- class SVXCORE_DLLPUBLIC OSystemParseContext final : public ::connectivity::IParseContext
+ class SVXCORE_DLLPUBLIC OSystemParseContext : public ::connectivity::IParseContext
{
- private:
+ protected:
::std::vector< OUString > m_aLocalizedKeywords;
+ OSystemParseContext(bool bInit);
public:
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
{