[Libreoffice-commits] .: 7 commits - basic/source dbaccess/source editeng/source i18npool/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk package/inc package/source padmin/source sc/source svl/inc sw/source ucbhelper/inc ucbhelper/Library_ucbhelper.mk ucbhelper/source ucb/source unotools/inc unotools/source vcl/source xmlhelp/source xmlsecurity/inc xmlsecurity/qa xmlsecurity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Nov 5 07:43:45 PST 2012
basic/source/classes/global.cxx | 2
basic/source/runtime/methods.cxx | 8 +-
dbaccess/source/core/dataaccess/ContentHelper.cxx | 2
editeng/source/editeng/impedit4.cxx | 2
editeng/source/misc/svxacorr.cxx | 2
i18npool/source/search/textsearch.cxx | 31 ++-------
offapi/UnoApi_offapi.mk | 7 +-
offapi/com/sun/star/i18n/Transliteration.idl | 7 --
offapi/com/sun/star/xml/crypto/NSSInitializer.idl | 37 +++++++++++
offapi/com/sun/star/xml/crypto/SEInitializer.idl | 12 ---
offapi/com/sun/star/xml/crypto/XNSSInitializer.idl | 41 +++++++++++++
offapi/type_reference/types.rdb |binary
package/inc/ZipFile.hxx | 16 ++---
package/inc/ZipOutputStream.hxx | 4 -
package/inc/zipfileaccess.hxx | 6 -
package/source/zipapi/XUnbufferedStream.cxx | 8 +-
package/source/zipapi/XUnbufferedStream.hxx | 4 -
package/source/zipapi/ZipFile.cxx | 49 +++++++--------
package/source/zipapi/ZipOutputStream.cxx | 8 +-
package/source/zippackage/ZipPackage.cxx | 6 -
package/source/zippackage/ZipPackageStream.cxx | 2
package/source/zippackage/zipfileaccess.cxx | 14 ++--
padmin/source/helper.cxx | 2
sc/source/core/data/documen8.cxx | 2
sc/source/core/data/global.cxx | 4 -
sc/source/core/tool/cellkeytranslator.cxx | 2
sc/source/core/tool/interpr1.cxx | 4 -
sc/source/ui/docshell/impex.cxx | 4 -
svl/inc/svl/ondemand.hxx | 5 -
sw/source/core/bastyp/init.cxx | 4 -
sw/source/core/edit/editsh.cxx | 2
sw/source/core/undo/unovwr.cxx | 2
sw/source/core/unocore/swunohelper.cxx | 9 --
ucb/source/ucp/cmis/cmis_content.cxx | 2
ucb/source/ucp/cmis/cmis_provider.cxx | 11 +--
ucb/source/ucp/cmis/cmis_provider.hxx | 2
ucb/source/ucp/ext/ucpext_provider.cxx | 11 +--
ucb/source/ucp/ext/ucpext_provider.hxx | 2
ucb/source/ucp/file/filrow.cxx | 3
ucb/source/ucp/file/filrset.cxx | 8 --
ucb/source/ucp/file/prov.cxx | 13 ++--
ucb/source/ucp/file/prov.hxx | 4 -
ucb/source/ucp/file/shell.cxx | 17 +----
ucb/source/ucp/file/shell.hxx | 5 -
ucb/source/ucp/ftp/ftpcontentprovider.cxx | 15 +---
ucb/source/ucp/ftp/ftpcontentprovider.hxx | 3
ucb/source/ucp/ftp/ftpresultsetI.cxx | 3
ucb/source/ucp/ftp/ftpresultsetbase.cxx | 10 +--
ucb/source/ucp/ftp/ftpresultsetbase.hxx | 4 -
ucb/source/ucp/gvfs/gvfs_content.cxx | 7 --
ucb/source/ucp/gvfs/gvfs_provider.cxx | 9 +-
ucb/source/ucp/gvfs/gvfs_provider.hxx | 2
ucb/source/ucp/hierarchy/hierarchycontent.cxx | 11 +--
ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 21 ++----
ucb/source/ucp/hierarchy/hierarchyprovider.hxx | 2
ucb/source/ucp/package/pkgcontent.cxx | 17 ++---
ucb/source/ucp/package/pkgprovider.cxx | 17 ++---
ucb/source/ucp/package/pkgprovider.hxx | 2
ucb/source/ucp/tdoc/tdoc_content.cxx | 18 ++---
ucb/source/ucp/tdoc/tdoc_provider.cxx | 11 +--
ucb/source/ucp/webdav-neon/NeonSession.cxx | 9 --
ucb/source/ucp/webdav-neon/webdavcontent.cxx | 14 +---
ucb/source/ucp/webdav-neon/webdavprovider.cxx | 11 +--
ucb/source/ucp/webdav-neon/webdavprovider.hxx | 2
ucbhelper/Library_ucbhelper.mk | 1
ucbhelper/inc/ucbhelper/contentidentifier.hxx | 7 --
ucbhelper/inc/ucbhelper/macros.hxx | 13 ++++
ucbhelper/inc/ucbhelper/providerhelper.hxx | 5 -
ucbhelper/inc/ucbhelper/resultsetmetadata.hxx | 6 -
ucbhelper/source/provider/contenthelper.cxx | 2
ucbhelper/source/provider/contentidentifier.cxx | 20 ------
ucbhelper/source/provider/providerhelper.cxx | 30 +++------
ucbhelper/source/provider/resultset.cxx | 3
ucbhelper/source/provider/resultsetmetadata.cxx | 50 +++++++---------
unotools/inc/unotools/confignode.hxx | 2
unotools/inc/unotools/transliterationwrapper.hxx | 8 --
unotools/source/config/confignode.cxx | 4 -
unotools/source/i18n/transliterationwrapper.cxx | 10 +--
vcl/source/app/i18nhelp.cxx | 3
vcl/source/app/settings.cxx | 2
vcl/source/window/toolbox2.cxx | 4 -
vcl/source/window/window.cxx | 2
xmlhelp/source/cxxhelp/provider/content.cxx | 21 +++---
xmlhelp/source/cxxhelp/provider/provider.cxx | 25 +++-----
xmlhelp/source/cxxhelp/provider/provider.hxx | 2
xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 10 +--
xmlhelp/source/cxxhelp/provider/resultsetbase.hxx | 6 -
xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 24 +++----
xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx | 4 -
xmlhelp/source/cxxhelp/provider/resultsetforroot.cxx | 4 -
xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx | 4 -
xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx | 1
xmlsecurity/qa/certext/SanCertExt.cxx | 6 -
xmlsecurity/source/helper/xmlsignaturehelper.cxx | 14 ----
xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 33 +++++-----
xmlsecurity/source/xmlsec/nss/nssinitializer.hxx | 16 ++---
xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx | 50 +++++++---------
xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx | 4 -
98 files changed, 471 insertions(+), 499 deletions(-)
New commits:
commit 7c884716a7bac9ebb18c748cefb89426563a195e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Nov 5 16:42:31 2012 +0100
fdo#46808: Slight simplifications of previous commit
Change-Id: I9e0158faa24d388176427529500f073b8b6f34bd
diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx
index 364d48f..792eb0f 100644
--- a/svl/inc/svl/ondemand.hxx
+++ b/svl/inc/svl/ondemand.hxx
@@ -31,15 +31,7 @@
#include <unotools/nativenumberwrapper.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace comphelper {
-
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
- getComponentContext(
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- const & factory);
-
-}
+#include <comphelper/processfactory.hxx>
/*
On demand instanciation and initialization of several i18n wrappers,
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index 517f510..517ed48 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -34,9 +34,9 @@ using namespace ::utl;
TransliterationWrapper::TransliterationWrapper(
const Reference< XComponentContext > & rxContext,
sal_uInt32 nTyp )
- : nType( nTyp ), nLanguage( 0 ), bFirstCall( sal_True )
+ : xTrans( Transliteration::create(rxContext) ), nType( nTyp ),
+ nLanguage( 0 ), bFirstCall( sal_True )
{
- xTrans = Transliteration::create(rxContext);
}
commit d2c45d0460cf99aadde1aaec11e032f488fa277b
Author: Noel Grandin <noel at peralex.com>
Date: Fri Nov 2 09:46:12 2012 +0200
fdo#46808, Adapt i18n::Transliteration UNO service to new style
Simply make the service implement XExtendedTransliteration, since all
of the implementatins already do that.
Change-Id: If03bf56a8d33931ad0230743a4603e2ae9b104ac
diff --git a/basic/source/classes/global.cxx b/basic/source/classes/global.cxx
index 324a18a..2907b5c 100644
--- a/basic/source/classes/global.cxx
+++ b/basic/source/classes/global.cxx
@@ -42,7 +42,7 @@ namespace
public:
lclTransliterationWrapper()
: m_aTransliteration(
- comphelper::getProcessServiceFactory(),
+ comphelper::getProcessComponentContext(),
com::sun::star::i18n::TransliterationModules_IGNORE_CASE )
{
const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index e189b28..5dab1a2 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1626,9 +1626,9 @@ RTLFUNC(StrComp)
::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper;
if( !pTransliterationWrapper )
{
- uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
pTransliterationWrapper = GetSbData()->pTransliterationWrapper =
- new ::utl::TransliterationWrapper( xSMgr,
+ new ::utl::TransliterationWrapper( xContext,
i18n::TransliterationModules_IGNORE_CASE |
i18n::TransliterationModules_IGNORE_KANA |
i18n::TransliterationModules_IGNORE_WIDTH );
@@ -4082,8 +4082,8 @@ RTLFUNC(StrConv)
String aNewStr( aOldStr );
if( nType != 0 )
{
- uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
- ::utl::TransliterationWrapper aTransliterationWrapper( xSMgr,nType );
+ uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
+ ::utl::TransliterationWrapper aTransliterationWrapper( xContext, nType );
uno::Sequence<sal_Int32> aOffsets;
aTransliterationWrapper.loadModuleIfNeeded( nLanguage );
aNewStr = aTransliterationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index d6ff77f..27a4029 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2704,7 +2704,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
sal_Bool bLenChanged = sal_False;
EditUndoTransliteration* pUndo = NULL;
- utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessServiceFactory(), nTransliterationMode );
+ utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessComponentContext(), nTransliterationMode );
sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index d6995f6..abfbfd7 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -196,7 +196,7 @@ static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang )
static TransliterationWrapper& GetIgnoreTranslWrapper()
{
static int bIsInit = 0;
- static TransliterationWrapper aWrp( GetProcessFact(),
+ static TransliterationWrapper aWrp( ::comphelper::getProcessComponentContext(),
::com::sun::star::i18n::TransliterationModules_IGNORE_KANA |
::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH );
if( !bIsInit )
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 115e481..b28c23a 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
+#include <com/sun/star/i18n/Transliteration.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx>
@@ -112,19 +113,12 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit.is() )
{
- Reference < XInterface > xI = xMSF->createInstance(
- OUString(
- "com.sun.star.i18n.Transliteration"));
- if ( xI.is() )
- xI->queryInterface( ::getCppuType(
- (const Reference< XExtendedTransliteration >*)0))
- >>= xTranslit;
+ xTranslit.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
}
// Load transliteration module
- if( xTranslit.is() )
- xTranslit->loadModule(
- (TransliterationModules)( aSrchPara.transliterateFlags & SIMPLE_TRANS_MASK ),
- aSrchPara.Locale);
+ xTranslit->loadModule(
+ (TransliterationModules)( aSrchPara.transliterateFlags & SIMPLE_TRANS_MASK ),
+ aSrchPara.Locale);
}
else if( xTranslit.is() )
xTranslit = 0;
@@ -134,19 +128,12 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit2.is() )
{
- Reference < XInterface > xI = xMSF->createInstance(
- OUString(
- "com.sun.star.i18n.Transliteration"));
- if ( xI.is() )
- xI->queryInterface( ::getCppuType(
- (const Reference< XExtendedTransliteration >*)0))
- >>= xTranslit2;
+ xTranslit2.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
}
// Load transliteration module
- if( xTranslit2.is() )
- xTranslit2->loadModule(
- (TransliterationModules)( aSrchPara.transliterateFlags & COMPLEX_TRANS_MASK ),
- aSrchPara.Locale);
+ xTranslit2->loadModule(
+ (TransliterationModules)( aSrchPara.transliterateFlags & COMPLEX_TRANS_MASK ),
+ aSrchPara.Locale);
}
if ( !xBreak.is() )
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index f5f641a..27025bb 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -155,6 +155,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\
BreakIterator \
LocaleCalendar \
LocaleData \
+ Transliteration \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/linguistic2,\
LanguageGuessing \
@@ -871,7 +872,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\
NumberFormatMapper \
OrdinalSuffix \
TextConversion \
- Transliteration \
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/image,\
ImageMap \
diff --git a/offapi/com/sun/star/i18n/Transliteration.idl b/offapi/com/sun/star/i18n/Transliteration.idl
index 2cc2bed..7e598f6 100644
--- a/offapi/com/sun/star/i18n/Transliteration.idl
+++ b/offapi/com/sun/star/i18n/Transliteration.idl
@@ -28,12 +28,7 @@ module com { module sun { module star { module i18n {
/// Transliteration of characters, such as case folding
-published service Transliteration
-{
- interface com::sun::star::i18n::XTransliteration;
-
- [optional] interface com::sun::star::i18n::XExtendedTransliteration;
-};
+published service Transliteration : XExtendedTransliteration;
}; }; }; };
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 14cba0b..af18ea9 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 4b66d43..4286cfd 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1512,7 +1512,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
{
OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" );
- utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType );
+ utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getComponentContext(xServiceManager), nType );
bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 4b9eaa6..378a2d4 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1117,7 +1117,7 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration()
{
const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
pTransliteration = new ::utl::TransliterationWrapper(
- ::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_IGNORECASE );
+ ::comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE );
pTransliteration->loadModuleIfNeeded( eOfficeLanguage );
}
OSL_ENSURE(
@@ -1165,7 +1165,7 @@ CollatorWrapper* ScGlobal::GetCaseCollator()
if ( !pCaseTransliteration )
{
const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
- pCaseTransliteration = new ::utl::TransliterationWrapper(::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_CASESENSE );
+ pCaseTransliteration = new ::utl::TransliterationWrapper(::comphelper::getProcessComponentContext(), SC_TRANSLITERATION_CASESENSE );
pCaseTransliteration->loadModuleIfNeeded( eOfficeLanguage );
}
return pCaseTransliteration;
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index ea63b57..1a654b5 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -179,7 +179,7 @@ void ScCellKeywordTranslator::transKeyword(rtl::OUString& rName, const Locale* p
}
ScCellKeywordTranslator::ScCellKeywordTranslator() :
- maTransWrapper( ::comphelper::getProcessServiceFactory(),
+ maTransWrapper( ::comphelper::getProcessComponentContext(),
i18n::TransliterationModules_LOWERCASE_UPPERCASE )
{
init();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3809aa4..3ff768e 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3248,7 +3248,7 @@ void ScInterpreter::ScChar()
static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr )
{
static bool bFirstASCCall = true;
- static utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), 0 );
+ static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 );
if( bFirstASCCall )
{
@@ -3263,7 +3263,7 @@ static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr )
static ::rtl::OUString lcl_convertIntoFullWidth( const ::rtl::OUString & rStr )
{
static bool bFirstJISCall = true;
- static utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), 0 );
+ static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 );
if( bFirstJISCall )
{
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index b56e937..6e65a15 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1293,7 +1293,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
// For date recognition
::utl::TransliterationWrapper aTransliteration(
- pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE );
+ comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE );
aTransliteration.loadModuleIfNeeded( eDocLang );
CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) );
aCalendar.loadDefaultCalendar(
@@ -1303,7 +1303,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( eDocLang != LANGUAGE_ENGLISH_US )
{
pEnglishTransliteration = new ::utl::TransliterationWrapper (
- pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE );
+ comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE );
aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US );
pEnglishCalendar = new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) );
pEnglishCalendar->loadDefaultCalendar(
diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx
index 4748850..364d48f 100644
--- a/svl/inc/svl/ondemand.hxx
+++ b/svl/inc/svl/ondemand.hxx
@@ -32,6 +32,15 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+namespace comphelper {
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ getComponentContext(
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ const & factory);
+
+}
+
/*
On demand instanciation and initialization of several i18n wrappers,
helping the number formatter to not perform worse than it already does.
@@ -300,7 +309,7 @@ public:
if ( !bValid )
{
if ( !pPtr )
- pPtr = new ::utl::TransliterationWrapper( xSMgr, nType );
+ pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType );
pPtr->loadModuleIfNeeded( eLanguage );
bValid = true;
}
@@ -310,7 +319,7 @@ public:
const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const
{
if ( !pPtr )
- pPtr = new ::utl::TransliterationWrapper( xSMgr, nType );
+ pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType );
pPtr->loadModuleByImplName( rModule, eLang );
bValid = false; // reforce settings change in get()
return pPtr;
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 71a5a89..3a725a7 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -865,9 +865,9 @@ namespace
public:
TransWrp()
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- xTransWrp.reset(new ::utl::TransliterationWrapper( xMSF,
+ xTransWrp.reset(new ::utl::TransliterationWrapper( xContext,
i18n::TransliterationModules_IGNORE_CASE |
i18n::TransliterationModules_IGNORE_KANA |
i18n::TransliterationModules_IGNORE_WIDTH ));
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index f216f3b..9199073 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -1126,7 +1126,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData )
void SwEditShell::TransliterateText( sal_uInt32 nType )
{
- utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
+ utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType );
StartAllAction();
SET_CURR_SHELL( this );
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index d5b810f..3c4899b 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -382,7 +382,7 @@ void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext)
void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam)
{
- utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
+ utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType );
rDoc.TransliterateText( rPam, aTrans );
}
diff --git a/unotools/inc/unotools/transliterationwrapper.hxx b/unotools/inc/unotools/transliterationwrapper.hxx
index 46f0a39..3a0a8de 100644
--- a/unotools/inc/unotools/transliterationwrapper.hxx
+++ b/unotools/inc/unotools/transliterationwrapper.hxx
@@ -25,8 +25,8 @@
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
namespace com { namespace sun { namespace star {
- namespace lang {
- class XMultiServiceFactory;
+ namespace uno {
+ class XComponentContext;
}
}}}
@@ -36,8 +36,6 @@ namespace utl
class UNOTOOLS_DLLPUBLIC TransliterationWrapper
{
::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
- ::com::sun::star::uno::Reference<
::com::sun::star::i18n::XExtendedTransliteration > xTrans;
::com::sun::star::lang::Locale aLocale;
sal_uInt32 nType;
@@ -53,7 +51,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
public:
TransliterationWrapper( const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > & xSF,
+ ::com::sun::star::uno::XComponentContext > & rxContext,
sal_uInt32 nType );
~TransliterationWrapper();
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index f663752..517f510 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -24,6 +24,7 @@
#include "instance.hxx"
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/i18n/Transliteration.hpp>
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::i18n;
@@ -31,14 +32,11 @@ using namespace ::com::sun::star::uno;
using namespace ::utl;
TransliterationWrapper::TransliterationWrapper(
- const Reference< XMultiServiceFactory > & xSF,
+ const Reference< XComponentContext > & rxContext,
sal_uInt32 nTyp )
- : xSMgr( xSF ), nType( nTyp ), nLanguage( 0 ), bFirstCall( sal_True )
+ : nType( nTyp ), nLanguage( 0 ), bFirstCall( sal_True )
{
- xTrans = Reference< XExtendedTransliteration > (
- intl_createInstance( xSMgr, "com.sun.star.i18n.Transliteration",
- "TransliterationWrapper" ), UNO_QUERY );
- DBG_ASSERT( xTrans.is(), "TransliterationWrapper: no Transliteraion available" );
+ xTrans = Transliteration::create(rxContext);
}
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 7e43afa..3c26810 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -27,6 +27,7 @@
************************************************************************/
+#include "comphelper/processfactory.hxx"
#include "unotools/localedatawrapper.hxx"
#include "unotools/transliterationwrapper.hxx"
@@ -72,7 +73,7 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co
if ( mbTransliterateIgnoreCase )
nModules |= i18n::TransliterationModules_IGNORE_CASE;
- ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( mxMSF, (i18n::TransliterationModules)nModules );
+ ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( comphelper::getComponentContext(mxMSF), (i18n::TransliterationModules)nModules );
((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( MsLangId::convertLocaleToLanguage( maLocale ) );
}
return *mpTransliterationWrapper;
diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx
index d4fc1cb..fe166e3 100644
--- a/xmlhelp/source/cxxhelp/provider/content.cxx
+++ b/xmlhelp/source/cxxhelp/provider/content.cxx
@@ -258,7 +258,7 @@ class ResultSetForQueryFactory
{
private:
- uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
+ uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< ucb::XContentProvider > m_xProvider;
sal_Int32 m_nOpenMode;
uno::Sequence< beans::Property > m_seq;
@@ -270,14 +270,14 @@ private:
public:
ResultSetForQueryFactory(
- const uno::Reference< lang::XMultiServiceFactory >& xSMgr,
+ const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< ucb::NumberedSortingInfo >& seqSort,
URLParameter aURLParameter,
Databases* pDatabases )
- : m_xSMgr( xSMgr ),
+ : m_xContext( rxContext ),
m_xProvider( xProvider ),
m_nOpenMode( nOpenMode ),
m_seq( seq ),
@@ -289,7 +289,7 @@ public:
ResultSetBase* createResultSet()
{
- return new ResultSetForQuery( m_xSMgr,
+ return new ResultSetForQuery( m_xContext,
m_xProvider,
m_nOpenMode,
m_seq,
@@ -420,7 +420,7 @@ uno::Any SAL_CALL Content::execute(
aOpenCommand,
Environment,
new ResultSetForQueryFactory(
- m_xSMgr,
+ comphelper::getComponentContext(m_xSMgr),
m_xProvider.get(),
aOpenCommand.Mode,
aOpenCommand.Properties,
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index 93f3e4d..97f3232 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -29,7 +29,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/ucb/Command.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
+#include <com/sun/star/i18n/Transliteration.hpp>
#include <com/sun/star/ucb/XCommandProcessor.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/script/XInvocation.hpp>
@@ -88,25 +88,22 @@ struct HitItem
}
};
-ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceFactory >& xMSF,
+ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< NumberedSortingInfo >& seqSort,
URLParameter& aURLParameter,
Databases* pDatabases )
- : ResultSetBase( comphelper::getComponentContext(xMSF),xProvider,nOpenMode,seq,seqSort ),
+ : ResultSetBase( rxContext,xProvider,nOpenMode,seq,seqSort ),
m_aURLParameter( aURLParameter )
{
- Reference< XTransliteration > xTrans(
- xMSF->createInstance( rtl::OUString( "com.sun.star.i18n.Transliteration" ) ),
- UNO_QUERY );
+ Reference< XExtendedTransliteration > xTrans = Transliteration::create( rxContext );
Locale aLocale( aURLParameter.get_language(),
rtl::OUString(),
rtl::OUString() );
- if(xTrans.is())
- xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE,
- aLocale );
+ xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE,
+ aLocale );
vector< vector< rtl::OUString > > queryList;
{
@@ -121,11 +118,9 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceF
vector< rtl::OUString > currentQuery;
rtl::OUString tmp(query.copy( 0,idx ));
rtl:: OUString toliterate = tmp;
- if(xTrans.is()) {
- Sequence<sal_Int32> aSeq;
- toliterate = xTrans->transliterate(
- tmp,0,tmp.getLength(),aSeq);
- }
+ Sequence<sal_Int32> aSeq;
+ toliterate = xTrans->transliterate(
+ tmp,0,tmp.getLength(),aSeq);
currentQuery.push_back( toliterate );
queryList.push_back( currentQuery );
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx
index 8f7d7f3..fca1bfb 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx
@@ -19,7 +19,7 @@
#ifndef _RESULTSETFORQUERY_HXX
#define _RESULTSETFORQUERY_HXX
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
@@ -36,7 +36,7 @@ namespace chelp {
{
public:
- ResultSetForQuery( const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& xMSF,
+ ResultSetForQuery( const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxContext,
const com::sun::star::uno::Reference<com::sun::star::ucb::XContentProvider>& xProvider,
sal_Int32 nOpenMode,
const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& seq,
commit ec1c96a9b69a5a2546fe2564cd92fe9e33471fbc
Author: Noel Grandin <noel at peralex.com>
Date: Thu Nov 1 15:01:34 2012 +0200
fdo#46808,remove unnecessary MSF field from ucbhelper::ContentIdentifier
...which has lots of nice knock-on effects.
Change-Id: Icc93fdb70f24903b08702654db4e1105eb1d438e
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 08cdd7e..9ef5a1d 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -96,7 +96,7 @@ Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw
::rtl::OUStringBuffer aIdentifier;
aIdentifier.appendAscii( "private:" );
aIdentifier.append( impl_getHierarchicalName( true ) );
- return new ::ucbhelper::ContentIdentifier( m_aContext.getLegacyServiceFactory(), aIdentifier.makeStringAndClear() );
+ return new ::ucbhelper::ContentIdentifier( aIdentifier.makeStringAndClear() );
}
::rtl::OUString OContentHelper::impl_getHierarchicalName( bool _includingRootContainer ) const
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 6397eeb..080d278 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -123,19 +123,14 @@ sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL )
sal_Bool bCaseSensitive;
try
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF =
- comphelper::getProcessServiceFactory();
-
INetURLObject aTempObj( rURL );
aTempObj.SetBase( aTempObj.GetBase().toAsciiLowerCase() );
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xRef1 = new
- ucbhelper::ContentIdentifier( xMSF,
- aTempObj.GetMainURL( INetURLObject::NO_DECODE ));
+ ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE ));
aTempObj.SetBase(aTempObj.GetBase().toAsciiUpperCase());
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xRef2 = new
- ucbhelper::ContentIdentifier( xMSF,
- aTempObj.GetMainURL( INetURLObject::NO_DECODE ));
+ ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE ));
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XUniversalContentBroker > xUcb =
com::sun::star::ucb::UniversalContentBroker::create(comphelper::getProcessComponentContext());
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 83551b2..376466b 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1520,7 +1520,7 @@ namespace cmis
URL aParentURL( sParentURL );
// Set the parent URL for the transient objects
- uno::Reference< ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(m_xSMgr, sParentURL));
+ uno::Reference< ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(sParentURL));
try
{
diff --git a/ucb/source/ucp/ext/ucpext_provider.cxx b/ucb/source/ucp/ext/ucpext_provider.cxx
index 18e0e32..0e9de11 100644
--- a/ucb/source/ucp/ext/ucpext_provider.cxx
+++ b/ucb/source/ucp/ext/ucpext_provider.cxx
@@ -172,7 +172,7 @@ namespace ucb { namespace ucp { namespace ext
}
}
}
- const Reference< XContentIdentifier > xNormalizedIdentifier( new ::ucbhelper::ContentIdentifier( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), aComposer.makeStringAndClear() ) );
+ const Reference< XContentIdentifier > xNormalizedIdentifier( new ::ucbhelper::ContentIdentifier( aComposer.makeStringAndClear() ) );
::osl::MutexGuard aGuard( m_aMutex );
diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx
index f723d40..524a614 100644
--- a/ucb/source/ucp/ftp/ftpresultsetI.cxx
+++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx
@@ -18,6 +18,7 @@
*/
+#include "comphelper/processfactory.hxx"
#include "ucbhelper/propertyvalueset.hxx"
#include "rtl/ref.hxx"
#include "com/sun/star/ucb/Command.hpp"
@@ -43,7 +44,7 @@ ResultSetI::ResultSetI(const Reference<XMultiServiceFactory>& xMSF,
const Sequence<Property>& seqProp,
const Sequence< NumberedSortingInfo >& seqSort,
const std::vector<FTPDirentry>& dirvec)
- : ResultSetBase(xMSF,xProvider,nOpenMode,seqProp,seqSort)
+ : ResultSetBase(comphelper::getComponentContext(xMSF),xProvider,nOpenMode,seqProp,seqSort)
{
for( unsigned int i = 0; i < dirvec.size(); ++i)
m_aPath.push_back(dirvec[i].m_aURL);
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
index b6e68d7..3323f30 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
@@ -31,12 +31,12 @@ using namespace ftp;
using namespace com::sun::star;
ResultSetBase::ResultSetBase(
- const uno::Reference< lang::XMultiServiceFactory >& xMSF,
+ const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< ucb::NumberedSortingInfo >& seqSort )
- : m_xMSF( xMSF ),
+ : m_xContext( rxContext ),
m_xProvider( xProvider ),
m_nRow( -1 ),
m_nWasNull( true ),
@@ -409,7 +409,7 @@ ResultSetBase::queryContentIdentifier(
if(!url.isEmpty() )
m_aIdents[m_nRow] =
uno::Reference< ucb::XContentIdentifier >(
- new ::ucbhelper::ContentIdentifier(m_xMSF,url) );
+ new ::ucbhelper::ContentIdentifier(url) );
}
return m_aIdents[m_nRow];
}
@@ -641,8 +641,7 @@ ResultSetBase::getMetaData(
uno::RuntimeException )
{
::ucbhelper::ResultSetMetaData* p =
- new ::ucbhelper::ResultSetMetaData(
- comphelper::getComponentContext(m_xMSF), m_sProperty );
+ new ::ucbhelper::ResultSetMetaData( m_xContext, m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.hxx b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
index 99c7ae2..805cbf4 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.hxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
@@ -51,7 +51,7 @@ namespace ftp {
public:
ResultSetBase(const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference<
com::sun::star::ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
@@ -562,7 +562,7 @@ namespace ftp {
protected:
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xMSF;
+ com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference<
com::sun::star::ucb::XContentProvider > m_xProvider;
sal_Int32 m_nRow;
diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx
index d3b3083..d53b752 100644
--- a/ucb/source/ucp/gvfs/gvfs_content.cxx
+++ b/ucb/source/ucp/gvfs/gvfs_content.cxx
@@ -514,7 +514,7 @@ Content::createNewContent( const ucb::ContentInfo& Info )
aURL += rtl::OUString::createFromAscii( name );
uno::Reference< ucb::XContentIdentifier > xId
- ( new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) );
+ ( new ::ucbhelper::ContentIdentifier( aURL ) );
try {
return new ::gvfs::Content( m_xSMgr, m_pProvider, xId, !create_document );
@@ -853,8 +853,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
if ( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) {
uno::Reference< ucb::XContentIdentifier > xNewId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, makeNewURL( newInfo.name ) );
+ = new ::ucbhelper::ContentIdentifier( makeNewURL( newInfo.name ) );
aGuard.clear();
if (!exchangeIdentity( xNewId ) )
@@ -1100,7 +1099,7 @@ sal_Bool Content::exchangeIdentity(
xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier >
xNewChildId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewChildURL );
+ = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) )
return sal_False;
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index af0ff20..efa433c 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -616,7 +616,7 @@ HierarchyContent::createNewContent( const ucb::ContentInfo& Info )
aURL += rtl::OUString("New_Link");
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL );
+ = new ::ucbhelper::ContentIdentifier( aURL );
return create( m_xSMgr, m_pProvider, xId, Info );
}
@@ -775,7 +775,7 @@ HierarchyContent::makeNewIdentifier( const rtl::OUString& rTitle )
aNewURL += ::ucb_impl::urihelper::encodeSegment( rTitle );
return uno::Reference< ucb::XContentIdentifier >(
- new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewURL ) );
+ new ::ucbhelper::ContentIdentifier( aNewURL ) );
}
//=========================================================================
@@ -892,8 +892,7 @@ sal_Bool HierarchyContent::exchangeIdentity(
aOldURL.getLength(),
xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier > xNewChildId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aNewChildURL );
+ = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) )
return sal_False;
@@ -1451,7 +1450,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve,
rtl::OUString aNewId = xId->getContentIdentifier();
aNewId += rtl::OUString("_");
aNewId += rtl::OUString::valueOf( ++nTry );
- xId = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewId );
+ xId = new ::ucbhelper::ContentIdentifier( aNewId );
}
while ( hasData( xId ) && ( nTry < 1000 ) );
@@ -1650,7 +1649,7 @@ void HierarchyContent::transfer(
//////////////////////////////////////////////////////////////////////
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, rInfo.SourceURL );
+ = new ::ucbhelper::ContentIdentifier( rInfo.SourceURL );
// Note: The static cast is okay here, because its sure that
// m_xProvider is always the HierarchyContentProvider.
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index 73c1be5..e528dad 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -120,9 +120,7 @@ HierarchyContentProvider::queryContent(
// Encode URL and create new Id. This may "correct" user-typed-in URL's.
uno::Reference< ucb::XContentIdentifier > xCanonicId
- = new ::ucbhelper::ContentIdentifier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW),
- ::ucb_impl::urihelper::encodeURI(
- aUri.getUri() ) );
+ = new ::ucbhelper::ContentIdentifier( ::ucb_impl::urihelper::encodeURI( aUri.getUri() ) );
osl::MutexGuard aGuard( m_aMutex );
// Check, if a content with given id already exists...
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx
index 0affd59..7bef455 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -168,7 +168,7 @@ Content* Content::create(
}
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( rxSMgr, aURI.getUri() );
+ = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
return new Content( rxSMgr, pProvider, xId, xPackage, aURI, aProps );
}
else
@@ -183,7 +183,7 @@ Content* Content::create(
bFolder = sal_True;
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( rxSMgr, aURI.getUri() );
+ = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
ucb::ContentInfo aInfo;
if ( bFolder || aURI.isRootFolder() )
@@ -219,7 +219,7 @@ Content* Content::create(
xPackage = pProvider->createPackage( aURI.getPackage(), aURI.getParam() );
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( rxSMgr, aURI.getUri() );
+ = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
return new Content( rxSMgr, pProvider, xId, xPackage, aURI, Info );
}
@@ -736,7 +736,7 @@ Content::createNewContent( const ucb::ContentInfo& Info )
aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("New_Stream"));
uno::Reference< ucb::XContentIdentifier > xId(
- new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) );
+ new ::ucbhelper::ContentIdentifier( aURL ) );
return create( m_xSMgr, m_pProvider, xId, Info );
}
@@ -1373,7 +1373,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
aNewURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
aNewURL += ::ucb_impl::urihelper::encodeSegment( aNewTitle );
uno::Reference< ucb::XContentIdentifier > xNewId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewURL );
+ = new ::ucbhelper::ContentIdentifier( aNewURL );
aGuard.clear();
if ( exchangeIdentity( xNewId ) )
@@ -1717,7 +1717,7 @@ void Content::insert(
if ( bNewId )
{
- m_xIdentifier = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewURL );
+ m_xIdentifier = new ::ucbhelper::ContentIdentifier( aNewURL );
m_aUri = aNewUri;
}
@@ -1863,7 +1863,7 @@ void Content::transfer(
//////////////////////////////////////////////////////////////////////
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, rInfo.SourceURL );
+ = new ::ucbhelper::ContentIdentifier( rInfo.SourceURL );
// Note: The static cast is okay here, because its sure that
// m_xProvider is always the PackageContentProvider.
@@ -2147,8 +2147,7 @@ sal_Bool Content::exchangeIdentity(
aOldURL.getLength(),
xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier > xNewChildId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aNewChildURL );
+ = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) )
return sal_False;
diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx
index 15bd291..c373d54 100644
--- a/ucb/source/ucp/package/pkgprovider.cxx
+++ b/ucb/source/ucp/package/pkgprovider.cxx
@@ -204,8 +204,7 @@ uno::Reference< ucb::XContent > SAL_CALL ContentProvider::queryContent(
// Create a new identifier for the mormalized URL returned by
// PackageUri::getUri().
- uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), aUri.getUri() );
+ uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aUri.getUri() );
osl::MutexGuard aGuard( m_aMutex );
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index 7c0d9ac..6b8e17b 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -724,7 +724,7 @@ Content::createNewContent( const ucb::ContentInfo& Info )
aURL += rtl::OUString("New_Stream");
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL );
+ = new ::ucbhelper::ContentIdentifier( aURL );
return create( m_xSMgr, m_pProvider, xId, Info );
}
@@ -757,8 +757,7 @@ Content::makeNewIdentifier( const rtl::OUString& rTitle )
return
uno::Reference< ucb::XContentIdentifier >(
- new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aNewURL.makeStringAndClear() ) );
+ new ::ucbhelper::ContentIdentifier( aNewURL.makeStringAndClear() ) );
}
//=========================================================================
@@ -879,8 +878,7 @@ sal_Bool Content::exchangeIdentity(
aOldURL.getLength(),
xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier > xNewChildId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aNewChildURL );
+ = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) )
return sal_False;
@@ -1730,7 +1728,7 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData,
if ( bNewId )
{
m_xIdentifier
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewUri.getUri() );
+ = new ::ucbhelper::ContentIdentifier( aNewUri.getUri() );
}
if ( !storeData( xData, xEnv ) )
@@ -1846,8 +1844,7 @@ Content::queryChildContent( const rtl::OUString & rRelativeChildUri )
aBuf.append( rRelativeChildUri.copy( 1 ) );
uno::Reference< ucb::XContentIdentifier > xChildId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aBuf.makeStringAndClear() );
+ = new ::ucbhelper::ContentIdentifier( aBuf.makeStringAndClear() );
uno::Reference< ucb::XContent > xChild;
try
@@ -2134,7 +2131,7 @@ void Content::transfer(
try
{
uno::Reference< ucb::XContentIdentifier > xTargetId
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aTargetUri );
+ = new ::ucbhelper::ContentIdentifier( aTargetUri );
// Note: The static cast is okay here, because its sure that
// m_xProvider is always the WebDAVContentProvider.
@@ -2177,8 +2174,7 @@ void Content::transfer(
try
{
uno::Reference< ucb::XContentIdentifier >
- xSourceId = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, rInfo.SourceURL );
+ xSourceId = new ::ucbhelper::ContentIdentifier( rInfo.SourceURL );
// Note: The static cast is okay here, because its sure
// that m_xProvider is always the ContentProvider.
diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx
index b1b9385..f9b5ba9 100644
--- a/ucb/source/ucp/tdoc/tdoc_provider.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx
@@ -130,7 +130,7 @@ ContentProvider::queryContent(
// Normalize URI.
uno::Reference< ucb::XContentIdentifier > xCanonicId
- = new ::ucbhelper::ContentIdentifier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), aUri.getUri() );
+ = new ::ucbhelper::ContentIdentifier( aUri.getUri() );
osl::MutexGuard aGuard( m_aMutex );
@@ -171,8 +171,7 @@ ContentProvider::createDocumentContent(
aBuffer.append( aDocId );
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier(
- uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), aBuffer.makeStringAndClear() );
+ = new ::ucbhelper::ContentIdentifier( aBuffer.makeStringAndClear() );
osl::MutexGuard aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 9034c86..e2fd4c2 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -992,7 +992,7 @@ Content::createNewContent( const ucb::ContentInfo& Info )
}
uno::Reference< ucb::XContentIdentifier > xId(
- new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) );
+ new ::ucbhelper::ContentIdentifier( aURL ) );
// create the local content
try
@@ -1756,7 +1756,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
aNewURL += NeonUri::escapeSegment( aNewTitle );
uno::Reference< ucb::XContentIdentifier > xNewId
- = new ::ucbhelper::ContentIdentifier( xSMgr, aNewURL );
+ = new ::ucbhelper::ContentIdentifier( aNewURL );
uno::Reference< ucb::XContentIdentifier > xOldId = xIdentifier;
try
@@ -2365,8 +2365,7 @@ void Content::insert(
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
- m_xIdentifier
- = new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL );
+ m_xIdentifier = new ::ucbhelper::ContentIdentifier( aURL );
}
inserted();
@@ -2512,7 +2511,7 @@ void Content::transfer(
aTargetURL += aTitle;
uno::Reference< ucb::XContentIdentifier > xTargetId
- = new ::ucbhelper::ContentIdentifier( xSMgr, aTargetURL );
+ = new ::ucbhelper::ContentIdentifier( aTargetURL );
DAVResourceAccess aSourceAccess( comphelper::getComponentContext(xSMgr),
xResAccess->getSessionFactory(),
@@ -2521,7 +2520,7 @@ void Content::transfer(
if ( rArgs.MoveData == sal_True )
{
uno::Reference< ucb::XContentIdentifier > xId
- = new ::ucbhelper::ContentIdentifier( xSMgr, rArgs.SourceURL );
+ = new ::ucbhelper::ContentIdentifier( rArgs.SourceURL );
// Note: The static cast is okay here, because its sure that
// xProvider is always the WebDAVContentProvider.
@@ -2820,8 +2819,7 @@ sal_Bool Content::exchangeIdentity(
aOldURL.getLength(),
xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier > xNewChildId
- = new ::ucbhelper::ContentIdentifier(
- m_xSMgr, aNewChildURL );
+ = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) )
return sal_False;
diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx b/ucb/source/ucp/webdav-neon/webdavprovider.cxx
index f398512..49ee82c 100644
--- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx
@@ -181,7 +181,7 @@ ContentProvider::queryContent(
}
if ( bNewId )
- xCanonicId = new ::ucbhelper::ContentIdentifier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), aURL );
+ xCanonicId = new ::ucbhelper::ContentIdentifier( aURL );
else
xCanonicId = Identifier;
diff --git a/ucbhelper/inc/ucbhelper/contentidentifier.hxx b/ucbhelper/inc/ucbhelper/contentidentifier.hxx
index 8fb73d9..31f0a27 100644
--- a/ucbhelper/inc/ucbhelper/contentidentifier.hxx
+++ b/ucbhelper/inc/ucbhelper/contentidentifier.hxx
@@ -25,10 +25,6 @@
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include "ucbhelper/ucbhelperdllapi.h"
-namespace com { namespace sun { namespace star { namespace lang {
- class XMultiServiceFactory;
-} } } }
-
namespace rtl {
class OUString;
}
@@ -52,9 +48,6 @@ class UCBHELPER_DLLPUBLIC ContentIdentifier :
public com::sun::star::ucb::XContentIdentifier
{
public:
- ContentIdentifier( const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
- const rtl::OUString& rURL );
ContentIdentifier( const rtl::OUString& rURL );
virtual ~ContentIdentifier();
diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx
index 39e08fc..e09a5ab 100644
--- a/ucbhelper/source/provider/contenthelper.cxx
+++ b/ucbhelper/source/provider/contenthelper.cxx
@@ -774,7 +774,7 @@ uno::Reference< uno::XInterface > SAL_CALL ContentImplHelper::getParent()
if ( !aURL.isEmpty() )
{
uno::Reference< com::sun::star::ucb::XContentIdentifier > xId(
- new ContentIdentifier( m_xSMgr, aURL ) );
+ new ContentIdentifier( aURL ) );
try
{
xParent.set( m_xProvider->queryContent( xId ) );
diff --git a/ucbhelper/source/provider/contentidentifier.cxx b/ucbhelper/source/provider/contentidentifier.cxx
index c8dd27f..e99b67f 100644
--- a/ucbhelper/source/provider/contentidentifier.cxx
+++ b/ucbhelper/source/provider/contentidentifier.cxx
@@ -47,13 +47,11 @@ namespace ucbhelper
struct ContentIdentifier_Impl
{
- Reference< XMultiServiceFactory > m_xSMgr;
OUString m_aContentId;
OUString m_aProviderScheme;
osl::Mutex m_aMutex;
- ContentIdentifier_Impl( const Reference< XMultiServiceFactory >& rSMgr,
- const OUString& rURL );
+ ContentIdentifier_Impl( const OUString& rURL );
};
//=========================================================================
@@ -62,10 +60,7 @@ struct ContentIdentifier_Impl
//
//=========================================================================
-ContentIdentifier_Impl::ContentIdentifier_Impl(
- const Reference< XMultiServiceFactory >& rSMgr,
- const OUString& rURL )
-: m_xSMgr( rSMgr )
+ContentIdentifier_Impl::ContentIdentifier_Impl(const OUString& rURL )
{
// Normalize URL scheme ( it's case insensitive ).
@@ -86,18 +81,9 @@ ContentIdentifier_Impl::ContentIdentifier_Impl(
//
//=========================================================================
-ContentIdentifier::ContentIdentifier(
- const Reference< XMultiServiceFactory >& rxSMgr,
- const OUString& rURL )
-{
- m_pImpl = new ContentIdentifier_Impl( rxSMgr, rURL );
-}
-
-//=========================================================================
ContentIdentifier::ContentIdentifier( const OUString& rURL )
{
- m_pImpl = new ContentIdentifier_Impl(
- Reference< XMultiServiceFactory >(), rURL );
+ m_pImpl = new ContentIdentifier_Impl( rURL );
}
//=========================================================================
diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx
index 55ceac6..d4fc1cb 100644
--- a/xmlhelp/source/cxxhelp/provider/content.cxx
+++ b/xmlhelp/source/cxxhelp/provider/content.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/io/XActiveDataStreamer.hpp>
#include <com/sun/star/ucb/XPersistentPropertySet.hpp>
#include <osl/diagnose.h>
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/propertyvalueset.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
@@ -209,7 +210,7 @@ class ResultSetForRootFactory
{
private:
- uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
+ uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< ucb::XContentProvider > m_xProvider;
sal_Int32 m_nOpenMode;
uno::Sequence< beans::Property > m_seq;
@@ -221,14 +222,14 @@ private:
public:
ResultSetForRootFactory(
- const uno::Reference< lang::XMultiServiceFactory >& xSMgr,
+ const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< ucb::NumberedSortingInfo >& seqSort,
URLParameter aURLParameter,
Databases* pDatabases )
- : m_xSMgr( xSMgr ),
+ : m_xContext( xContext ),
m_xProvider( xProvider ),
m_nOpenMode( nOpenMode ),
m_seq( seq ),
@@ -240,7 +241,7 @@ public:
ResultSetBase* createResultSet()
{
- return new ResultSetForRoot( m_xSMgr,
+ return new ResultSetForRoot( m_xContext,
m_xProvider,
m_nOpenMode,
m_seq,
@@ -401,7 +402,7 @@ uno::Any SAL_CALL Content::execute(
aOpenCommand,
Environment,
new ResultSetForRootFactory(
- m_xSMgr,
+ comphelper::getComponentContext(m_xSMgr),
m_xProvider.get(),
aOpenCommand.Mode,
aOpenCommand.Properties,
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
index eb124bf..7a004fb 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
@@ -40,12 +40,12 @@
using namespace chelp;
using namespace com::sun::star;
-ResultSetBase::ResultSetBase( const uno::Reference< lang::XMultiServiceFactory >& xMSF,
+ResultSetBase::ResultSetBase( const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< ucb::NumberedSortingInfo >& seqSort )
- : m_xMSF( xMSF ),
+ : m_xContext( rxContext ),
m_xProvider( xProvider ),
m_nRow( -1 ),
m_nWasNull( true ),
@@ -413,7 +413,7 @@ ResultSetBase::queryContentIdentifier(
rtl::OUString url = queryContentIdentifierString();
if( ! m_aIdents[m_nRow].is() && !url.isEmpty() )
m_aIdents[m_nRow] = uno::Reference< ucb::XContentIdentifier >(
- new ::ucbhelper::ContentIdentifier( m_xMSF,url ) );
+ new ::ucbhelper::ContentIdentifier( url ) );
return m_aIdents[m_nRow];
}
@@ -648,8 +648,7 @@ ResultSetBase::getMetaData(
uno::RuntimeException )
{
::ucbhelper::ResultSetMetaData* p =
- new ::ucbhelper::ResultSetMetaData(
- comphelper::getComponentContext(m_xMSF), m_sProperty );
+ new ::ucbhelper::ResultSetMetaData( m_xContext, m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
index f592d11..f74f023 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XContentIdentifier.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/Property.hpp>
@@ -50,7 +50,7 @@ namespace chelp {
{
public:
- ResultSetBase( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ ResultSetBase( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& seq,
@@ -533,7 +533,7 @@ namespace chelp {
protected:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider > m_xProvider;
sal_Int32 m_nRow;
bool m_nWasNull;
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index 7129b84..93f3e4d 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/ucb/Command.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
@@ -94,7 +95,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceF
const uno::Sequence< NumberedSortingInfo >& seqSort,
URLParameter& aURLParameter,
Databases* pDatabases )
- : ResultSetBase( xMSF,xProvider,nOpenMode,seq,seqSort ),
+ : ResultSetBase( comphelper::getComponentContext(xMSF),xProvider,nOpenMode,seq,seqSort ),
m_aURLParameter( aURLParameter )
{
Reference< XTransliteration > xTrans(
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforroot.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforroot.cxx
index f570256..b3dd5a6 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforroot.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforroot.cxx
@@ -39,14 +39,14 @@ using namespace com::sun::star::ucb;
-ResultSetForRoot::ResultSetForRoot( const uno::Reference< lang::XMultiServiceFactory >& xMSF,
+ResultSetForRoot::ResultSetForRoot( const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const uno::Sequence< beans::Property >& seq,
const uno::Sequence< NumberedSortingInfo >& seqSort,
URLParameter& aURLParameter,
Databases* pDatabases )
- : ResultSetBase( xMSF,xProvider,nOpenMode,seq,seqSort ),
+ : ResultSetBase( rxContext, xProvider,nOpenMode,seq,seqSort ),
m_aURLParameter( aURLParameter ),
m_pDatabases( pDatabases )
{
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx b/xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx
index b0e9f04..83ae9b7 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx
@@ -19,7 +19,7 @@
#ifndef _RESULTSETFORROOT_HXX
#define _RESULTSETFORROOT_HXX
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
@@ -36,7 +36,7 @@ namespace chelp {
{
public:
- ResultSetForRoot( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ ResultSetForRoot( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >& xProvider,
sal_Int32 nOpenMode,
const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& seq,
commit 41a71413f4ebe69a48ee068fd5c785d6015c0cca
Author: Noel Grandin <noel at peralex.com>
Date: Thu Nov 1 13:25:57 2012 +0200
fdo#46808, use service constructor for ucb::PropertiesManager
Change-Id: Ib0c7375ac9f72647b10adcb2cea8a0f8e2fdcca0
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index d343b1c..86860da 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -772,7 +772,7 @@ XResultSet_impl::getMetaData(
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW),
+ m_pMyShell->m_xContext,
m_sProperty,
aColumnData );
return uno::Reference< sdbc::XResultSetMetaData >( p );
@@ -780,8 +780,7 @@ XResultSet_impl::getMetaData(
}
::ucbhelper::ResultSetMetaData* p =
- new ::ucbhelper::ResultSetMetaData(
- uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), m_sProperty );
+ new ::ucbhelper::ResultSetMetaData( m_pMyShell->m_xContext, m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
index 701c2e7..b6e68d7 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -641,7 +642,7 @@ ResultSetBase::getMetaData(
{
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_xMSF, m_sProperty );
+ comphelper::getComponentContext(m_xMSF), m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucbhelper/Library_ucbhelper.mk b/ucbhelper/Library_ucbhelper.mk
index 73b1afc..ff92193 100644
--- a/ucbhelper/Library_ucbhelper.mk
+++ b/ucbhelper/Library_ucbhelper.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_Library_use_package,ucbhelper,ucbhelper_inc))
$(eval $(call gb_Library_use_sdk_api,ucbhelper))
$(eval $(call gb_Library_use_libraries,ucbhelper,\
+ comphelper \
cppu \
cppuhelper \
sal \
diff --git a/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
index 0b5b331..129f1f8 100644
--- a/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
+++ b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
@@ -145,7 +145,7 @@ private:
protected:
::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property > m_aProps;
sal_Bool m_bReadOnly;
@@ -163,7 +163,7 @@ public:
*/
ResultSetMetaData(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property >& rProps,
sal_Bool bReadOnly = sal_True );
@@ -183,7 +183,7 @@ public:
*/
ResultSetMetaData(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property >& rProps,
const std::vector< ResultSetColumnData >& rColumnData );
diff --git a/ucbhelper/source/provider/resultset.cxx b/ucbhelper/source/provider/resultset.cxx
index 9af7a6d..281434f 100644
--- a/ucbhelper/source/provider/resultset.cxx
+++ b/ucbhelper/source/provider/resultset.cxx
@@ -23,6 +23,7 @@
**************************************************************************
*************************************************************************/
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <ucbhelper/resultset.hxx>
@@ -371,7 +372,7 @@ uno::Reference< sdbc::XResultSetMetaData > SAL_CALL ResultSet::getMetaData()
osl::MutexGuard aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xMetaData.is() )
- m_pImpl->m_xMetaData = new ResultSetMetaData( m_pImpl->m_xSMgr,
+ m_pImpl->m_xMetaData = new ResultSetMetaData( comphelper::getComponentContext(m_pImpl->m_xSMgr),
m_pImpl->m_aProperties );
return m_pImpl->m_xMetaData;
diff --git a/ucbhelper/source/provider/resultsetmetadata.cxx b/ucbhelper/source/provider/resultsetmetadata.cxx
index 1d7c8dc..13e94ed 100644
--- a/ucbhelper/source/provider/resultsetmetadata.cxx
+++ b/ucbhelper/source/provider/resultsetmetadata.cxx
@@ -37,12 +37,14 @@
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/ucb/PropertiesManager.hpp>
#include <ucbhelper/resultsetmetadata.hxx>
using namespace com::sun::star::beans;
using namespace com::sun::star::io;
using namespace com::sun::star::lang;
using namespace com::sun::star::sdbc;
+using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
using namespace com::sun::star::util;
@@ -82,11 +84,11 @@ namespace ucbhelper {
//=========================================================================
ResultSetMetaData::ResultSetMetaData(
- const Reference< XMultiServiceFactory >& rxSMgr,
+ const Reference< XComponentContext >& rxContext,
const Sequence< Property >& rProps,
sal_Bool bReadOnly )
: m_pImpl( new ResultSetMetaData_Impl( rProps.getLength() ) ),
- m_xSMgr( rxSMgr ),
+ m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( bReadOnly )
{
@@ -94,11 +96,11 @@ ResultSetMetaData::ResultSetMetaData(
//=========================================================================
ResultSetMetaData::ResultSetMetaData(
- const Reference< XMultiServiceFactory >& rxSMgr,
+ const Reference< XComponentContext >& rxContext,
const Sequence< Property >& rProps,
const std::vector< ResultSetColumnData >& rColumnData )
: m_pImpl( new ResultSetMetaData_Impl( rColumnData ) ),
- m_xSMgr( rxSMgr ),
+ m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( sal_True )
{
@@ -400,35 +402,27 @@ sal_Int32 SAL_CALL ResultSetMetaData::getColumnType( sal_Int32 column )
{
try
{
- Reference< XPropertySetInfo > xInfo(
- m_xSMgr->createInstance(
- OUString(
- "com.sun.star.ucb.PropertiesManager" ) ),
- UNO_QUERY );
- if ( xInfo.is() )
- {
-
+ Reference< XPropertySetInfo > xInfo = PropertiesManager::create( m_xContext );
// Less (remote) calls...
- Sequence< Property > aProps = xInfo->getProperties();
- const Property* pProps1 = aProps.getConstArray();
- sal_Int32 nCount1 = aProps.getLength();
+ Sequence< Property > aProps = xInfo->getProperties();
+ const Property* pProps1 = aProps.getConstArray();
+ sal_Int32 nCount1 = aProps.getLength();
- sal_Int32 nCount = m_aProps.getLength();
- Property* pProps = m_aProps.getArray();
- for ( sal_Int32 n = 0; n < nCount; ++n )
- {
- Property& rProp = pProps[ n ];
+ sal_Int32 nCount = m_aProps.getLength();
+ Property* pProps = m_aProps.getArray();
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ Property& rProp = pProps[ n ];
- for ( sal_Int32 m = 0; m < nCount1; ++m )
+ for ( sal_Int32 m = 0; m < nCount1; ++m )
+ {
+ const Property& rProp1 = pProps1[ m ];
+ if ( rProp.Name == rProp1.Name )
{
- const Property& rProp1 = pProps1[ m ];
- if ( rProp.Name == rProp1.Name )
- {
- // Found...
- rProp.Type = rProp1.Type;
- break;
- }
+ // Found...
+ rProp.Type = rProp1.Type;
+ break;
}
}
}
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
index 5319a58..eb124bf 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -648,7 +649,7 @@ ResultSetBase::getMetaData(
{
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_xMSF, m_sProperty );
+ comphelper::getComponentContext(m_xMSF), m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
commit b70a330d4f06daaeeff940b2f935c8089d8a7be6
Author: Noel Grandin <noel at peralex.com>
Date: Thu Nov 1 10:41:27 2012 +0200
fdo#46808, rename method
Rename
utl::OConfigurationTreeRoot::tryCreateWithServiceFactory
to
utl::OConfigurationTreeRoot::tryCreateWithComponentContext
Change-Id: Ib39b44b21d206b5fdfa4162106fbdeb30b1dd37c
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index e9bc7ad..3c2df34 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -61,7 +61,7 @@ ResId padmin::PaResId( sal_uInt32 nId )
::com::sun::star::lang::Locale aLocale;
utl::OConfigurationNode aNode =
- utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("org.openoffice.Setup/L10N") );
if ( aNode.isValid() )
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx
index 1189a9b..beb02ec 100644
--- a/unotools/inc/unotools/confignode.hxx
+++ b/unotools/inc/unotools/confignode.hxx
@@ -302,7 +302,7 @@ namespace utl
the configuration could be initialized, errors in the creation of the specific node (e.g. because the
given node path does not exist) are still asserted.</p>
*/
- static OConfigurationTreeRoot tryCreateWithServiceFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ static OConfigurationTreeRoot tryCreateWithComponentContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True );
/** commit all changes made on the subtree the object is the root for<p/>
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index ca87f27..859e8df 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -592,10 +592,10 @@ namespace utl
}
//------------------------------------------------------------------------
- OConfigurationTreeRoot OConfigurationTreeRoot::tryCreateWithServiceFactory( const Reference< XComponentContext >& rxContext,
+ OConfigurationTreeRoot OConfigurationTreeRoot::tryCreateWithComponentContext( const Reference< XComponentContext >& rxContext,
const ::rtl::OUString& _rPath, sal_Int32 _nDepth , CREATION_MODE _eMode , sal_Bool _bLazyWrite )
{
- OSL_ENSURE( rxContext.is(), "OConfigurationTreeRoot::tryCreateWithServiceFactory: invalid service factory!" );
+ OSL_ENSURE( rxContext.is(), "OConfigurationTreeRoot::tryCreateWithComponentContext: invalid XComponentContext!" );
try
{
Reference< XMultiServiceFactory > xConfigFactory = theDefaultProvider::get( rxContext );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 53c51dd..273e118 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -1511,7 +1511,7 @@ bool AllSettings::GetLayoutRTL() const
if( nUIMirroring == -1 )
{
nUIMirroring = 0; // ask configuration only once
- utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("org.openoffice.Office.Common/I18N/CTL") ); // note: case sensitive !
if ( aNode.isValid() )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 64020ff..3e39c2f 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2139,7 +2139,7 @@ sal_Bool ToolBox::AlwaysLocked()
{
nAlwaysLocked = 0; // ask configuration only once
- utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars") ); // note: case sensitive !
if ( aNode.isValid() )
@@ -2152,7 +2152,7 @@ sal_Bool ToolBox::AlwaysLocked()
if( bStatesEnabled == sal_True )
{
// now read the locking state
- utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States") ); // note: case sensitive !
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6d5c36d..4b5e4cd 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -484,7 +484,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
{
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
- utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive !
if ( aNode.isValid() )
commit 8ec2fed7c88674258ce716e69ae31d8f9be7223c
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 31 16:08:53 2012 +0200
fdo#46808, use service constructor for ucb::Store
Change-Id: I62719ef9d58215e287af3e1be52404993722ec67
diff --git a/ucb/source/ucp/cmis/cmis_provider.cxx b/ucb/source/ucp/cmis/cmis_provider.cxx
index 271cd5b..b7febb5 100644
--- a/ucb/source/ucp/cmis/cmis_provider.cxx
+++ b/ucb/source/ucp/cmis/cmis_provider.cxx
@@ -28,6 +28,7 @@
#include <stdio.h>
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/contenthelper.hxx>
#include <com/sun/star/ucb/ContentCreationException.hpp>
@@ -59,12 +60,12 @@ ContentProvider::queryContent(
URL aUrl( Identifier->getContentIdentifier( ) );
if ( aUrl.getRepositoryId( ).isEmpty( ) )
{
- xContent = new RepoContent( m_xSMgr, this, Identifier );
+ xContent = new RepoContent( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier );
registerNewContent( xContent );
}
else
{
- xContent = new Content( m_xSMgr, this, Identifier );
+ xContent = new Content( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier );
registerNewContent( xContent );
}
}
@@ -96,8 +97,8 @@ void ContentProvider::registerSession( const rtl::OUString& sBindingUrl, libcmis
}
ContentProvider::ContentProvider(
- const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
-: ::ucbhelper::ContentProviderImplHelper( rSMgr )
+ const uno::Reference< uno::XComponentContext >& rxContext )
+: ::ucbhelper::ContentProviderImplHelper( rxContext )
{
}
@@ -115,7 +116,7 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
lang::XServiceInfo,
com::sun::star::ucb::XContentProvider );
-XSERVICEINFO_IMPL_1( ContentProvider,
+XSERVICEINFO_IMPL_1_CTX( ContentProvider,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.comp.CmisContentProvider" )),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
diff --git a/ucb/source/ucp/cmis/cmis_provider.hxx b/ucb/source/ucp/cmis/cmis_provider.hxx
index 2ade100..75d7de7 100644
--- a/ucb/source/ucp/cmis/cmis_provider.hxx
+++ b/ucb/source/ucp/cmis/cmis_provider.hxx
@@ -43,7 +43,7 @@ private:
public:
ContentProvider( const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
+ ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~ContentProvider();
// XInterface
diff --git a/ucb/source/ucp/ext/ucpext_provider.cxx b/ucb/source/ucp/ext/ucpext_provider.cxx
index 95120c3..18e0e32 100644
--- a/ucb/source/ucp/ext/ucpext_provider.cxx
+++ b/ucb/source/ucp/ext/ucpext_provider.cxx
@@ -54,8 +54,8 @@ namespace ucb { namespace ucp { namespace ext
//= ContentProvider
//==================================================================================================================
//------------------------------------------------------------------------------------------------------------------
- ContentProvider::ContentProvider( const Reference< XMultiServiceFactory >& i_rServiceManager )
- :ContentProvider_Base( i_rServiceManager )
+ ContentProvider::ContentProvider( const Reference< XComponentContext >& rxContext )
+ :ContentProvider_Base( rxContext )
{
}
@@ -94,8 +94,7 @@ namespace ucb { namespace ucp { namespace ext
//------------------------------------------------------------------------------------------------------------------
Reference< XInterface > ContentProvider::Create( const Reference< XComponentContext >& i_rContext )
{
- const ::comphelper::ComponentContext aContext( i_rContext );
- return *( new ContentProvider( aContext.getLegacyServiceFactory() ) );
+ return *( new ContentProvider( i_rContext ) );
}
//------------------------------------------------------------------------------------------------------------------
@@ -173,7 +172,7 @@ namespace ucb { namespace ucp { namespace ext
}
}
}
- const Reference< XContentIdentifier > xNormalizedIdentifier( new ::ucbhelper::ContentIdentifier( m_xSMgr, aComposer.makeStringAndClear() ) );
+ const Reference< XContentIdentifier > xNormalizedIdentifier( new ::ucbhelper::ContentIdentifier( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), aComposer.makeStringAndClear() ) );
::osl::MutexGuard aGuard( m_aMutex );
@@ -183,7 +182,7 @@ namespace ucb { namespace ucp { namespace ext
return xContent;
// create a new content
- xContent = new Content( m_xSMgr, this, xNormalizedIdentifier );
+ xContent = new Content( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), this, xNormalizedIdentifier );
if ( !xContent->getIdentifier().is() )
throw IllegalIdentifierException();
diff --git a/ucb/source/ucp/ext/ucpext_provider.hxx b/ucb/source/ucp/ext/ucpext_provider.hxx
index 4157c35..88c7f58 100644
--- a/ucb/source/ucp/ext/ucpext_provider.hxx
+++ b/ucb/source/ucp/ext/ucpext_provider.hxx
@@ -34,7 +34,7 @@ namespace ucb { namespace ucp { namespace ext
class ContentProvider : public ContentProvider_Base
{
public:
- ContentProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_rServiceManager );
+ ContentProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~ContentProvider();
// XServiceInfo
diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx
index 1c48f0a..8342985 100644
--- a/ucb/source/ucp/file/filrow.cxx
+++ b/ucb/source/ucp/file/filrow.cxx
@@ -43,8 +43,7 @@ sal_Bool convert( shell* pShell,
{
if( ! xConverter.is() )
{
- xConverter = uno::Reference< script::XTypeConverter >(
- script::Converter::create(comphelper::getComponentContext(pShell->m_xMultiServiceFactory)) );
+ xConverter = script::Converter::create(pShell->m_xContext);
}
try
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index eb5a0ce..d343b1c 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -705,8 +705,7 @@ XResultSet_impl::connectToCache(
ucb::ServiceNotFoundException,
uno::RuntimeException )
{
- uno::Reference< lang::XMultiServiceFactory > mxSMgr
- = m_pMyShell->m_xMultiServiceFactory;
+ uno::Reference< lang::XMultiServiceFactory > mxSMgr(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
if( m_xListener.is() )
throw ucb::ListenerAlreadySetException( ::rtl::OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
@@ -773,7 +772,7 @@ XResultSet_impl::getMetaData(
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_pMyShell->m_xMultiServiceFactory,
+ uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW),
m_sProperty,
aColumnData );
return uno::Reference< sdbc::XResultSetMetaData >( p );
@@ -782,7 +781,7 @@ XResultSet_impl::getMetaData(
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_pMyShell->m_xMultiServiceFactory, m_sProperty );
+ uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index d146845..4e4b6cf 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -20,6 +20,7 @@
#include <osl/security.hxx>
#include <osl/file.hxx>
#include <osl/socket.h>
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/ucb/FileSystemNotation.hpp>
@@ -80,8 +81,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpfile_component_getFactory(
-FileProvider::FileProvider( const Reference< XMultiServiceFactory >& xMultiServiceFactory )
- : m_xMultiServiceFactory( xMultiServiceFactory ),
+FileProvider::FileProvider( const Reference< XComponentContext >& rxContext )
+ : m_xContext( rxContext ),
m_pMyShell( 0 )
{
}
@@ -139,7 +140,7 @@ FileProvider::queryInterface(
void SAL_CALL FileProvider::init()
{
if( ! m_pMyShell )
- m_pMyShell = new shell( m_xMultiServiceFactory, this, sal_True );
+ m_pMyShell = new shell( m_xContext, this, sal_True );
}
@@ -153,9 +154,9 @@ FileProvider::initialize(
if( aArguments.getLength() > 0 &&
(aArguments[0] >>= config) &&
config.compareToAscii("NoConfig") == 0 )
- m_pMyShell = new shell( m_xMultiServiceFactory, this, sal_False );
+ m_pMyShell = new shell( m_xContext, this, sal_False );
else
- m_pMyShell = new shell( m_xMultiServiceFactory, this, sal_True );
+ m_pMyShell = new shell( m_xContext, this, sal_True );
}
}
@@ -244,7 +245,7 @@ Reference< XInterface > SAL_CALL
FileProvider::CreateInstance(
const Reference< XMultiServiceFactory >& xMultiServiceFactory )
{
- XServiceInfo* xP = (XServiceInfo*) new FileProvider( xMultiServiceFactory );
+ XServiceInfo* xP = (XServiceInfo*) new FileProvider( comphelper::getComponentContext(xMultiServiceFactory) );
return Reference< XInterface >::query( xP );
}
diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx
index 221eff6..c6336e7 100644
--- a/ucb/source/ucp/file/prov.hxx
+++ b/ucb/source/ucp/file/prov.hxx
@@ -60,7 +60,7 @@ namespace fileaccess {
friend class BaseContent;
public:
- FileProvider( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF );
+ FileProvider( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
~FileProvider();
// XInterface
@@ -211,7 +211,7 @@ namespace fileaccess {
void SAL_CALL init();
// Members
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
void SAL_CALL initProperties( void );
osl::Mutex m_aMutex;
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 3410248..348810e 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/ucb/NameClash.hpp>
+#include <com/sun/star/ucb/Store.hpp>
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
@@ -146,12 +147,12 @@ shell::MyProperty::~MyProperty()
#include "filinl.hxx"
-shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceFactory,
+shell::shell( const uno::Reference< uno::XComponentContext >& rxContext,
FileProvider* pProvider, sal_Bool bWithConfig )
: TaskManager(),
m_bWithConfig( bWithConfig ),
m_pProvider( pProvider ),
- m_xMultiServiceFactory( xMultiServiceFactory ),
+ m_xContext( rxContext ),
Title( "Title" ),
CasePreservingURL( "CasePreservingURL" ),
IsDocument( "IsDocument" ),
@@ -386,15 +387,9 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF
if(m_bWithConfig)
{
- rtl::OUString Store("com.sun.star.ucb.Store");
- uno::Reference< XPropertySetRegistryFactory > xRegFac(
- m_xMultiServiceFactory->createInstance( Store ),
- uno::UNO_QUERY );
- if ( xRegFac.is() )
- {
- // Open/create a registry
- m_xFileRegistry = xRegFac->createPropertySetRegistry( rtl::OUString() );
- }
+ uno::Reference< XPropertySetRegistryFactory > xRegFac = ucb::Store::create( m_xContext );
+ // Open/create a registry
+ m_xFileRegistry = xRegFac->createPropertySetRegistry( rtl::OUString() );
}
}
diff --git a/ucb/source/ucp/file/shell.hxx b/ucb/source/ucp/file/shell.hxx
index 1d3892d..5a9503e 100644
--- a/ucb/source/ucp/file/shell.hxx
+++ b/ucb/source/ucp/file/shell.hxx
@@ -48,6 +48,7 @@
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XDynamicResultSet.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
@@ -159,7 +160,7 @@ namespace fileaccess {
public:
// MethodenDefinitionen
- shell( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory,
+ shell( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
FileProvider* pProvider,sal_Bool bWithConfig );
virtual ~shell();
@@ -401,7 +402,7 @@ namespace fileaccess {
sal_Bool m_bWithConfig;
FileProvider* m_pProvider;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference< com::sun::star::ucb::XPropertySetRegistry > m_xFileRegistry;
private:
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index ee57e6d..0f961ec 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -50,8 +50,8 @@ using namespace com::sun::star::beans;
//=========================================================================
FTPContentProvider::FTPContentProvider(
- const Reference< XMultiServiceFactory >& rSMgr)
-: ::ucbhelper::ContentProviderImplHelper(rSMgr),
+ const Reference< XComponentContext >& rxContext)
+: ::ucbhelper::ContentProviderImplHelper(rxContext),
m_ftpLoaderThread(0),
m_pProxyDecider(0)
{
@@ -93,7 +93,7 @@ XTYPEPROVIDER_IMPL_3(FTPContentProvider,
//
//=========================================================================
-XSERVICEINFO_IMPL_1(
+XSERVICEINFO_IMPL_1_CTX(
FTPContentProvider,
rtl::OUString("com.sun.star.comp.FTPContentProvider"),
rtl::OUString(FTP_CONTENT_PROVIDER_SERVICE_NAME));
@@ -154,7 +154,7 @@ FTPContentProvider::queryContent(
aURL.host(),
aURL.port().toInt32()))
{
- xContent = new FTPContent(m_xSMgr,this,xCanonicId,aURL);
+ xContent = new FTPContent( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), this,xCanonicId,aURL);
registerNewContent(xContent);
}
else {
@@ -178,7 +178,7 @@ FTPContentProvider::queryContent(
void FTPContentProvider::init() {
m_ftpLoaderThread = new FTPLoaderThread();
- m_pProxyDecider = new ucbhelper::InternetProxyDecider(comphelper::getComponentContext(m_xSMgr));
+ m_pProxyDecider = new ucbhelper::InternetProxyDecider( m_xContext );
}
@@ -250,10 +250,7 @@ FTPContentProvider::getHttpProvider()
throw(RuntimeException)
{
// used for access to ftp-proxy
- return
- UniversalContentBroker::create(
- comphelper::getComponentContext(m_xSMgr))->
- queryContentProvider("http:");
+ return UniversalContentBroker::create( m_xContext )->queryContentProvider("http:");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.hxx b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
index ce8abdb..5f47640 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.hxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
@@ -55,8 +55,7 @@ namespace ftp {
public:
FTPContentProvider(
- const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory>& xMSF );
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
~FTPContentProvider();
diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx
index cefb686..8a372eb 100644
--- a/ucb/source/ucp/gvfs/gvfs_provider.cxx
+++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx
@@ -18,6 +18,7 @@
*/
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <libgnomevfs/gnome-vfs-init.h>
#include "gvfs_provider.hxx"
@@ -35,8 +36,8 @@ using namespace gvfs;
//=========================================================================
ContentProvider::ContentProvider(
- const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
-: ::ucbhelper::ContentProviderImplHelper( rSMgr )
+ const uno::Reference< uno::XComponentContext >& rxContext )
+: ::ucbhelper::ContentProviderImplHelper( rxContext )
{
}
// sdafas
@@ -74,7 +75,7 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
//
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list