summaryrefslogtreecommitdiffstats
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-10 16:40:27 +0200
committerNoel Grandin <noel@peralex.com>2013-01-28 08:25:24 +0200
commitf95a7c2c6d5c2158de12bb3ca6fd94b139e33c62 (patch)
tree85f09e15fd9954a84f55e561cb174fe0450ea99f /xmloff
parentfdo#46808, Adapt document::FilterConfigRefresh UNO service to new style (diff)
downloadcore-f95a7c2c6d5c2158de12bb3ca6fd94b139e33c62.tar.gz
core-f95a7c2c6d5c2158de12bb3ca6fd94b139e33c62.zip
fdo#46808, Convert SvNumberFormatter to use XComponentContext
Change-Id: If4e8312dae6bc5eb8bb7655cf250f06ab37b7e5c
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmloff/xmlnumfi.hxx11
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/draw/ximpstyl.cxx4
-rw-r--r--xmloff/source/style/xmlnumfe.cxx8
-rw-r--r--xmloff/source/style/xmlnumfi.cxx28
5 files changed, 22 insertions, 33 deletions
diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx
index f162f5be8aa1..678d9f26ae29 100644
--- a/xmloff/inc/xmloff/xmlnumfi.hxx
+++ b/xmloff/inc/xmloff/xmlnumfi.hxx
@@ -74,21 +74,14 @@ class SvXMLNumFmtHelper
{
SvXMLNumImpData* pData;
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
public:
- // #110680#
- //SvXMLNumFmtHelper( const ::com::sun::star::uno::Reference<
- // ::com::sun::star::util::XNumberFormatsSupplier >& rSupp );
- //SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter );
SvXMLNumFmtHelper(
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
~SvXMLNumFmtHelper();
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6b492ef217ee..1db8a015f5f7 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -381,7 +381,7 @@ void SvXMLImport::_InitCtor()
msPackageProtocol = "vnd.sun.star.Package:";
if (mxNumberFormatsSupplier.is())
- mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, comphelper::getComponentContext(getServiceFactory()));
if (mxModel.is() && !mxEventListener.is())
{
@@ -1649,7 +1649,7 @@ void SvXMLImport::_CreateDataStylesImport()
uno::Reference<util::XNumberFormatsSupplier> xNum =
GetNumberFormatsSupplier();
if ( xNum.is() )
- mpNumImport = new SvXMLNumFmtHelper(xNum, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(xNum, comphelper::getComponentContext(getServiceFactory()));
}
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 1a736dbedfc2..94ca2f7615d3 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1002,8 +1002,8 @@ SdXMLStylesContext::SdXMLStylesContext(
mbIsAutoStyle(bIsAutoStyle)
{
Reference< lang::XMultiServiceFactory > xMSF = rImport.getServiceFactory();
- mpNumFormatter = new SvNumberFormatter( xMSF, LANGUAGE_SYSTEM );
- mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, xMSF );
+ mpNumFormatter = new SvNumberFormatter( comphelper::getComponentContext(xMSF), LANGUAGE_SYSTEM );
+ mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, comphelper::getComponentContext(xMSF) );
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 98e3e9e803cb..0a124371de2d 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -237,9 +237,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
@@ -272,9 +272,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 8b57734766d5..3e2c5455a160 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -93,12 +93,12 @@ class SvXMLNumImpData
LocaleDataWrapper* pLocaleData;
SvXMLNumFmtEntryArr aNameEntries;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
public:
SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory );
+ const uno::Reference<uno::XComponentContext>& rxContext );
~SvXMLNumImpData();
SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
@@ -381,17 +381,16 @@ static SvXMLDefaultDateFormat aDefaultDateFormats[] =
SvXMLNumImpData::SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
+ const uno::Reference<uno::XComponentContext>& rxContext )
: pFormatter(pFmt),
pStylesElemTokenMap(NULL),
pStyleElemTokenMap(NULL),
pStyleAttrTokenMap(NULL),
pStyleElemAttrTokenMap(NULL),
pLocaleData(NULL),
-
- mxServiceFactory(xServiceFactory)
+ m_xContext(rxContext)
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
}
SvXMLNumImpData::~SvXMLNumImpData()
@@ -600,8 +599,7 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
{
if ( !pLocaleData )
pLocaleData = new LocaleDataWrapper(
- comphelper::getComponentContext(
- pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory),
+ pFormatter ? pFormatter->GetComponentContext() : m_xContext,
LanguageTag( nLang ) );
else
pLocaleData->setLanguageTag( LanguageTag( nLang ) );
@@ -2150,10 +2148,9 @@ sal_Bool SvXMLNumFormatContext::IsSystemLanguage()
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
const uno::Reference<util::XNumberFormatsSupplier>& rSupp,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
SvNumberFormatter* pFormatter = NULL;
SvNumberFormatsSupplierObj* pObj =
@@ -2161,17 +2158,16 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
if (pObj)
pFormatter = pObj->GetNumberFormatter();
- pData = new SvXMLNumImpData( pFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pFormatter, rxContext );
}
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
- pData = new SvXMLNumImpData( pNumberFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pNumberFormatter, rxContext );
}
SvXMLNumFmtHelper::~SvXMLNumFmtHelper()