[Libreoffice-commits] .: 13 commits - chart2/source comphelper/inc comphelper/source dbaccess/inc dbaccess/source desktop/source dtrans/source embeddedobj/source extensions/source framework/inc framework/source i18npool/inc i18npool/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk oox/inc oox/source reportdesign/source sc/source sd/source slideshow/test starmath/source svtools/source svx/source sw/inc sw/source toolkit/source vcl/aqua vcl/ios vcl/source vcl/unx xmloff/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 14 23:57:20 PST 2013
chart2/source/inc/LabeledDataSequence.hxx | 10
chart2/source/tools/StatisticsHelper.cxx | 28 -
comphelper/inc/comphelper/mimeconfighelper.hxx | 5
comphelper/source/container/embeddedobjectcontainer.cxx | 26 -
comphelper/source/misc/mimeconfighelper.cxx | 16
dbaccess/inc/dbsubcomponentcontroller.hxx | 2
dbaccess/inc/genericcontroller.hxx | 7
dbaccess/source/core/dataaccess/documentcontainer.cxx | 2
dbaccess/source/core/dataaccess/documentdefinition.cxx | 179 ++++------
dbaccess/source/filter/xml/xmlfilter.cxx | 2
dbaccess/source/ui/app/AppController.cxx | 20 -
dbaccess/source/ui/app/AppController.hxx | 2
dbaccess/source/ui/app/AppControllerDnD.cxx | 10
dbaccess/source/ui/app/AppControllerGen.cxx | 9
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2
dbaccess/source/ui/browser/brwctrlr.cxx | 24 -
dbaccess/source/ui/browser/dbexchange.cxx | 8
dbaccess/source/ui/browser/exsrcbrw.cxx | 4
dbaccess/source/ui/browser/genericcontroller.cxx | 16
dbaccess/source/ui/browser/sbagrid.cxx | 4
dbaccess/source/ui/browser/unodatbr.cxx | 14
dbaccess/source/ui/dlg/RelationDlg.cxx | 2
dbaccess/source/ui/inc/JoinController.hxx | 2
dbaccess/source/ui/inc/RelationController.hxx | 2
dbaccess/source/ui/inc/TableController.hxx | 2
dbaccess/source/ui/inc/TokenWriter.hxx | 19 -
dbaccess/source/ui/inc/brwctrlr.hxx | 2
dbaccess/source/ui/inc/databaseobjectview.hxx | 13
dbaccess/source/ui/inc/dbexchange.hxx | 6
dbaccess/source/ui/inc/exsrcbrw.hxx | 2
dbaccess/source/ui/inc/querycontroller.hxx | 2
dbaccess/source/ui/inc/singledoccontroller.hxx | 2
dbaccess/source/ui/inc/unodatbr.hxx | 2
dbaccess/source/ui/misc/RowSetDrop.cxx | 2
dbaccess/source/ui/misc/TableCopyHelper.cxx | 4
dbaccess/source/ui/misc/TokenWriter.cxx | 29 -
dbaccess/source/ui/misc/databaseobjectview.cxx | 13
dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 5
dbaccess/source/ui/misc/singledoccontroller.cxx | 3
dbaccess/source/ui/querydesign/JoinController.cxx | 2
dbaccess/source/ui/querydesign/JoinTableView.cxx | 4
dbaccess/source/ui/querydesign/querycontroller.cxx | 16
dbaccess/source/ui/relationdesign/RelationController.cxx | 8
dbaccess/source/ui/tabledesign/TEditControl.cxx | 2
dbaccess/source/ui/tabledesign/TableController.cxx | 12
desktop/source/app/app.cxx | 87 ++--
dtrans/source/win32/clipb/WinClipboard.cxx | 2
dtrans/source/win32/clipb/WinClipboard.hxx | 8
embeddedobj/source/commonembedding/embedobj.cxx | 5
embeddedobj/source/commonembedding/miscobj.cxx | 16
embeddedobj/source/commonembedding/persistence.cxx | 25 -
embeddedobj/source/commonembedding/specialobject.cxx | 4
embeddedobj/source/commonembedding/xfactory.cxx | 19 -
embeddedobj/source/commonembedding/xfactory.hxx | 33 -
embeddedobj/source/general/docholder.cxx | 9
embeddedobj/source/general/xcreator.cxx | 45 --
embeddedobj/source/inc/commonembobj.hxx | 6
embeddedobj/source/inc/specialobject.hxx | 2
embeddedobj/source/inc/xcreator.hxx | 24 -
embeddedobj/source/msole/oleembed.cxx | 2
embeddedobj/source/msole/xdialogcreator.cxx | 24 -
embeddedobj/source/msole/xolefactory.hxx | 12
extensions/source/abpilot/fieldmappingimpl.cxx | 42 --
extensions/source/abpilot/fieldmappingimpl.hxx | 2
extensions/source/abpilot/fieldmappingpage.cxx | 3
framework/inc/dispatch/startmoduledispatcher.hxx | 9
framework/inc/services.h | 3
framework/inc/services/backingcomp.hxx | 2
framework/source/dispatch/closedispatcher.cxx | 14
framework/source/dispatch/dispatchprovider.cxx | 2
framework/source/dispatch/startmoduledispatcher.cxx | 25 -
framework/source/fwe/classes/framelistanalyzer.cxx | 4
framework/source/services/backingcomp.cxx | 4
framework/source/services/sessionlistener.cxx | 6
framework/source/services/taskcreatorsrv.cxx | 2
i18npool/inc/calendarImpl.hxx | 5
i18npool/inc/characterclassificationImpl.hxx | 5
i18npool/inc/indexentrysupplier.hxx | 5
i18npool/inc/inputsequencechecker.hxx | 4
i18npool/inc/ordinalsuffix.hxx | 4
i18npool/inc/textconversion.hxx | 5
i18npool/inc/textconversionImpl.hxx | 5
i18npool/source/calendar/calendarImpl.cxx | 9
i18npool/source/characterclassification/characterclassificationImpl.cxx | 8
i18npool/source/indexentry/indexentrysupplier.cxx | 8
i18npool/source/inputchecker/inputsequencechecker.cxx | 9
i18npool/source/ordinalsuffix/ordinalsuffix.cxx | 4
i18npool/source/registerservices/registerservices.cxx | 83 ++--
i18npool/source/textconversion/textconversionImpl.cxx | 14
i18npool/source/textconversion/textconversion_ko.cxx | 10
i18npool/source/textconversion/textconversion_zh.cxx | 7
i18npool/source/transliteration/transliteration_body.cxx | 4
offapi/UnoApi_offapi.mk | 16
offapi/com/sun/star/chart2/data/LabeledDataSequence.idl | 31 -
offapi/com/sun/star/chart2/data/XLabeledDataSequence2.idl | 76 ++++
offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl | 37 --
offapi/com/sun/star/datatransfer/clipboard/XSystemClipboard.idl | 63 +++
offapi/com/sun/star/embed/EmbeddedObjectCreator.idl | 37 ++
offapi/com/sun/star/embed/OLEEmbeddedObjectFactory.idl | 37 ++
offapi/com/sun/star/embed/OOoEmbeddedObjectFactory.idl | 37 ++
offapi/com/sun/star/embed/XEmbeddedObjectCreator.idl | 46 ++
offapi/com/sun/star/frame/SessionListener.idl | 44 ++
offapi/com/sun/star/frame/StartModule.idl | 41 ++
offapi/com/sun/star/frame/TaskCreator.idl | 37 ++
offapi/com/sun/star/ui/AddressBookSourceDialog.idl | 51 ++
offapi/type_reference/types.rdb |binary
oox/inc/oox/drawingml/chart/converterbase.hxx | 2
oox/source/drawingml/chart/converterbase.cxx | 6
oox/source/drawingml/chart/seriesconverter.cxx | 3
oox/source/drawingml/textparagraphproperties.cxx | 2
reportdesign/source/core/api/ReportDefinition.cxx | 3
reportdesign/source/core/api/ReportEngineJFree.cxx | 3
reportdesign/source/ui/inc/ReportController.hxx | 1
reportdesign/source/ui/inspection/GeometryHandler.cxx | 3
reportdesign/source/ui/report/DesignView.cxx | 2
reportdesign/source/ui/report/ReportController.cxx | 8
sc/source/filter/excel/xichart.cxx | 4
sc/source/filter/inc/xlchart.hxx | 1
sc/source/ui/unoobj/chart2uno.cxx | 5
sd/source/ui/slideshow/slideshowimpl.cxx | 10
slideshow/test/demoshow.cxx | 12
starmath/source/mathmlimport.cxx | 28 -
starmath/source/mathmlimport.hxx | 4
svtools/source/uno/addrtempuno.cxx | 29 +
svx/source/form/formcontroller.cxx | 16
sw/inc/unochart.hxx | 8
sw/source/filter/xml/xmltexti.cxx | 17
toolkit/source/awt/vclxtoolkit.cxx | 12
vcl/aqua/source/dtrans/aqua_clipboard.cxx | 2
vcl/aqua/source/dtrans/aqua_clipboard.hxx | 6
vcl/ios/source/dtrans/ios_clipboard.cxx | 2
vcl/ios/source/dtrans/ios_clipboard.hxx | 6
vcl/source/components/dtranscomp.cxx | 12
vcl/source/window/window.cxx | 36 --
vcl/unx/generic/dtrans/X11_clipboard.cxx | 8
vcl/unx/generic/dtrans/X11_clipboard.hxx | 12
xmloff/source/chart/SchXMLPlotAreaContext.cxx | 7
xmloff/source/chart/SchXMLSeries2Context.cxx | 14
xmloff/source/chart/SchXMLTools.cxx | 13
xmloff/source/chart/SchXMLTools.hxx | 4
140 files changed, 1174 insertions(+), 856 deletions(-)
New commits:
commit abcbababca2ff10bb78d36cf1a625b9d615eaa9a
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 15:29:57 2013 +0200
fdo#46808, Convert comphelper::MimeConfigurationHelper to XComponentContext
Change-Id: I74b4f0c4a84f02b218102405eaba24cf47f654ce
diff --git a/comphelper/inc/comphelper/mimeconfighelper.hxx b/comphelper/inc/comphelper/mimeconfighelper.hxx
index fbefc13..8cf7953 100644
--- a/comphelper/inc/comphelper/mimeconfighelper.hxx
+++ b/comphelper/inc/comphelper/mimeconfighelper.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
@@ -36,7 +37,7 @@ namespace comphelper {
class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
{
::osl::Mutex m_aMutex;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xObjectConfig;
@@ -47,7 +48,7 @@ class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
public:
- MimeConfigurationHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ MimeConfigurationHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
static ::rtl::OUString GetStringClassIDRepresentation( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID );
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index e1b63bc..61c667e 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -34,10 +34,10 @@ using namespace ::com::sun::star;
using namespace comphelper;
//-----------------------------------------------------------------------
-MimeConfigurationHelper::MimeConfigurationHelper( const uno::Reference< lang::XMultiServiceFactory >& xFactory )
-: m_xFactory( xFactory )
+MimeConfigurationHelper::MimeConfigurationHelper( const uno::Reference< uno::XComponentContext >& rxContext )
+: m_xContext( rxContext )
{
- if ( !m_xFactory.is() )
+ if ( !m_xContext.is() )
throw uno::RuntimeException();
}
@@ -122,8 +122,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati
try
{
if ( !m_xConfigProvider.is() )
- m_xConfigProvider = configuration::theDefaultProvider::get(
- getComponentContext( m_xFactory ) );
+ m_xConfigProvider = configuration::theDefaultProvider::get( m_xContext );
uno::Sequence< uno::Any > aArgs( 1 );
beans::PropertyValue aPathProp;
@@ -186,7 +185,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFacto
if ( !m_xFilterFactory.is() )
m_xFilterFactory.set(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ),
+ m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", m_xContext),
uno::UNO_QUERY );
return m_xFilterFactory;
@@ -222,8 +221,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFacto
::rtl::OUString MimeConfigurationHelper::GetDocServiceNameFromMediaType( const ::rtl::OUString& aMediaType )
{
uno::Reference< container::XContainerQuery > xTypeCFG(
- m_xFactory->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" )) ),
+ m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
uno::UNO_QUERY );
if ( xTypeCFG.is() )
@@ -585,7 +583,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu
// filter name is not specified, so type detection should be done
uno::Reference< document::XTypeDetection > xTypeDetection(
- m_xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" )) ),
+ m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
uno::UNO_QUERY );
if ( !xTypeDetection.is() )
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index d765d7e..9e91fd4 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -253,7 +253,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
ODocumentDefinition::GetDocumentServiceFromMediaType( sMediaType, m_aContext, aClassID );
else if ( !sDocServiceName.isEmpty() )
{
- ::comphelper::MimeConfigurationHelper aConfigHelper( m_aContext.getLegacyServiceFactory() );
+ ::comphelper::MimeConfigurationHelper aConfigHelper( m_aContext.getUNOContext() );
const Sequence< NamedValue > aProps( aConfigHelper.GetObjectPropsByDocumentName( sDocServiceName ) );
const ::comphelper::NamedValueCollection aMediaTypeProps( aProps );
aClassID = aMediaTypeProps.getOrDefault( "ClassID", Sequence< sal_Int8 >() );
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 7573763..120ffdb 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -386,7 +386,7 @@ namespace dbaccess
::rtl::OUString sResult;
try
{
- ::comphelper::MimeConfigurationHelper aConfigHelper( _rContext.getLegacyServiceFactory() );
+ ::comphelper::MimeConfigurationHelper aConfigHelper( _rContext.getUNOContext() );
sResult = aConfigHelper.GetDocServiceNameFromMediaType( _rMediaType );
_rClassId = aConfigHelper.GetSequenceClassIDRepresentation(aConfigHelper.GetExplicitlyRegisteredObjClassID( _rMediaType ));
if ( !_rClassId.getLength() && !sResult.isEmpty() )
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index a625398..21c2da5 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -144,7 +144,7 @@ namespace dbaxml
aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
aArgs[nLen++].Value <<= sal_True;
- ::comphelper::MimeConfigurationHelper aHelper(m_xFactory);
+ ::comphelper::MimeConfigurationHelper aHelper( comphelper::getComponentContext(m_xFactory) );
SvtModuleOptions aModuleOptions;
uno::Reference< frame::XModel > xModel(xFrameLoad->loadComponentFromURL(
aModuleOptions.GetFactoryEmptyDocumentURL( aModuleOptions.ClassifyFactoryByServiceName( aHelper.GetDocServiceNameFromMediaType(MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET) )),
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 941186d..be9abc5 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -187,7 +187,8 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
uno::Sequence < uno::Any > aArgs(1);
aArgs[0] <<= uno::Reference < embed::XEmbeddedObject >( this );
uno::Reference< util::XCloseable > xDocument(
- m_xFactory->createInstanceWithArguments( GetDocumentServiceName(), aArgs ), uno::UNO_QUERY );
+ m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( GetDocumentServiceName(), aArgs, m_xContext),
+ uno::UNO_QUERY );
uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
if ( xChild.is() )
@@ -315,7 +316,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
uno::Reference< embed::XComponentSupplier > xCompSupl( m_xClientSite, uno::UNO_QUERY_THROW );
uno::Reference< uno::XInterface > xContDoc( xCompSupl->getComponent(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XModuleManager2 > xManager( frame::ModuleManager::create(comphelper::getComponentContext(m_xFactory)) );
+ uno::Reference< frame::XModuleManager2 > xManager( frame::ModuleManager::create( m_xContext ) );
aModuleName = xManager->identify( xContDoc );
}
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 508883d..44a344d 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -41,7 +41,7 @@ uno::Sequence< beans::PropertyValue > GetValuableArgs_Impl( const uno::Sequence<
sal_Bool bCanUseDocumentBaseURL );
//------------------------------------------------------
-OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< lang::XMultiServiceFactory >& xFactory,
+OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::NamedValue >& aObjProps )
: m_pDocHolder( NULL )
, m_pInterfaceContainer( NULL )
@@ -51,7 +51,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< lang::XMulti
, m_nObjectState( -1 )
, m_nTargetState( -1 )
, m_nUpdateMode ( embed::EmbedUpdateModes::ALWAYS_UPDATE )
-, m_xFactory( xFactory )
+, m_xContext( rxContext )
, m_nMiscStatus( 0 )
, m_bEmbeddedScriptSupport( sal_True )
, m_bDocumentRecoverySupport( sal_True )
@@ -66,7 +66,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< lang::XMulti
//------------------------------------------------------
OCommonEmbeddedObject::OCommonEmbeddedObject(
- const uno::Reference< lang::XMultiServiceFactory >& xFactory,
+ const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::NamedValue >& aObjProps,
const uno::Sequence< beans::PropertyValue >& aMediaDescr,
const uno::Sequence< beans::PropertyValue >& aObjectDescr )
@@ -78,7 +78,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject(
, m_nObjectState( embed::EmbedStates::LOADED )
, m_nTargetState( -1 )
, m_nUpdateMode ( embed::EmbedUpdateModes::ALWAYS_UPDATE )
-, m_xFactory( xFactory )
+, m_xContext( rxContext )
, m_nMiscStatus( 0 )
, m_bEmbeddedScriptSupport( sal_True )
, m_bDocumentRecoverySupport( sal_True )
@@ -95,11 +95,11 @@ OCommonEmbeddedObject::OCommonEmbeddedObject(
//------------------------------------------------------
void OCommonEmbeddedObject::CommonInit_Impl( const uno::Sequence< beans::NamedValue >& aObjectProps )
{
- OSL_ENSURE( m_xFactory.is(), "No ServiceFactory is provided!\n" );
- if ( !m_xFactory.is() )
+ OSL_ENSURE( m_xContext.is(), "No ServiceFactory is provided!\n" );
+ if ( !m_xContext.is() )
throw uno::RuntimeException();
- m_pDocHolder = new DocumentHolder( comphelper::getComponentContext(m_xFactory), this );
+ m_pDocHolder = new DocumentHolder( m_xContext, this );
m_pDocHolder->acquire();
// parse configuration entries
@@ -234,7 +234,7 @@ void OCommonEmbeddedObject::LinkInit_Impl(
m_bReadOnly = sal_True;
if ( m_aLinkFilterName.getLength() )
{
- ::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
+ ::comphelper::MimeConfigurationHelper aHelper( m_xContext );
::rtl::OUString aExportFilterName = aHelper.GetExportFilterFromImportFilter( m_aLinkFilterName );
m_bReadOnly = !( aExportFilterName.equals( m_aLinkFilterName ) );
}
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index abb8418..96e5db0 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -191,7 +191,7 @@ static void TransferMediaType( const uno::Reference< embed::XStorage >& i_rSourc
}
//------------------------------------------------------
-static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< lang::XMultiServiceFactory >& _rxFactory,
+static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< uno::XComponentContext >& _rxContext,
const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport, const bool i_bDocumentRecoverySupport )
{
::comphelper::NamedValueCollection aArguments;
@@ -202,7 +202,8 @@ static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference<
uno::Reference< uno::XInterface > xDocument;
try
{
- xDocument = _rxFactory->createInstanceWithArguments( _rDocumentServiceName, aArguments.getWrappedPropertyValues() );
+ xDocument = _rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ _rDocumentServiceName, aArguments.getWrappedPropertyValues(), _rxContext );
}
catch( const uno::Exception& )
{
@@ -211,7 +212,7 @@ static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference<
// IllegalArgumentException when we try to create the instance with arguments.
// Okay, so we fall back to creating the instance without any arguments.
OSL_ASSERT("Consider implementing interface XInitialization to avoid duplicate construction");
- xDocument = _rxFactory->createInstance( _rDocumentServiceName );
+ xDocument = _rxContext->getServiceManager()->createInstanceWithContext( _rDocumentServiceName, _rxContext );
}
return uno::Reference< util::XCloseable >( xDocument, uno::UNO_QUERY );
@@ -312,7 +313,7 @@ void OCommonEmbeddedObject::EmbedAndReparentDoc_Impl( const uno::Reference< util
//------------------------------------------------------
uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl()
{
- uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
+ uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(),
m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY );
@@ -372,7 +373,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl()
//------------------------------------------------------
uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
{
- uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
+ uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(),
m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
@@ -448,7 +449,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
if ( aFilterName.isEmpty() )
{
try {
- ::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
+ ::comphelper::MimeConfigurationHelper aHelper( m_xContext );
aFilterName = aHelper.GetDefaultFilterFromServiceName( GetDocumentServiceName(), nVersion );
} catch( const uno::Exception& )
{}
@@ -480,7 +481,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
const uno::Reference< embed::XStorage > xSourceStorage( m_xRecoveryStorage.is() ? m_xRecoveryStorage : m_xObjectStorage );
- uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
+ uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(),
m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
//#i103460# ODF: take the size given from the parent frame as default
@@ -507,7 +508,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
uno::Reference< io::XInputStream > xTempInpStream;
if ( !xDoc.is() )
{
- xTempInpStream = createTempInpStreamFromStor( xSourceStorage, comphelper::getComponentContext(m_xFactory) );
+ xTempInpStream = createTempInpStreamFromStor( xSourceStorage, m_xContext );
if ( !xTempInpStream.is() )
throw uno::RuntimeException();
@@ -574,7 +575,7 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr
const ::rtl::OUString& aHierarchName )
{
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
+ io::TempFile::create(m_xContext),
uno::UNO_QUERY_THROW );
uno::Reference< io::XInputStream > aResult( xTempOut, uno::UNO_QUERY );
@@ -781,7 +782,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
// open storage based on document temporary file for reading
uno::Reference < lang::XSingleServiceFactory > xStorageFactory(
- m_xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" )) ),
+ m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.embed.StorageFactory", m_xContext),
uno::UNO_QUERY );
uno::Sequence< uno::Any > aArgs(1);
@@ -800,7 +801,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDescr_Impl(
const uno::Sequence< beans::PropertyValue >& aMedDescr )
{
- uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
+ uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(),
m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
@@ -1696,7 +1697,7 @@ void SAL_CALL OCommonEmbeddedObject::reload(
}
}
- ::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
+ ::comphelper::MimeConfigurationHelper aHelper( m_xContext );
if ( m_aLinkFilterName.isEmpty() )
{
if ( !aNewLinkFilter.isEmpty() )
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx
index 62543b8..19a53cb 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -43,8 +43,8 @@
using namespace ::com::sun::star;
-OSpecialEmbeddedObject::OSpecialEmbeddedObject( const uno::Reference< lang::XMultiServiceFactory >& xFactory, const uno::Sequence< beans::NamedValue >& aObjectProps )
-: OCommonEmbeddedObject( xFactory, aObjectProps )
+OSpecialEmbeddedObject::OSpecialEmbeddedObject( const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::NamedValue >& aObjectProps )
+: OCommonEmbeddedObject( rxContext, aObjectProps )
{
maSize.Width = maSize.Height = 10000;
m_nObjectState = embed::EmbedStates::LOADED;
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx
index ec29eda..adfd245 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <rtl/logfile.hxx>
+#include <comphelper/processfactory.hxx>
#include "xfactory.hxx"
@@ -54,7 +55,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticG
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
- return uno::Reference< uno::XInterface >( *new OOoEmbeddedObjectFactory( xServiceManager ) );
+ return uno::Reference< uno::XInterface >( *new OOoEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
}
//-------------------------------------------------------------------------
@@ -125,7 +126,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
xResult = uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject ) ),
uno::UNO_QUERY );
}
@@ -189,7 +190,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
xResult = uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject ) ),
uno::UNO_QUERY );
}
@@ -245,7 +246,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
xResult = uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject ) ),
uno::UNO_QUERY );
@@ -306,7 +307,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
uno::Reference< uno::XInterface > xResult = uno::Reference< uno::XInterface > (
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject ) ),
uno::UNO_QUERY );
@@ -366,7 +367,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
xResult = uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject,
aTempMedDescr,
lObjArgs ) ),
@@ -432,7 +433,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
xResult = uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject,
aTempMedDescr,
lObjArgs ) ),
@@ -493,7 +494,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_
uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
- return uno::Reference< uno::XInterface >( *new OOoSpecialEmbeddedObjectFactory( xServiceManager ) );
+ return uno::Reference< uno::XInterface >( *new OOoSpecialEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
}
//-------------------------------------------------------------------------
@@ -516,7 +517,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::crea
uno::Reference< uno::XInterface > xResult(
static_cast< ::cppu::OWeakObject* > ( new OSpecialEmbeddedObject(
- m_xFactory,
+ m_xContext,
aObject ) ),
uno::UNO_QUERY );
return xResult;
diff --git a/embeddedobj/source/commonembedding/xfactory.hxx b/embeddedobj/source/commonembedding/xfactory.hxx
index b7cf022..0125d1f 100644
--- a/embeddedobj/source/commonembedding/xfactory.hxx
+++ b/embeddedobj/source/commonembedding/xfactory.hxx
@@ -29,17 +29,17 @@ class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::comphelper::MimeConfigurationHelper m_aConfigHelper;
public:
OOoEmbeddedObjectFactory(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
- : m_xFactory( xFactory )
- , m_aConfigHelper( xFactory )
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ : m_xContext( rxContext )
+ , m_aConfigHelper( rxContext )
{
- OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
+ OSL_ENSURE( rxContext.is(), "No service manager is provided!\n" );
}
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames();
@@ -76,17 +76,17 @@ class OOoSpecialEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbedObjectFactory,
::com::sun::star::lang::XServiceInfo >
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::comphelper::MimeConfigurationHelper m_aConfigHelper;
public:
OOoSpecialEmbeddedObjectFactory(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
- : m_xFactory( xFactory )
- , m_aConfigHelper( xFactory )
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ : m_xContext( rxContext )
+ , m_aConfigHelper( rxContext )
{
- OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
+ OSL_ENSURE( rxContext.is(), "No service manager is provided!\n" );
}
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames();
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index 83d9b3e..2fdb868 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -59,7 +59,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL UNOEmbeddedObjectCreator::impl_staticG
uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
- return uno::Reference< uno::XInterface >( *new UNOEmbeddedObjectCreator( xServiceManager ) );
+ return uno::Reference< uno::XInterface >( *new UNOEmbeddedObjectCreator( comphelper::getComponentContext(xServiceManager) ) );
}
//-------------------------------------------------------------------------
@@ -96,7 +96,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
aEmbedFactory = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ));
}
- uno::Reference < uno::XInterface > xFact( m_xFactory->createInstance( aEmbedFactory ) );
+ uno::Reference < uno::XInterface > xFact( m_xContext->getServiceManager()->createInstanceWithContext(aEmbedFactory, m_xContext) );
uno::Reference< embed::XEmbedObjectCreator > xEmbCreator( xFact, uno::UNO_QUERY );
if ( xEmbCreator.is() )
return xEmbCreator->createInstanceInitNew( aClassID, aClassName, xStorage, sEntName, lObjArgs );
@@ -209,7 +209,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
if ( !aEmbedFactory.isEmpty() )
{
- uno::Reference< uno::XInterface > xFact = m_xFactory->createInstance( aEmbedFactory );
+ uno::Reference< uno::XInterface > xFact = m_xContext->getServiceManager()->createInstanceWithContext(aEmbedFactory, m_xContext);
uno::Reference< embed::XEmbedObjectCreator > xEmbCreator( xFact, uno::UNO_QUERY );
if ( xEmbCreator.is() )
@@ -262,7 +262,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
{
// the object can be loaded by one of the office application
uno::Reference< embed::XEmbeddedObjectCreator > xOOoEmbCreator =
- embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
+ embed::OOoEmbeddedObjectFactory::create( m_xContext );
xResult = xOOoEmbCreator->createInstanceInitFromMediaDescriptor( xStorage,
sEntName,
@@ -281,7 +281,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
// was also extended.
uno::Reference< embed::XEmbeddedObjectCreator > xOleEmbCreator =
- embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
+ embed::OLEEmbeddedObjectFactory::create( m_xContext );
xResult = xOleEmbCreator->createInstanceInitFromMediaDescriptor( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
@@ -319,7 +319,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
::rtl::OUString aEmbedFactory = m_aConfigHelper.GetFactoryNameByClassID( aClassID );
uno::Reference< embed::XEmbedObjectFactory > xEmbFactory(
- m_xFactory->createInstance( aEmbedFactory ),
+ m_xContext->getServiceManager()->createInstanceWithContext(aEmbedFactory, m_xContext),
uno::UNO_QUERY );
if ( !xEmbFactory.is() )
throw uno::RuntimeException(); // TODO:
@@ -367,7 +367,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
{
// the object can be loaded by one of the office application
uno::Reference< embed::XEmbeddedObjectCreator > xOOoLinkCreator =
- embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
+ embed::OOoEmbeddedObjectFactory::create( m_xContext );
xResult = xOOoLinkCreator->createInstanceLink( xStorage,
sEntName,
@@ -398,7 +398,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
4 );
uno::Reference< embed::XEmbeddedObjectCreator > xLinkCreator =
- embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory));
+ embed::OLEEmbeddedObjectFactory::create( m_xContext);
xResult = xLinkCreator->createInstanceLink( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
@@ -425,7 +425,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
::rtl::OUString aEmbedFactory = m_aConfigHelper.GetFactoryNameByClassID( aClassID );
uno::Reference< embed::XLinkFactory > xLinkFactory(
- m_xFactory->createInstance( aEmbedFactory ),
+ m_xContext->getServiceManager()->createInstanceWithContext(aEmbedFactory, m_xContext),
uno::UNO_QUERY );
if ( !xLinkFactory.is() )
throw uno::RuntimeException(); // TODO:
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index bf0dc1a..2100ff2 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -95,7 +95,7 @@ protected:
sal_Int32 m_nTargetState; // should be -1 exept during state changing
sal_Int32 m_nUpdateMode;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDocMediaDescriptor;
@@ -228,12 +228,12 @@ private:
public:
OCommonEmbeddedObject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
// no persistance for linked objects, so the descriptors are provided in constructor
OCommonEmbeddedObject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectDescr );
diff --git a/embeddedobj/source/inc/specialobject.hxx b/embeddedobj/source/inc/specialobject.hxx
index 82c2b29..e0612df 100644
--- a/embeddedobj/source/inc/specialobject.hxx
+++ b/embeddedobj/source/inc/specialobject.hxx
@@ -30,7 +30,7 @@ private:
com::sun::star::awt::Size maSize;
public:
OSpecialEmbeddedObject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
// XInterface
diff --git a/embeddedobj/source/inc/xcreator.hxx b/embeddedobj/source/inc/xcreator.hxx
index 6e63b8b..5e8b908 100644
--- a/embeddedobj/source/inc/xcreator.hxx
+++ b/embeddedobj/source/inc/xcreator.hxx
@@ -31,16 +31,16 @@ class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::comphelper::MimeConfigurationHelper m_aConfigHelper;
public:
UNOEmbeddedObjectCreator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
- : m_xFactory( xFactory )
- , m_aConfigHelper( xFactory )
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ : m_xContext( rxContext )
+ , m_aConfigHelper( rxContext )
{
- OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
+ OSL_ENSURE( rxContext.is(), "No service manager is provided!\n" );
}
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames();
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index ccf8161..5fdda99 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -331,7 +331,7 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo()
xTmpStorage->dispose();
// look for the related embedded object factory
- ::comphelper::MimeConfigurationHelper aConfigHelper( m_xFactory );
+ ::comphelper::MimeConfigurationHelper aConfigHelper( comphelper::getComponentContext(m_xFactory) );
::rtl::OUString aEmbedFactory;
if ( !aMediaType.isEmpty() )
aEmbedFactory = aConfigHelper.GetFactoryNameByMediaType( aMediaType );
diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx
index 9b82560..60a63e4 100644
--- a/embeddedobj/source/msole/xdialogcreator.cxx
+++ b/embeddedobj/source/msole/xdialogcreator.cxx
@@ -218,7 +218,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
// TODO: use config helper for type detection
uno::Reference< embed::XEmbeddedObjectCreator > xEmbCreator;
- ::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
+ ::comphelper::MimeConfigurationHelper aHelper( comphelper::getComponentContext(m_xFactory) );
if ( aHelper.AddFilterNameCheckOwnFile( aMediaDescr ) )
xEmbCreator = embed::EmbeddedObjectCreator::create( comphelper::getComponentContext(m_xFactory) );
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index fdfe2c7..1dc6056 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -522,8 +522,7 @@ namespace
aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
aArgs[nLen++].Value <<= sal_True;
- uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY);
- ::comphelper::MimeConfigurationHelper aHelper(xFac);
+ ::comphelper::MimeConfigurationHelper aHelper(m_xContext);
SvtModuleOptions aModuleOptions;
uno::Reference< frame::XModel > xModel(xFrameLoad->loadComponentFromURL(
aModuleOptions.GetFactoryEmptyDocumentURL( aModuleOptions.ClassifyFactoryByServiceName( aHelper.GetDocServiceNameFromMediaType(m_sMimeType) )),
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index 07a662b..38b529b 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -169,8 +169,7 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task
static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
try
{
- const uno::Reference< lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
- MimeConfigurationHelper aConfighelper(xFactory);
+ MimeConfigurationHelper aConfighelper(m_xContext);
const ::rtl::OUString sMimeType = m_xReport->getMimeType();
const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aConfighelper.GetDocServiceNameFromMediaType(sMimeType) );
String sExt;
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index bd0bbca..01954e4 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1678,8 +1678,7 @@ void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUStrin
// -----------------------------------------------------------------------------
::rtl::OUString GeometryHandler::impl_ConvertMimeTypeToUI_nothrow(const ::rtl::OUString& _sMimetype) const
{
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
- ::comphelper::MimeConfigurationHelper aMimeHelper(xServiceFactory);
+ ::comphelper::MimeConfigurationHelper aMimeHelper(m_xContext);
::rtl::OUString sRet;
const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aMimeHelper.GetDocServiceNameFromMediaType(_sMimetype) );
if ( pFilter )
commit 251f1b0b38be7d1267339898e44e320f05849e22
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 14:29:06 2013 +0200
fdo#46808, Adapt embed::*EmbeddedObjectCreator UNO services to new style
The services already existed, it just did not have an IDL file.
Adapts
com.sun.star.embed.OOoEmbeddedObjectFactory
com.sun.star.embed.OLEEmbeddedObjectFactory
com.sun.star.embed.EmbeddedObjectCreator
Change-Id: I8ba01c7fd956a46c87d02dc7d61bdd5fcdf21ab8
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 1ec18a1..f4b8b99 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -19,7 +19,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/embed/XLinkageSupport.hpp>
@@ -360,8 +360,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con
// object was not added until now - should happen only by calling this method from "inside"
//TODO/LATER: it would be good to detect an error when an object should be created already, but isn't (not an "inside" call)
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- OUString("com.sun.star.embed.EmbeddedObjectCreator") ), uno::UNO_QUERY_THROW );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( xCopy.is() ? 2 : 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
@@ -402,8 +401,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( rArgs.getLength() + 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
@@ -620,8 +618,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
@@ -655,8 +652,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
- uno::Reference < embed::XLinkCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create(::comphelper::getProcessComponentContext());
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
@@ -740,10 +736,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
throw uno::RuntimeException();
// create new linked object from the URL the link is based on
- uno::Reference < embed::XLinkCreator > xCreator(
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator") ) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference < embed::XEmbeddedObjectCreator > xCreator =
+ embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aMediaDescr( 1 );
aMediaDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
@@ -769,10 +763,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
uno::Reference< beans::XPropertySet > xOrigProps( xObj->getComponent(), uno::UNO_QUERY_THROW );
// use object class ID to create a new one and tranfer all the properties
- uno::Reference < embed::XEmbedObjectCreator > xCreator(
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator") ) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference < embed::XEmbeddedObjectCreator > xCreator =
+ embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 0e2b410..7573763 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -46,8 +46,9 @@
#include <com/sun/star/report/XReportEngine.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
#include <ucbhelper/cancelcommandexecution.hxx>
#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
@@ -1215,36 +1216,33 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R
Reference< XStorage> xStorage = getContainerStorage();
if ( xStorage.is() )
{
- Reference< XEmbedObjectCreator> xEmbedFactory( m_aContext.createComponent( "com.sun.star.embed.EmbeddedObjectCreator" ), UNO_QUERY );
- if ( xEmbedFactory.is() )
+ Reference< XEmbeddedObjectCreator> xEmbedFactory = EmbeddedObjectCreator::create(m_aContext.getUNOContext());
+ Sequence<PropertyValue> aEmpty,aMediaDesc(1);
+ aMediaDesc[0].Name = PROPERTY_URL;
+ aMediaDesc[0].Value <<= _sURL;
+ m_xEmbeddedObject.set(xEmbedFactory->createInstanceInitFromMediaDescriptor( xStorage
+ ,m_pImpl->m_aProps.sPersistentName
+ ,aMediaDesc
+ ,aEmpty),UNO_QUERY);
+
+ lcl_resetFormsToEmptyDataSource( m_xEmbeddedObject );
+ // #i57669#
+
+ Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
+ if ( xPersist.is() )
{
- Sequence<PropertyValue> aEmpty,aMediaDesc(1);
- aMediaDesc[0].Name = PROPERTY_URL;
- aMediaDesc[0].Value <<= _sURL;
- m_xEmbeddedObject.set(xEmbedFactory->createInstanceInitFromMediaDescriptor( xStorage
- ,m_pImpl->m_aProps.sPersistentName
- ,aMediaDesc
- ,aEmpty),UNO_QUERY);
-
- lcl_resetFormsToEmptyDataSource( m_xEmbeddedObject );
- // #i57669#
-
- Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
- if ( xPersist.is() )
- {
- xPersist->storeOwn();
- }
- try
- {
- Reference< com::sun::star::util::XCloseable> xCloseable(m_xEmbeddedObject,UNO_QUERY);
- if ( xCloseable.is() )
- xCloseable->close(sal_True);
- }
- catch(const Exception&)
- {
- }
- m_xEmbeddedObject = NULL;
- }
+ xPersist->storeOwn();
+ }
+ try
+ {
+ Reference< com::sun::star::util::XCloseable> xCloseable(m_xEmbeddedObject,UNO_QUERY);
+ if ( xCloseable.is() )
+ xCloseable->close(sal_True);
+ }
+ catch(const Exception&)
+ {
+ }
+ m_xEmbeddedObject = NULL;
}
}
@@ -1617,80 +1615,77 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
Reference< XStorage> xStorage = getContainerStorage();
if ( xStorage.is() )
{
- Reference< XEmbedObjectFactory> xEmbedFactory( m_aContext.createComponent( "com.sun.star.embed.OOoEmbeddedObjectFactory" ), UNO_QUERY );
- if ( xEmbedFactory.is() )
+ Reference< XEmbeddedObjectCreator> xEmbedFactory = OOoEmbeddedObjectFactory::create(m_aContext.getUNOContext());
+ ::rtl::OUString sDocumentService;
+ sal_Bool bSetSize = sal_False;
+ sal_Int32 nEntryConnectionMode = EntryInitModes::DEFAULT_INIT;
+ Sequence< sal_Int8 > aClassID = _aClassID;
+ if ( aClassID.getLength() )
{
- ::rtl::OUString sDocumentService;
- sal_Bool bSetSize = sal_False;
- sal_Int32 nEntryConnectionMode = EntryInitModes::DEFAULT_INIT;
- Sequence< sal_Int8 > aClassID = _aClassID;
- if ( aClassID.getLength() )
- {
- nEntryConnectionMode = EntryInitModes::TRUNCATE_INIT;
- bSetSize = sal_True;
- }
- else
+ nEntryConnectionMode = EntryInitModes::TRUNCATE_INIT;
+ bSetSize = sal_True;
+ }
+ else
+ {
+ sDocumentService = GetDocumentServiceFromMediaType( getContentType(), m_aContext, aClassID );
+ // check if we are not a form and
+ // the com.sun.star.report.pentaho.SOReportJobFactory is not present.
+ if ( !m_bForm && !sDocumentService.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")))
{
- sDocumentService = GetDocumentServiceFromMediaType( getContentType(), m_aContext, aClassID );
- // check if we are not a form and
- // the com.sun.star.report.pentaho.SOReportJobFactory is not present.
- if ( !m_bForm && !sDocumentService.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")))
+ // we seem to be a "new style" report, check if report extension is present.
+ Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY );
+ const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_aContext.getUNOContext());
+ Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(sReportEngineServiceName);
+ if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() )
{
- // we seem to be a "new style" report, check if report extension is present.
- Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY );
- const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_aContext.getUNOContext());
- Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(sReportEngineServiceName);
- if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() )
- {
- com::sun::star::io::WrongFormatException aWFE;
- aWFE.Message = DBACORE_RESSTRING( RID_STR_MISSING_EXTENSION );
- throw aWFE;
- }
+ com::sun::star::io::WrongFormatException aWFE;
+ aWFE.Message = DBACORE_RESSTRING( RID_STR_MISSING_EXTENSION );
+ throw aWFE;
}
- if ( !aClassID.getLength() )
+ }
+ if ( !aClassID.getLength() )
+ {
+ if ( m_bForm )
+ aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_SW_CLASSID);
+ else
{
- if ( m_bForm )
- aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_SW_CLASSID);
- else
- {
- aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_RPT_CLASSID_90);
- }
+ aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_RPT_CLASSID_90);
}
}
+ }
- OSL_ENSURE( aClassID.getLength(),"No Class ID" );
+ OSL_ENSURE( aClassID.getLength(),"No Class ID" );
- Sequence< PropertyValue > aEmbeddedObjectDescriptor;
- Sequence< PropertyValue > aLoadArgs( fillLoadArgs(
- i_rConnection, _bSuppressMacros, _bReadOnly, i_rOpenCommandArguments, aEmbeddedObjectDescriptor ) );
+ Sequence< PropertyValue > aEmbeddedObjectDescriptor;
+ Sequence< PropertyValue > aLoadArgs( fillLoadArgs(
+ i_rConnection, _bSuppressMacros, _bReadOnly, i_rOpenCommandArguments, aEmbeddedObjectDescriptor ) );
- m_xEmbeddedObject.set(xEmbedFactory->createInstanceUserInit(aClassID
- ,sDocumentService
- ,xStorage
- ,m_pImpl->m_aProps.sPersistentName
- ,nEntryConnectionMode
- ,aLoadArgs
- ,aEmbeddedObjectDescriptor
- ),UNO_QUERY);
- if ( m_xEmbeddedObject.is() )
+ m_xEmbeddedObject.set(xEmbedFactory->createInstanceUserInit(aClassID
+ ,sDocumentService
+ ,xStorage
+ ,m_pImpl->m_aProps.sPersistentName
+ ,nEntryConnectionMode
+ ,aLoadArgs
+ ,aEmbeddedObjectDescriptor
+ ),UNO_QUERY);
+ if ( m_xEmbeddedObject.is() )
+ {
+ if ( !m_pClientHelper )
{
- if ( !m_pClientHelper )
- {
- m_pClientHelper = new OEmbeddedClientHelper(this);
- m_pClientHelper->acquire();
- }
- Reference<XEmbeddedClient> xClient = m_pClientHelper;
- m_xEmbeddedObject->setClientSite(xClient);
- m_xEmbeddedObject->changeState(EmbedStates::RUNNING);
- if ( bSetSize )
- {
- LockModifiable aLockModify( impl_getComponent_throw( false ) );
+ m_pClientHelper = new OEmbeddedClientHelper(this);
+ m_pClientHelper->acquire();
+ }
+ Reference<XEmbeddedClient> xClient = m_pClientHelper;
+ m_xEmbeddedObject->setClientSite(xClient);
+ m_xEmbeddedObject->changeState(EmbedStates::RUNNING);
+ if ( bSetSize )
+ {
+ LockModifiable aLockModify( impl_getComponent_throw( false ) );
- awt::Size aSize( DEFAULT_WIDTH, DEFAULT_HEIGHT );
- m_xEmbeddedObject->setVisualAreaSize(Aspects::MSOLE_CONTENT,aSize);
- }
+ awt::Size aSize( DEFAULT_WIDTH, DEFAULT_HEIGHT );
+ m_xEmbeddedObject->setVisualAreaSize(Aspects::MSOLE_CONTENT,aSize);
}
- }
+ }
}
}
else
diff --git a/embeddedobj/source/commonembedding/xfactory.hxx b/embeddedobj/source/commonembedding/xfactory.hxx
index eee4602..b7cf022 100644
--- a/embeddedobj/source/commonembedding/xfactory.hxx
+++ b/embeddedobj/source/commonembedding/xfactory.hxx
@@ -20,20 +20,13 @@
#ifndef __XFACTORY_HXX_
#define __XFACTORY_HXX_
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
-#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
-#include <com/sun/star/embed/XLinkCreator.hpp>
-#include <com/sun/star/embed/XLinkFactory.hpp>
+#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase5.hxx>
#include <comphelper/mimeconfighelper.hxx>
-class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper5<
- ::com::sun::star::embed::XEmbedObjectCreator,
- ::com::sun::star::embed::XEmbedObjectFactory,
- ::com::sun::star::embed::XLinkCreator,
- ::com::sun::star::embed::XLinkFactory,
+class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
+ ::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index 599fc7c..83d9b3e 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -20,6 +20,8 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/EntryInitModes.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
+#include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
+#include <com/sun/star/embed/OLEEmbeddedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkFactory.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -28,6 +30,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <rtl/logfile.hxx>
+#include <comphelper/processfactory.hxx>
#include <xcreator.hxx>
@@ -258,12 +261,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
if ( !aFilterName.isEmpty() )
{
// the object can be loaded by one of the office application
- uno::Reference< embed::XEmbedObjectCreator > xOOoEmbCreator(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoEmbeddedObjectFactory" ) )),
- uno::UNO_QUERY );
- if ( !xOOoEmbCreator.is() )
- throw uno::RuntimeException(); // TODO:
+ uno::Reference< embed::XEmbeddedObjectCreator > xOOoEmbCreator =
+ embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOOoEmbCreator->createInstanceInitFromMediaDescriptor( xStorage,
sEntName,
@@ -281,12 +280,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
// Or for example the typename can be used to detect object type if typedetection
// was also extended.
- uno::Reference< embed::XEmbedObjectCreator > xOleEmbCreator(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
- uno::UNO_QUERY );
- if ( !xOleEmbCreator.is() )
- throw uno::RuntimeException(); // TODO:
+ uno::Reference< embed::XEmbeddedObjectCreator > xOleEmbCreator =
+ embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOleEmbCreator->createInstanceInitFromMediaDescriptor( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
@@ -371,12 +366,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
if ( !aFilterName.isEmpty() )
{
// the object can be loaded by one of the office application
- uno::Reference< embed::XLinkCreator > xOOoLinkCreator(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoEmbeddedObjectFactory" ) )),
- uno::UNO_QUERY );
- if ( !xOOoLinkCreator.is() )
- throw uno::RuntimeException(); // TODO:
+ uno::Reference< embed::XEmbeddedObjectCreator > xOOoLinkCreator =
+ embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOOoLinkCreator->createInstanceLink( xStorage,
sEntName,
@@ -406,12 +397,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
static_cast< ::cppu::OWeakObject* >(this) ),
4 );
- uno::Reference< embed::XLinkCreator > xLinkCreator(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
- uno::UNO_QUERY );
- if ( !xLinkCreator.is() )
- throw uno::RuntimeException(); // TODO:
+ uno::Reference< embed::XEmbeddedObjectCreator > xLinkCreator =
+ embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory));
xResult = xLinkCreator->createInstanceLink( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
diff --git a/embeddedobj/source/inc/xcreator.hxx b/embeddedobj/source/inc/xcreator.hxx
index e79f1da..6e63b8b 100644
--- a/embeddedobj/source/inc/xcreator.hxx
+++ b/embeddedobj/source/inc/xcreator.hxx
@@ -20,21 +20,15 @@
#ifndef __XCREATOR_HXX_
#define __XCREATOR_HXX_
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
-#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
-#include <com/sun/star/embed/XLinkCreator.hpp>
-#include <com/sun/star/embed/XLinkFactory.hpp>
+#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <comphelper/mimeconfighelper.hxx>
-class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper5<
- ::com::sun::star::embed::XEmbedObjectCreator,
- ::com::sun::star::embed::XEmbedObjectFactory,
- ::com::sun::star::embed::XLinkCreator,
- ::com::sun::star::embed::XLinkFactory,
+class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper2<
+ ::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx
index 5cd43ac..9b82560 100644
--- a/embeddedobj/source/msole/xdialogcreator.cxx
+++ b/embeddedobj/source/msole/xdialogcreator.cxx
@@ -17,9 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/EntryInitModes.hpp>
+#include <com/sun/star/embed/OLEEmbeddedObjectFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
@@ -182,12 +183,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
{
if (io.dwFlags & IOF_SELECTCREATENEW)
{
- uno::Reference< embed::XEmbedObjectCreator > xEmbCreator(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )),
- uno::UNO_QUERY );
- if ( !xEmbCreator.is() )
- throw uno::RuntimeException();
+ uno::Reference< embed::XEmbeddedObjectCreator > xEmbCreator = embed::EmbeddedObjectCreator::create( comphelper::getComponentContext(m_xFactory) );
uno::Sequence< sal_Int8 > aClassID = MimeConfigurationHelper::GetSequenceClassID( io.clsid.Data1,
io.clsid.Data2,
@@ -221,19 +217,13 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
aMediaDescr[0].Value <<= aFileURL;
// TODO: use config helper for type detection
- uno::Reference< embed::XEmbedObjectCreator > xEmbCreator;
+ uno::Reference< embed::XEmbeddedObjectCreator > xEmbCreator;
::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
if ( aHelper.AddFilterNameCheckOwnFile( aMediaDescr ) )
- xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )),
- uno::UNO_QUERY );
+ xEmbCreator = embed::EmbeddedObjectCreator::create( comphelper::getComponentContext(m_xFactory) );
else
- xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >(
- m_xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
- uno::UNO_QUERY );
+ xEmbCreator = embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
if ( !xEmbCreator.is() )
throw uno::RuntimeException();
diff --git a/embeddedobj/source/msole/xolefactory.hxx b/embeddedobj/source/msole/xolefactory.hxx
index e5fbad4..b1d780b 100644
--- a/embeddedobj/source/msole/xolefactory.hxx
+++ b/embeddedobj/source/msole/xolefactory.hxx
@@ -20,19 +20,15 @@
#ifndef __XFACTORY_HXX_
#define __XFACTORY_HXX_
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
-#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
-#include <com/sun/star/embed/XLinkCreator.hpp>
+#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase2.hxx>
-class OleEmbeddedObjectFactory : public ::cppu::WeakImplHelper4<
- ::com::sun::star::embed::XEmbedObjectCreator,
- ::com::sun::star::embed::XEmbedObjectFactory,
- ::com::sun::star::embed::XLinkCreator,
+class OleEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
+ ::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index a8d540a..47bec3c 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -114,10 +114,13 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing/fr
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
DocumentCloser \
+ EmbeddedObjectCreator \
FileSystemStorageFactory \
HatchWindowFactory \
InstanceLocker \
OLESimpleStorage \
+ OLEEmbeddedObjectFactory \
+ OOoEmbeddedObjectFactory \
StorageFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/inspection,\
@@ -2336,6 +2339,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/embed,\
XComponentSupplier \
XEmbedObjectClipboardCreator \
XEmbedObjectCreator \
+ XEmbeddedObjectCreator \
XEmbedObjectFactory \
XEmbedPersist \
XEmbeddedClient \
diff --git a/offapi/com/sun/star/embed/EmbeddedObjectCreator.idl b/offapi/com/sun/star/embed/EmbeddedObjectCreator.idl
new file mode 100644
index 0000000..19ef22b
--- /dev/null
+++ b/offapi/com/sun/star/embed/EmbeddedObjectCreator.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_embed_EmbeddedObjectCreator_idl__
+#define __com_sun_star_embed_EmbeddedObjectCreator_idl__
+
+#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
+
+
+ module com { module sun { module star { module embed {
+
+/**
+ @since LibreOffice 4.1
+ */
+service EmbeddedObjectCreator : XEmbeddedObjectCreator;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/embed/OLEEmbeddedObjectFactory.idl b/offapi/com/sun/star/embed/OLEEmbeddedObjectFactory.idl
new file mode 100644
index 0000000..f4f6188
--- /dev/null
+++ b/offapi/com/sun/star/embed/OLEEmbeddedObjectFactory.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_embed_OLEEmbeddedObjectFactory_idl__
+#define __com_sun_star_embed_OLEEmbeddedObjectFactory_idl__
+
+#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
+
+
+ module com { module sun { module star { module embed {
+
+/**
+ @since LibreOffice 4.1
+ */
+service OLEEmbeddedObjectFactory : XEmbeddedObjectCreator;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/embed/OOoEmbeddedObjectFactory.idl b/offapi/com/sun/star/embed/OOoEmbeddedObjectFactory.idl
new file mode 100644
index 0000000..c5568a3
--- /dev/null
+++ b/offapi/com/sun/star/embed/OOoEmbeddedObjectFactory.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_embed_OOoEmbeddedObjectFactory_idl__
+#define __com_sun_star_embed_OOoEmbeddedObjectFactory_idl__
+
+#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
+
+
+ module com { module sun { module star { module embed {
+
+/**
+ @since LibreOffice 4.1
+ */
+service OOoEmbeddedObjectFactory : XEmbeddedObjectCreator;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/embed/XEmbeddedObjectCreator.idl b/offapi/com/sun/star/embed/XEmbeddedObjectCreator.idl
new file mode 100644
index 0000000..b886865
--- /dev/null
+++ b/offapi/com/sun/star/embed/XEmbeddedObjectCreator.idl
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_embed_XEmbeddedObjectCreator_idl__
+#define __com_sun_star_embed_XEmbeddedObjectCreator_idl__
+
+#include <com/sun/star/embed/XEmbedObjectCreator.idl>
+#include <com/sun/star/embed/XEmbedObjectFactory.idl>
+#include <com/sun/star/embed/XLinkCreator.idl>
+#include <com/sun/star/embed/XLinkFactory.idl>
+
+ module com { module sun { module star { module embed {
+
+/**
+ @since LibreOffice 4.1
+ */
+interface XEmbeddedObjectCreator
+{
+ interface XEmbedObjectCreator;
+ interface XEmbedObjectFactory;
+ interface XLinkCreator;
+ [optional] interface XLinkFactory;
+};
+
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 11e8e6e..7f59deb 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -20,7 +20,8 @@
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/embed/EmbedStates.hpp>
-#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
+#include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
@@ -279,8 +280,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
@@ -568,9 +568,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
{
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
- uno::Reference < embed::XLinkCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OOoEmbeddedObjectFactory")) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
+ embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
aMediaDescriptor[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
@@ -701,8 +700,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
@@ -833,8 +831,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
- uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
commit 64fc0ccde17bbe80fb25f9e07ba68f6aa304c3ef
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 11:49:10 2013 +0200
fdo#46808, Convert starmath/mathmlimport to XComponentContext
Change-Id: I93e103851117b27234393341360b2eddbe1b0e1c
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 8ab181e..8a4f3a0 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -102,11 +102,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
{
sal_uLong nError = ERRCODE_SFX_DOLOADFAILED;
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory(
- comphelper::getProcessServiceFactory());
- OSL_ENSURE(xServiceFactory.is(), "XMLReader::Read: got no service manager");
- if ( !xServiceFactory.is() )
- return nError;
+ uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() );
//Make a model component from our SmModel
uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY );
@@ -206,7 +202,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
sal_uLong nWarn = ReadThroughComponent(
rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml",
- xServiceFactory, xInfoSet,
+ xContext, xInfoSet,
(bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter"
: "com.sun.star.comp.Math.XMLMetaImporter") );
@@ -217,7 +213,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
nWarn = ReadThroughComponent(
rMedium.GetStorage(), xModelComp, "settings.xml", 0,
- xServiceFactory, xInfoSet,
+ xContext, xInfoSet,
(bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter"
: "com.sun.star.comp.Math.XMLSettingsImporter" ) );
@@ -228,7 +224,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
nError = ReadThroughComponent(
rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml",
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter" );
+ xContext, xInfoSet, "com.sun.star.comp.Math.XMLImporter" );
}
else
nError = ERRCODE_IO_BROKENPACKAGE;
@@ -245,7 +241,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
xStatusIndicator->setValue(nSteps++);
nError = ReadThroughComponent( xInputStream, xModelComp,
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter", false );
+ xContext, xInfoSet, "com.sun.star.comp.Math.XMLImporter", false );
}
if (xStatusIndicator.is())
@@ -258,7 +254,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
sal_uLong SmXMLImportWrapper::ReadThroughComponent(
Reference<io::XInputStream> xInputStream,
Reference<XComponent> xModelComponent,
- Reference<lang::XMultiServiceFactory> & rFactory,
+ Reference<uno::XComponentContext> & rxContext,
Reference<beans::XPropertySet> & rPropSet,
const sal_Char* pFilterName,
sal_Bool bEncrypted )
@@ -266,7 +262,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
sal_uLong nError = ERRCODE_SFX_DOLOADFAILED;
OSL_ENSURE(xInputStream.is(), "input stream missing");
OSL_ENSURE(xModelComponent.is(), "document missing");
- OSL_ENSURE(rFactory.is(), "factory missing");
+ OSL_ENSURE(rxContext.is(), "factory missing");
OSL_ENSURE(NULL != pFilterName,"I need a service name for the component!");
// prepare ParserInputSrouce
@@ -274,15 +270,15 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
aParserInput.aInputStream = xInputStream;
// get parser
- Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(rFactory));
+ Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);
Sequence<Any> aArgs( 1 );
aArgs[0] <<= rPropSet;
// get filter
Reference< xml::sax::XDocumentHandler > xFilter(
- rFactory->createInstanceWithArguments(
- OUString::createFromAscii(pFilterName), aArgs ),
+ rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ OUString::createFromAscii(pFilterName), aArgs, rxContext),
UNO_QUERY );
OSL_ENSURE( xFilter.is(), "Can't instantiate filter component." );
if ( !xFilter.is() )
@@ -358,7 +354,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
Reference<XComponent> xModelComponent,
const sal_Char* pStreamName,
const sal_Char* pCompatibilityStreamName,
- Reference<lang::XMultiServiceFactory> & rFactory,
+ Reference<uno::XComponentContext> & rxContext,
Reference<beans::XPropertySet> & rPropSet,
const sal_Char* pFilterName )
{
@@ -397,7 +393,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
Reference < io::XInputStream > xStream = xEventsStream->getInputStream();
- return ReadThroughComponent( xStream, xModelComponent, rFactory, rPropSet, pFilterName, bEncrypted );
+ return ReadThroughComponent( xStream, xModelComponent, rxContext, rPropSet, pFilterName, bEncrypted );
}
catch ( packages::WrongPasswordException& )
{
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index 213901b..00405e1 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -50,7 +50,7 @@ public:
sal_uLong ReadThroughComponent(
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xModelComponent,
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rFactory,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & rPropSet,
const sal_Char* pFilterName,
@@ -61,7 +61,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xModelComponent,
const sal_Char* pStreamName,
const sal_Char* pCompatibilityStreamName,
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rFactory,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & rPropSet,
const sal_Char* pFilterName );
commit 23ef230fa0db1f6599ef22edc25e5ce16cc43c41
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 11:35:18 2013 +0200
fdo#46808, Use service constructor for presentation::SlideShow
Change-Id: Ib757190a9452e8cb69bff417ebd7b558038e1537
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index ea48eee..d317fca 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/presentation/SlideShow.hpp>
#include <svl/aeitem.hxx>
#include <svl/urihelper.hxx>
@@ -2437,13 +2438,10 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const
try
{
- Reference< lang::XMultiServiceFactory > xFactory(
- ::comphelper::getProcessServiceFactory(),
- UNO_QUERY_THROW );
+ Reference< uno::XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
- Reference< XInterface > xInt( xFactory->createInstance( "com.sun.star.presentation.SlideShow" ) );
-
- xShow.set( xInt, UNO_QUERY_THROW );
+ xShow.set( presentation::SlideShow::create(xContext), UNO_QUERY_THROW );
}
catch( uno::Exception& )
{
diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx
index 46a026b..8c9907c 100644
--- a/slideshow/test/demoshow.cxx
+++ b/slideshow/test/demoshow.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
-#include <com/sun/star/presentation/XSlideShow.hpp>
+#include <com/sun/star/presentation/SlideShow.hpp>
#include <com/sun/star/presentation/XSlideShowView.hpp>
#include "com/sun/star/animations/TransitionType.hpp"
#include "com/sun/star/animations/TransitionSubType.hpp"
@@ -430,14 +430,10 @@ void DemoWindow::init()
{
if( !mxShow.is() )
{
- uno::Reference< lang::XMultiServiceFactory > xFactory(
- ::comphelper::getProcessServiceFactory(),
- uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext =(
+ ::comphelper::getProcessComponentContext();
- uno::Reference< uno::XInterface > xInt( xFactory->createInstance(
- ::rtl::OUString("com.sun.star.presentation.SlideShow") ));
-
- mxShow.set( xInt,
+ mxShow.set( presentation::SlideShow::create(xContext),
uno::UNO_QUERY_THROW );
maLeftChild.setShow( mxShow );
commit 28f0a6de18d79432d30becdd20d25301f93e86e9
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 11:26:38 2013 +0200
fdo#46808, Remove unnecessary call to getProcessServiceFactory
Change-Id: I8427c2753a75a548a6b2e56516f62cb736562ffa
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 6923d99..c4a88b3 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <comphelper/genericpropertyset.hxx>
-#include <comphelper/processfactory.hxx>
#include <oox/ppt/pptimport.hxx>
#include <oox/ppt/slidepersist.hxx>
#endif
@@ -486,7 +485,6 @@ float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
// debugging pptx import problems.
void TextParagraphProperties::dump() const
{
- Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
Reference< ::com::sun::star::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( "com.sun.star.presentation.TitleTextShape" ), UNO_QUERY );
Reference< ::com::sun::star::text::XText > xText( xShape, UNO_QUERY );
commit 549578a4ea996260437b355c39896593afc60726
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 8 11:24:30 2013 +0200
fdo#46808, Convert services in i18npool to XComponentContext
Change-Id: I3aeaca995bc9a3d865b6955aa47cee4d9eb07750
diff --git a/i18npool/inc/calendarImpl.hxx b/i18npool/inc/calendarImpl.hxx
index 16753bb..baf0b60 100644
--- a/i18npool/inc/calendarImpl.hxx
+++ b/i18npool/inc/calendarImpl.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/i18n/CalendarDisplayIndex.hpp>
#include <cppuhelper/implbase2.hxx> // helper for implementations
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <vector>
// ----------------------------------------------------
@@ -43,7 +44,7 @@ public:
// Constructors
CalendarImpl() {};
- CalendarImpl(const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF);
+ CalendarImpl(const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext);
/**
* Destructor
@@ -96,7 +97,7 @@ private:
com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar;
};
std::vector<lookupTableItem*> lookupTable;
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
+ com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar;
};
diff --git a/i18npool/inc/characterclassificationImpl.hxx b/i18npool/inc/characterclassificationImpl.hxx
index ec91f4c..2c7d34b 100644
--- a/i18npool/inc/characterclassificationImpl.hxx
+++ b/i18npool/inc/characterclassificationImpl.hxx
@@ -24,6 +24,7 @@
#include <vector>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace com { namespace sun { namespace star { namespace i18n {
@@ -35,7 +36,7 @@ class CharacterClassificationImpl : public cppu::WeakImplHelper2
{
public:
- CharacterClassificationImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF );
+ CharacterClassificationImpl( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext );
virtual ~CharacterClassificationImpl();
virtual rtl::OUString SAL_CALL toUpper( const rtl::OUString& Text,
@@ -95,7 +96,7 @@ private:
std::vector<lookupTableItem*> lookupTable;
lookupTableItem *cachedItem;
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
+ com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference < XCharacterClassification > xUCI;
com::sun::star::uno::Reference < XCharacterClassification > SAL_CALL
diff --git a/i18npool/inc/indexentrysupplier.hxx b/i18npool/inc/indexentrysupplier.hxx
index 981c18e..698e93d 100644
--- a/i18npool/inc/indexentrysupplier.hxx
+++ b/i18npool/inc/indexentrysupplier.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
#include <cppuhelper/implbase2.hxx> // helper for implementations
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace com { namespace sun { namespace star { namespace i18n {
@@ -35,7 +36,7 @@ class IndexEntrySupplier : public cppu::WeakImplHelper2
>
{
public:
- IndexEntrySupplier( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF );
+ IndexEntrySupplier( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext );
// Methods
virtual com::sun::star::uno::Sequence < com::sun::star::lang::Locale > SAL_CALL getLocaleList()
@@ -87,7 +88,7 @@ public:
private:
rtl::OUString aServiceName;
com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedIndexEntrySupplier > xIES;
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
+ com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
sal_Bool SAL_CALL createLocaleSpecificIndexEntrySupplier(const rtl::OUString& name) throw( com::sun::star::uno::RuntimeException );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list