diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-18 08:53:54 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-19 14:05:18 +0200 |
commit | cd2f2e772ce37808b0922358bf2f22adff6d2ea1 (patch) | |
tree | 59b168974b31190994727b9c26f58fed15526f0f /dbaccess | |
parent | 6b946f228397c370e09f487c470bafd9d046eee5 (diff) |
make OSingleSelectQueryComposer use *system* parse context
and pass it to the parser and PredicateInput constructors.
This makes the whole story consistent; before system locale settings were already manually passed to parseNodeToPredicateStr, which led to some things being parsed as en_US and others as system locale.
Change-Id: Ib9571b10d79183571e8ab3f79660b41594dc2d1c
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/Library_dba.mk | 1 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/inc/SingleSelectQueryComposer.hxx | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk index b3b794dd740a..bca628df7b87 100644 --- a/dbaccess/Library_dba.mk +++ b/dbaccess/Library_dba.mk @@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,dba,\ sfx \ svl \ svt \ + svxcore \ tl \ ucbhelper \ utl \ diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index d84f0000ab61..7bd978d4d1da 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -226,7 +226,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference<XComponentContext>& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) - ,m_aSqlParser( _rContext ) + ,m_aSqlParser( _rContext, &m_aParseContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser, NULL ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser, NULL ) ,m_aElementaryParts( (size_t)SQLPartCount ) @@ -248,7 +248,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc m_aCurrentColumns.resize(4); - m_aLocale = SvtSysLocale().GetLanguageTag().getLocale(); + m_aLocale = m_aParseContext.getPreferredLocale(); m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext ); Reference< XLocaleData4 > xLocaleData( LocaleData::create(m_aContext) ); LocaleDataItem aData = xLocaleData->getLocaleItem(m_aLocale); @@ -1507,7 +1507,7 @@ namespace void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredFilter" ); - OPredicateInputController aPredicateInput(m_aContext, m_xConnection); + OPredicateInputController aPredicateInput(m_aContext, m_xConnection, &m_aParseContext); setFilter(lcl_getCondition(filter,aPredicateInput,getColumns())); } diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index 314c05b18c2a..1f9c720d2b74 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -33,6 +33,7 @@ #include <comphelper/uno3.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/propertycontainer.hxx> +#include <svx/ParseContext.hxx> #include <memory> @@ -77,6 +78,7 @@ namespace dbaccess }; typedef ::std::const_mem_fun_t< const ::connectivity::OSQLParseNode*, ::connectivity::OSQLParseTreeIterator > TGetParseNode; + ::svxform::OSystemParseContext m_aParseContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterator; // the iterator for the "additive statement" (means without the clauses of the elementary statement) |