diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-13 12:47:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-17 14:28:21 +0200 |
commit | 369e3fdcdafdb112a6963fb86fa4d4d0edb29c00 (patch) | |
tree | 9b7b52b0524feee2c6cfcaf5e5fb440816520fde /connectivity | |
parent | 9486e6c45f5e15e07f4717fdbaaf30afe6ed86b9 (diff) |
fdo#46808, Adapt i18n::LocaleData UNO service to new style
The implementation of the LocaleData implements the optional XLocaleData4,
so rather than creating a new interface for the new-style service, we simply
make the service implement XLocaleData4, which in turn implements
XLocaleData3, XLocaleData2, XLocaleData.
Change-Id: I3e9a48b031be6b2aa5e04b376b3940b942add85a
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/inc/connectivity/predicateinput.hxx | 4 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sqlparse.hxx | 4 | ||||
-rw-r--r-- | connectivity/source/commontools/predicateinput.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/parse/sqlbison.y | 2 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 3 |
5 files changed, 10 insertions, 9 deletions
diff --git a/connectivity/inc/connectivity/predicateinput.hxx b/connectivity/inc/connectivity/predicateinput.hxx index 63508215215f..56abc6e2959a 100644 --- a/connectivity/inc/connectivity/predicateinput.hxx +++ b/connectivity/inc/connectivity/predicateinput.hxx @@ -24,7 +24,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> -#include <com/sun/star/i18n/XLocaleData.hpp> +#include <com/sun/star/i18n/XLocaleData4.hpp> #include <connectivity/sqlparse.hxx> #include "connectivity/dbtoolsdllapi.hxx" @@ -48,7 +48,7 @@ namespace dbtools m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; - ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData > + ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 > m_xLocaleData; ::connectivity::OSQLParser diff --git a/connectivity/inc/connectivity/sqlparse.hxx b/connectivity/inc/connectivity/sqlparse.hxx index acdf43cb2d43..a4a64b3a2480 100644 --- a/connectivity/inc/connectivity/sqlparse.hxx +++ b/connectivity/inc/connectivity/sqlparse.hxx @@ -34,7 +34,7 @@ #endif #include <com/sun/star/i18n/XCharacterClassification.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/i18n/XLocaleData.hpp> +#include <com/sun/star/i18n/XLocaleData4.hpp> #include "connectivity/IParseContext.hxx" #include "connectivity/dbtoolsdllapi.hxx" #include "connectivity/sqlerror.hxx" @@ -165,7 +165,7 @@ namespace connectivity sal_Int32 m_nDateFormatKey; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification> m_xCharClass; - static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> s_xLocaleData; + static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4> s_xLocaleData; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> xDummy; // can be deleted after 627 // convert a string into double trim it to scale of _nscale and than transform it back to string diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index f72b1163ab36..67ec21fcc810 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -21,6 +21,7 @@ #include <connectivity/predicateinput.hxx> #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> +#include <com/sun/star/i18n/LocaleData.hpp> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/util/NumberFormatter.hpp> @@ -47,6 +48,7 @@ namespace dbtools using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::lang::Locale; using ::com::sun::star::uno::Exception; + using ::com::sun::star::i18n::LocaleData; using ::com::sun::star::i18n::XLocaleData; using ::com::sun::star::i18n::LocaleDataItem; @@ -123,9 +125,7 @@ namespace dbtools // create the locale data if ( m_xORB.is() ) { - m_xLocaleData = m_xLocaleData.query( m_xORB->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.LocaleData" ) ) ) - ); + m_xLocaleData = LocaleData::create( comphelper::ComponentContext(m_xORB).getUNOContext() ); } } catch( const Exception& ) diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index ce2d0e778e99..96d078291d5f 100644 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -4579,7 +4579,7 @@ sal_Int32 OSQLParser::s_nRefCount = 0; // ::osl::Mutex OSQLParser::s_aMutex; OSQLScanner* OSQLParser::s_pScanner = 0; OSQLParseNodesGarbageCollector* OSQLParser::s_pGarbageCollector = 0; -::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> OSQLParser::s_xLocaleData = NULL; +::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4> OSQLParser::s_xLocaleData = NULL; //----------------------------------------------------------------------------- void setParser(OSQLParser* _pParser) { diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 9cc9101298b7..9936d18f91c6 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> #include <com/sun/star/util/XNumberFormatTypes.hpp> +#include <com/sun/star/i18n/LocaleData.hpp> #include <com/sun/star/i18n/NumberFormatIndex.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> @@ -1285,7 +1286,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star: s_pGarbageCollector = new OSQLParseNodesGarbageCollector(); if(!s_xLocaleData.is()) - s_xLocaleData = Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString("com.sun.star.i18n.LocaleData")),UNO_QUERY); + s_xLocaleData = LocaleData::create(comphelper::ComponentContext(m_xServiceFactory).getUNOContext()); // reset to 0 memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs[0]) * (OSQLParseNode::rule_count+1)); |