diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-19 15:29:46 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 11:33:14 +0200 |
commit | f4776bf465ee682f65d1e978b031c928d9d310a5 (patch) | |
tree | c361f3415fbb33e363f408579184ec224b18ed16 /scaddins | |
parent | d40dceb75b3a2b717a36919d5f30189d918940e2 (diff) |
fdo#46808, fix up some NumberFormatter createInstance calls I missed
Change-Id: Ieb3ce841243797a119f1d1d40379ff2a4614168f
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/Library_analysis.mk | 1 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 7 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.hxx | 2 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 10 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.hxx | 7 |
5 files changed, 13 insertions, 14 deletions
diff --git a/scaddins/Library_analysis.mk b/scaddins/Library_analysis.mk index dda698588fa0..6b351da0cdc8 100644 --- a/scaddins/Library_analysis.mk +++ b/scaddins/Library_analysis.mk @@ -37,6 +37,7 @@ $(eval $(call gb_Library_use_internal_comprehensive_api,analysis,\ )) $(eval $(call gb_Library_use_libraries,analysis,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index ca83361714e8..bf1ef36a25da 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -19,6 +19,7 @@ #include "analysis.hxx" +#include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> @@ -155,13 +156,13 @@ void AnalysisAddIn::InitData( void ) } -AnalysisAddIn::AnalysisAddIn( const uno::Reference< lang::XMultiServiceFactory >& xServiceFact ) : +AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xContext ) : pDefLocales( NULL ), pFD( NULL ), pFactDoubles( NULL ), pCDL( NULL ), pResMgr( NULL ), - aAnyConv( xServiceFact ) + aAnyConv( xContext ) { } @@ -259,7 +260,7 @@ SEQ( STRING ) AnalysisAddIn::getSupportedServiceNames_Static() REF( uno::XInterface ) SAL_CALL AnalysisAddIn_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceFact ) { - static uno::Reference< uno::XInterface > xInst = (cppu::OWeakObject*) new AnalysisAddIn( xServiceFact ); + static uno::Reference< uno::XInterface > xInst = (cppu::OWeakObject*) new AnalysisAddIn( comphelper::getComponentContext(xServiceFact) ); return xInst; } diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx index 02792920568d..d89cbe251382 100644 --- a/scaddins/source/analysis/analysis.hxx +++ b/scaddins/source/analysis/analysis.hxx @@ -76,7 +76,7 @@ private: public: AnalysisAddIn( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFact ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); virtual ~AnalysisAddIn(); double FactDouble( sal_Int32 nNum ) THROWDEF_RTE_IAE; diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index b075bafe0148..08a096794c1a 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/util/XNumberFormatTypes.hpp> +#include <com/sun/star/util/NumberFormatter.hpp> #include <string.h> #include <stdio.h> @@ -2845,15 +2846,10 @@ sal_Bool ScaDate::operator<( const ScaDate& rCmp ) const //----------------------------------------------------------------------------- -ScaAnyConverter::ScaAnyConverter( const uno::Reference< lang::XMultiServiceFactory >& xServiceFact ) : +ScaAnyConverter::ScaAnyConverter( const uno::Reference< uno::XComponentContext >& xContext ) : bHasValidFormat( sal_False ) { - if( xServiceFact.is() ) - { - uno::Reference< uno::XInterface > xInstance = xServiceFact->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" )) ); - xFormatter = uno::Reference< util::XNumberFormatter >( xInstance, uno::UNO_QUERY ); - } + xFormatter = util::NumberFormatter::create(xContext); } ScaAnyConverter::~ScaAnyConverter() diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index bbbbfc57f245..395348cc5781 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -23,8 +23,9 @@ #include <com/sun/star/lang/XServiceName.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/Date.hpp> -#include <com/sun/star/util/XNumberFormatter.hpp> +#include <com/sun/star/util/XNumberFormatter2.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/sheet/XAddIn.hpp> #include <com/sun/star/sheet/addin/XAnalysis.hpp> @@ -1030,7 +1031,7 @@ inline void ScaDate::addYears( sal_Int32 nYearCount ) throw( ::com::sun::star::l class ScaAnyConverter { private: - ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > xFormatter; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter2 > xFormatter; sal_Int32 nDefaultFormat; sal_Bool bHasValidFormat; @@ -1045,7 +1046,7 @@ private: public: ScaAnyConverter( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFact ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); ~ScaAnyConverter(); /// Initializing with current language settings |