[Libreoffice-commits] core.git: Branch 'private/kohei/headless-perf' - desktop/source sfx2/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed May 28 09:47:18 PDT 2014


 desktop/source/lib/init.cxx  |    9 ++++++---
 sfx2/source/view/frmload.cxx |   14 +++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 8b6ede02a9850fa5e6b6437630cb6b7222a9d325
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 11:13:26 2014 -0400

    Disable script and document recovery when running from lo_documentLoad.
    
    Change-Id: Ie8efb01d02e9e74ff552f13d182ea10737d86121

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3b04559..540d982 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -206,10 +206,13 @@ static LibreOfficeDocument* lo_documentLoad(LibreOffice* pThis, const char* pURL
 
     try
     {
+        uno::Sequence<css::beans::PropertyValue> aArgs(2);
+        aArgs[0].Name = "EmbeddedScriptSupport";
+        aArgs[0].Value <<= false;
+        aArgs[1].Name = "DocumentRecoverySupport";
+        aArgs[1].Value <<= false;
         uno::Reference<lang::XComponent> xComponent;
-        xComponent = xComponentLoader->loadComponentFromURL(
-                                            aURL, OUString("_blank"), 0,
-                                            uno::Sequence<css::beans::PropertyValue>());
+        xComponent = xComponentLoader->loadComponentFromURL(aURL, "_blank", 0, aArgs);
 
         if (xComponent.is())
             return new LibLODocument_Impl(xComponent);
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index afbf092..27ca42d 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -687,7 +687,19 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
 
             // create the new doc
             const OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", OUString() );
-            xModel.set( m_aContext->getServiceManager()->createInstanceWithContext(sServiceName, m_aContext), UNO_QUERY_THROW );
+            bool bScript = aDescriptor.getOrDefault("EmbeddedScriptSupport", true);
+            bool bDocRecovery = aDescriptor.getOrDefault("DocumentRecoverySupport", true);
+
+            uno::Sequence<uno::Any> aArgs(2);
+            beans::PropertyValue aVal;
+            aVal.Name = "EmbeddedScriptSupport";
+            aVal.Value <<= bScript;
+            aArgs[0] <<= aVal;
+            aVal.Name = "DocumentRecoverySupport";
+            aVal.Value <<= bDocRecovery;
+            aArgs[1] <<= aVal;
+
+            xModel.set( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sServiceName, aArgs, m_aContext), UNO_QUERY_THROW );
 
             // load resp. init it
             const Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW );


More information about the Libreoffice-commits mailing list