diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-03-23 16:01:00 +0000 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:39:53 +0200 |
commit | e4a54befd07322b63eac95012f881ef7e382627f (patch) | |
tree | 4323fa318c305a7c28fd76e3fcc6710295d688bc | |
parent | aebe0af1cd0291a271ec6c2763c37b829b4b8075 (diff) |
tubes: update readme, get -something- working wrt. document transfer
-rw-r--r-- | sc/CppunitTest_sc_ucalc.mk | 6 | ||||
-rw-r--r-- | sc/source/ui/collab/sendfunc.cxx | 36 | ||||
-rw-r--r-- | tubes/README | 18 |
3 files changed, 58 insertions, 2 deletions
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk index e0d836dc1611..cf9b657e8c7c 100644 --- a/sc/CppunitTest_sc_ucalc.mk +++ b/sc/CppunitTest_sc_ucalc.mk @@ -43,6 +43,12 @@ $(call gb_CxxObject_get_target,sc/qa/unit/ucalc): \ $(WORKDIR)/AllLangRes/frm \ $(WORKDIR)/AllLangRes/sc \ +ifeq ($(ENABLE_TELEPATHY),TRUE) +$(eval $(call gb_Library_add_linked_libs,sc_ucalc,\ + tubes \ +)) +endif + $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \ avmedia \ basegfx \ diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index 1026d9be5755..adda0d2414da 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -41,9 +41,14 @@ #include <unotools/tempfile.hxx> #include <unotools/localfilehelper.hxx> #include <comphelper/mediadescriptor.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> #include <com/sun/star/frame/XLoadable.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/document/XDocumentRecovery.hpp> +#include <com/sun/star/util/XCloseable.hpp> namespace css = ::com::sun::star; @@ -308,7 +313,8 @@ IMPL_LINK( ScDocFuncRecv, ReceiveFileCallback, rtl::OUString *, pStr ) fprintf( stderr, "incoming file '%s'\n", rtl::OUStringToOString( *pStr, RTL_TEXTENCODING_UTF8 ).getStr() ); - css::uno::Sequence < css::beans::PropertyValue > aLoadArgs(5); + // using the frame::XLoadable interface fails with a DoubleInitializationException +/* css::uno::Sequence < css::beans::PropertyValue > aLoadArgs(5); aLoadArgs[0].Name = rtl::OUString( "URL" ); aLoadArgs[0].Value <<= (*pStr); aLoadArgs[1].Name = rtl::OUString( "FilterName" ); @@ -320,7 +326,6 @@ IMPL_LINK( ScDocFuncRecv, ReceiveFileCallback, rtl::OUString *, pStr ) aLoadArgs[3].Value <<= sal_Int32( 3 ); aLoadArgs[4].Name = rtl::OUString( "UpdateDocMode" ); aLoadArgs[4].Value <<= sal_Int32( 2 ); - try { css::uno::Reference < css::frame::XLoadable > xLoad( @@ -331,6 +336,33 @@ IMPL_LINK( ScDocFuncRecv, ReceiveFileCallback, rtl::OUString *, pStr ) { fprintf( stderr, "exception when loading '%s' !\n", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); + } */ +// #2 - tried out the SfxAutoReloadTimer_Impl - shove stuff at the SID_RELOAD slot ... + +// #3 - can we use the framework/inc/services/frame.hxx 's "sTargetFrameName" +// magic to load into our current frame ? ... :-) + + css::uno::Reference< css::lang::XMultiServiceFactory > rFactory = + ::comphelper::getProcessServiceFactory(); + + css::uno::Sequence < css::beans::PropertyValue > args(0); +// FIXME: should this be hidden before it is synched & ready ? ... +// args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden")); +// args[0].Value <<= sal_True; + try + { + css::uno::Reference < css::frame::XComponentLoader > xLoader( + ::comphelper::getProcessServiceFactory()->createInstance( + "com.sun.star.frame.Desktop" ), + css::uno::UNO_QUERY_THROW ); + css::uno::Reference < css::util::XCloseable > xDoc( + xLoader->loadComponentFromURL( *pStr, "_blank", 0, args ), + css::uno::UNO_QUERY_THROW ); + } + catch ( css::uno::Exception& e ) + { + fprintf( stderr, "exception when loading '%s' !\n", + rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } return 0; diff --git a/tubes/README b/tubes/README index 3f2f637c5a47..126114acf9ee 100644 --- a/tubes/README +++ b/tubes/README @@ -25,6 +25,24 @@ make everything service-activatable: Otherwise, you need to make sure liboapprover and a Telepathy-enabled LibreOffice are running. +Status 2012-03-23: + +* To do interesting things with this code build and run calc thus: + + SAL_LOG=1 LIBO_TUBES=slave ./soffice -calc # user one + SAL_LOG=1 LIBO_TUBES=master ./soffice -calc # user two + + hope that a nasty race-condition doesn't occur during startup: +which is flagged by "we are supposed to handle only one channel" you +hit it: bang - just try again. + + you also require only a single jabber connection enabled (in +empathy) and to have your opponent added and approved on both sides. + + Now type simple strings into cells, rename sheets, or type +'saveme' to transfer your document as-is to the other side ... + + Status 2012-03-20: * no LibO code depends on this module yet, so it is not built in a regular |