summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-27 15:16:02 +0200
committerNoel Grandin <noel@peralex.com>2013-03-07 08:23:39 +0200
commita3bb733ec6c6af04041c0b2a9849df22c26b3d29 (patch)
tree4eebd3cafbed5f1d401afcb378928bed7781f072 /sfx2
parentcd8ea20aa4b85128956a79c80f7953d30e99e802 (diff)
fdo#46808, Convert singleton theMasterScriptProviderFactory
Change-Id: I647a02e552acdd354463fc46c13c5a73b1c90d09
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objmisc.cxx21
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx7
2 files changed, 13 insertions, 15 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index d4c66619ae4e..f150a01bab27 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -27,12 +27,16 @@
#include <osl/mutex.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/document/XScriptInvocationContext.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/script/FinishEngineEvent.hpp>
#include <com/sun/star/script/InterruptReason.hpp>
#include <com/sun/star/script/XEngineListener.hpp>
@@ -43,16 +47,12 @@
#include <com/sun/star/script/XEngine.hpp>
#include <com/sun/star/script/InterruptEngineEvent.hpp>
#include <com/sun/star/script/XLibraryAccess.hpp>
-#include <com/sun/star/document/MacroExecMode.hpp>
-#include <com/sun/star/document/XScriptInvocationContext.hpp>
-#include <com/sun/star/embed/EmbedStates.hpp>
-#include <com/sun/star/embed/XEmbedPersist.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
#include <com/sun/star/script/provider/XScript.hpp>
#include <com/sun/star/script/provider/XScriptProvider.hpp>
#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
#include <toolkit/unohlp.hxx>
@@ -1541,9 +1541,8 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
if ( !xScriptProvider.is() )
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< provider::XScriptProviderFactory > xScriptProviderFactory(
- aContext.getSingleton( "com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
+ Reference< provider::XScriptProviderFactory > xScriptProviderFactory =
+ provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
xScriptProvider.set( xScriptProviderFactory->createScriptProvider( makeAny( _rxScriptContext ) ), UNO_SET_THROW );
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index e62cb4a71953..a37e4a7c8c35 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
+#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
#include <com/sun/star/script/provider/XScriptProvider.hpp>
#include <com/sun/star/ui/UIConfigurationManager.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -3403,9 +3403,8 @@ uno::Reference< script::provider::XScriptProvider > SAL_CALL SfxBaseModel::getSc
uno::Reference< script::provider::XScriptProvider > xScriptProvider;
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< script::provider::XScriptProviderFactory > xScriptProviderFactory(
- aContext.getSingleton( "com.sun.star.script.provider.theMasterScriptProviderFactory" ), uno::UNO_QUERY_THROW );
+ Reference< script::provider::XScriptProviderFactory > xScriptProviderFactory =
+ script::provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
try
{