diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-21 11:05:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 13:53:19 +0200 |
commit | 2750fe97c5a2c5b374542e3383dfc75ec099c7af (patch) | |
tree | b06b1ff1f4fc20462a04f20b77aa79e47e5d4613 /sc/source | |
parent | 13c73a1b358934d7ffac6a6275c4e9d399b7d4eb (diff) |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
and remove unnecessarily storing the global XComponentContext
Change-Id: Ifb230b88661fea38d96a9d7f0994f92b9632ef79
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/documen6.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/poolhelp.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table3.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/unoobj/forbiuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 |
13 files changed, 20 insertions, 25 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index dcdae98dd479..1d63dd93a64d 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -118,7 +118,6 @@ private: ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : - xServiceManager( ::comphelper::getProcessServiceFactory() ), mpUndoManager( NULL ), pEditEngine( NULL ), pNoteEngine( NULL ), diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 819b7a572bcc..b08c5a9f1289 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -51,7 +51,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator() pScriptTypeData = new ScScriptTypeData; if ( !pScriptTypeData->xBreakIter.is() ) { - pScriptTypeData->xBreakIter = i18n::BreakIterator::create( comphelper::getComponentContext(xServiceManager) ); + pScriptTypeData->xBreakIter = i18n::BreakIterator::create( comphelper::getProcessComponentContext() ); } return pScriptTypeData->xBreakIter; } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 9eefd8f00565..5c1949987c50 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1593,7 +1593,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp { OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); - utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getComponentContext(xServiceManager), nType ); + utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getProcessComponentContext(), nType ); bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); sal_uInt16 nLanguage = LANGUAGE_SYSTEM; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index dff56a52cd14..5b1017bd8272 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -3023,7 +3023,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); SAL_WNODEPRECATED_DECLARATIONS_POP - SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge); + SvNumberFormatter aFormat( comphelper::getProcessComponentContext(), ScGlobal::eLnge); DBConnector aDB(*pCache, xRowSet, *aFormat.GetNullDate()); if (!aDB.isValid()) return NULL; @@ -3137,7 +3137,7 @@ void ScDPCollection::DBCaches::updateCache( return; } - SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge); + SvNumberFormatter aFormat( comphelper::getProcessComponentContext(), ScGlobal::eLnge); DBConnector aDB(rCache, xRowSet, *aFormat.GetNullDate()); if (!aDB.isValid()) return; diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index c2ba946938a2..b6f027a576f7 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -73,7 +73,7 @@ SvNumberFormatter* ScPoolHelper::GetFormTable() const { if ( !pFormTable ) { - pFormTable = new SvNumberFormatter( comphelper::getComponentContext(m_pSourceDoc->GetServiceManager()), ScGlobal::eLnge ); + pFormTable = new SvNumberFormatter( comphelper::getProcessComponentContext(), ScGlobal::eLnge ); pFormTable->SetColorLink( LINK( m_pSourceDoc, ScDocument, GetUserDefinedColor ) ); pFormTable->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT ); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index d1ef841faaee..0058cacd44b2 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -312,7 +312,7 @@ void ScTable::InitSortCollator( const ScSortParam& rPar ) if ( !rPar.aCollatorLocale.Language.isEmpty() ) { if ( !pSortCollator || IsSortCollatorGlobal() ) - pSortCollator = new CollatorWrapper( comphelper::getComponentContext(pDocument->GetServiceManager()) ); + pSortCollator = new CollatorWrapper( comphelper::getProcessComponentContext() ); pSortCollator->loadCollatorAlgorithm( rPar.aCollatorAlgorithm, rPar.aCollatorLocale, (rPar.bCaseSens ? 0 : SC_COLLATOR_IGNORES) ); } diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index b7e054d43afb..0623ae549779 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1223,7 +1223,7 @@ XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) : /* Compiler needs a hint, this doesn't work: new NfKeywordTable; cannot convert from 'class String *' to 'class String (*)[54]' The effective result here is class String (*)[54*1] */ - mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ), + mxFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ), mpKeywordTable( new NfKeywordTable ), mnStdFmt( GetFormatter().GetStandardFormat( ScGlobal::eLnge ) ) { @@ -2864,7 +2864,7 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF ) XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ), - mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ), + mxFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ), mpKeywordTable( new NfKeywordTable ) { mxFormatter->FillKeywordTable( *mpKeywordTable, LANGUAGE_ENGLISH_US ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index d1e5e47fc394..3e80d97194a8 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2392,7 +2392,7 @@ void ScXMLImport::ExamineDefaultStyle() aDecSep = ScGlobal::pLocaleData->getNumDecimalSep(); else { - LocaleDataWrapper aLocaleData( comphelper::getComponentContext(pDoc->GetServiceManager()), + LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( nFormatLang ) ); aDecSep = aLocaleData.getNumDecimalSep(); } @@ -2612,7 +2612,7 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, const OUString& r { { ScXMLImport::MutexGuard aGuard(*this); - LocaleDataWrapper aLocaleData( comphelper::getComponentContext(GetDocument()->GetServiceManager()), LanguageTag( aLocale) ); + LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( aLocale) ); OUStringBuffer aBuffer(15); aBuffer.appendAscii("#"); aBuffer.append( aLocaleData.getNumThousandSep() ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index d7003c956cdd..da59b28504cc 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1388,7 +1388,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) ScRange aRange; // HTML macht eigenes ColWidth/RowHeight CalcOutputFactor(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(aDocument.GetServiceManager()), eLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang); eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange, GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert ); if (eError != eERR_OK) diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 1039219706ca..7f5ea07aa1e0 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -125,7 +125,7 @@ void ScDocShell::InitItems() if (aLocales.getLength()) { rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable = - new SvxForbiddenCharactersTable( comphelper::getComponentContext(aDocument.GetServiceManager()) ); + new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() ); const lang::Locale* pLocales = aLocales.getConstArray(); for (sal_Int32 i = 0; i < aLocales.getLength(); i++) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index e09a139ccc57..4a74487b2487 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1284,14 +1284,14 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) long nSkipLines = pExtOptions->GetStartRow(); LanguageType eDocLang = pExtOptions->GetLanguage(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eDocLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eDocLang); bool bDetectNumFormat = pExtOptions->IsDetectSpecialNumber(); // For date recognition ::utl::TransliterationWrapper aTransliteration( - comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE ); + comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE ); aTransliteration.loadModuleIfNeeded( eDocLang ); - CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) ); + CalendarWrapper aCalendar( comphelper::getProcessComponentContext() ); aCalendar.loadDefaultCalendar( LanguageTag( eDocLang ).getLocale() ); boost::scoped_ptr< ::utl::TransliterationWrapper > pEnglishTransliteration; @@ -1299,9 +1299,9 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) if ( eDocLang != LANGUAGE_ENGLISH_US ) { pEnglishTransliteration.reset(new ::utl::TransliterationWrapper ( - comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE )); + comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE )); aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US ); - pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) )); + pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getProcessComponentContext() )); pEnglishCalendar->loadDefaultCalendar( LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() ); } @@ -2192,7 +2192,7 @@ bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL ) { // Pick up import options if available. LanguageType eLang = pExtOptions->GetLanguage(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang); bool bSpecialNumber = pExtOptions->IsDetectSpecialNumber(); pImp->WriteToDocument(false, 1.0, &aNumFormatter, bSpecialNumber); } diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx index e26190642b09..242816de80fc 100644 --- a/sc/source/ui/unoobj/forbiuno.cxx +++ b/sc/source/ui/unoobj/forbiuno.cxx @@ -38,7 +38,7 @@ static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* // create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable, // so changes can be stored. - xRet = new SvxForbiddenCharactersTable( comphelper::getComponentContext(pDoc->GetServiceManager()) ); + xRet = new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() ); pDoc->SetForbiddenCharacters( xRet ); } } diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 952ac3c57d81..6699530f104d 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -174,11 +174,7 @@ sal_Bool ScXMLSourceDlg::Close() void ScXMLSourceDlg::SelectSourceFile() { - uno::Reference<lang::XMultiServiceFactory> xServiceMgr = mpDoc->GetServiceManager(); - if (!xServiceMgr.is()) - return; - - uno::Reference<ui::dialogs::XFilePicker3> xFilePicker = ui::dialogs::FilePicker::createWithMode( comphelper::getComponentContext(xServiceMgr), ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); + uno::Reference<ui::dialogs::XFilePicker3> xFilePicker = ui::dialogs::FilePicker::createWithMode( comphelper::getProcessComponentContext(), ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); if (maSrcPath.isEmpty()) // Use default path. |