[Libreoffice-commits] .: embedserv/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 4 09:07:26 PDT 2012


 embedserv/source/embed/docholder.cxx |   39 ++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit 31713fee3c117007dbd322cbfc2971e52899d04c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 4 18:05:46 2012 +0200

    Fix an InteractionHandler new-style service use
    
    Change-Id: I593467dce8f1e70e1f5068d722dfa0654d3346b7

diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 1a8f290..a2a91a5 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -59,6 +59,7 @@
 #include <com/sun/star/embed/XVisualObject.hpp>
 #include <com/sun/star/document/MacroExecMode.hpp>
 #include <com/sun/star/task/InteractionHandler.hpp>
+#include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
 #include <rtl/process.h>
 
@@ -113,9 +114,8 @@ void DocumentHolder::LoadDocInFrame( sal_Bool bPluginMode )
         m_xFrame,uno::UNO_QUERY);
     if( xComponentLoader.is() && m_xDocument.is() )
     {
-        uno::Reference< task::XInteractionHandler > xHandler(
-            task::InteractionHandler::create(comphelper::getComponentContext(m_xFactory)),
-            uno::UNO_QUERY_THROW );
+        uno::Reference< task::XInteractionHandler2 > xHandler(
+            task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0) );
 
         uno::Any aAny;
         sal_Int32 nLen = 3;
@@ -158,25 +158,22 @@ void DocumentHolder::LoadDocInFrame( sal_Bool bPluginMode )
                 beans::PropertyState_DIRECT_VALUE);
         }
 
-        if ( xHandler.is() )
-        {
-            aSeq.realloc( nLen+=2 );
-            aAny <<= xHandler;
-            aSeq[nLen-2] = beans::PropertyValue(
-                rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")),
-                -1,
-                aAny,
-                beans::PropertyState_DIRECT_VALUE);
+        aSeq.realloc( nLen+=2 );
+        aAny <<= xHandler;
+        aSeq[nLen-2] = beans::PropertyValue(
+            rtl::OUString(
+                RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")),
+            -1,
+            aAny,
+            beans::PropertyState_DIRECT_VALUE);
 
-            aAny <<= m_nMacroExecMode;
-            aSeq[nLen-1] = beans::PropertyValue(
-                rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")),
-                -1,
-                aAny,
-                beans::PropertyState_DIRECT_VALUE);
-        }
+        aAny <<= m_nMacroExecMode;
+        aSeq[nLen-1] = beans::PropertyValue(
+            rtl::OUString(
+                RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")),
+            -1,
+            aAny,
+            beans::PropertyState_DIRECT_VALUE);
 
         xComponentLoader->loadComponentFromURL(
             rtl::OUString(


More information about the Libreoffice-commits mailing list