diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-08 14:53:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-28 13:06:18 +0100 |
commit | 56ea15091c69d280310aa8b28bb1e9488eaad756 (patch) | |
tree | 5c97dee49a30aa1b51c7f54f7990723268f28878 /toolkit/source/controls | |
parent | 7e708545e4e32910d93cd471eb8438dca4ab47b6 (diff) |
fdo#46808, use service constructor for i18n::Collator
Change-Id: If6ad17fa9e274beff7ba872a095ced65438962af
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/grid/sortablegriddatamodel.cxx | 19 | ||||
-rw-r--r-- | toolkit/source/controls/grid/sortablegriddatamodel.hxx | 4 |
2 files changed, 13 insertions, 10 deletions
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 5343050a3e95..aa874db94415 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -21,11 +21,12 @@ #include "sortablegriddatamodel.hxx" #include "toolkit/helper/servicenames.hxx" -#include <com/sun/star/i18n/XCollator.hpp> +#include <com/sun/star/i18n/Collator.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/ucb/AlreadyInitializedException.hpp> #include <comphelper/anycompare.hxx> +#include <comphelper/processfactory.hxx> #include <cppuhelper/typeprovider.hxx> #include <tools/diagnose_ex.h> #include <tools/debug.hxx> @@ -52,12 +53,14 @@ namespace toolkit using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::lang::IndexOutOfBoundsException; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::awt::grid::XGridDataListener; using ::com::sun::star::beans::Pair; using ::com::sun::star::util::XCloneable; using ::com::sun::star::i18n::XCollator; + using ::com::sun::star::i18n::Collator; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::awt::grid::GridDataEvent; @@ -127,10 +130,10 @@ namespace toolkit //================================================================================================================== DBG_NAME( SortableGridDataModel ) //------------------------------------------------------------------------------------------------------------------ - SortableGridDataModel::SortableGridDataModel( Reference< XMultiServiceFactory > const & i_factory ) + SortableGridDataModel::SortableGridDataModel( Reference< XComponentContext > const & rxContext ) :SortableGridDataModel_Base( m_aMutex ) ,SortableGridDataModel_PrivateBase() - ,m_context( i_factory ) + ,m_xContext( rxContext ) ,m_isInitialized( false ) ,m_delegator() ,m_collator() @@ -147,7 +150,7 @@ namespace toolkit :cppu::BaseMutex() ,SortableGridDataModel_Base( m_aMutex ) ,SortableGridDataModel_PrivateBase() - ,m_context( i_copySource.m_context ) + ,m_xContext( i_copySource.m_xContext ) ,m_isInitialized( true ) ,m_delegator() ,m_collator( i_copySource.m_collator ) @@ -213,9 +216,9 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ namespace { - Reference< XCollator > lcl_loadDefaultCollator_throw( ::comphelper::ComponentContext const & i_context ) + Reference< XCollator > lcl_loadDefaultCollator_throw( const Reference<XComponentContext> & rxContext ) { - Reference< XCollator > const xCollator( i_context.createComponent( "com.sun.star.i18n.Collator" ), UNO_QUERY_THROW ); + Reference< XCollator > const xCollator = Collator::create( rxContext ); xCollator->loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); return xCollator; } @@ -236,7 +239,7 @@ namespace toolkit { case 1: // SortableGridDataModel.create( XMutableGridDataModel ) xDelegator.set( i_arguments[0], UNO_QUERY ); - xCollator = lcl_loadDefaultCollator_throw( m_context ); + xCollator = lcl_loadDefaultCollator_throw( m_xContext ); break; case 2: // SortableGridDataModel.createWithCollator( XMutableGridDataModel, XCollator ) @@ -891,7 +894,7 @@ namespace toolkit ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) { - return *( new ::toolkit::SortableGridDataModel( i_factory ) ); + return *( new ::toolkit::SortableGridDataModel( comphelper::getComponentContext(i_factory) ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index 71718c5500de..85c5abd56c19 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx @@ -55,7 +55,7 @@ namespace toolkit ,public SortableGridDataModel_PrivateBase { public: - SortableGridDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory ); + SortableGridDataModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext ); SortableGridDataModel( SortableGridDataModel const & i_copySource ); bool isInitialized() const { return m_isInitialized; } @@ -183,7 +183,7 @@ namespace toolkit void impl_removeColumnSort_noBroadcast(); private: - ::comphelper::ComponentContext m_context; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; bool m_isInitialized; ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XMutableGridDataModel > m_delegator; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_collator; |