summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/collab/contacts.cxx9
-rw-r--r--sc/source/ui/collab/sendfunc.cxx28
-rw-r--r--sc/source/ui/collab/sendfunc.hxx3
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
4 files changed, 27 insertions, 15 deletions
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx
index d81ff9a65b58..c2cc8b6488ef 100644
--- a/sc/source/ui/collab/contacts.cxx
+++ b/sc/source/ui/collab/contacts.cxx
@@ -98,11 +98,6 @@ class TubeContacts : public ModelessDialog
// Receiving file is not related to any document.
mpManager->sigFileReceived.connect( boost::bind(
&ScDocFuncRecv::fileReceived, mpSender->GetReceiver(), _1 ) );
-
- // TODO: It's still not clear to me who should take care of this signal
- // and what exactly it is supposed to happen.
- mpManager->sigConferenceCreated.connect( boost::bind(
- &ScDocFuncSend::SetCollaboration, mpSender, _1 ) );
}
}
@@ -124,7 +119,11 @@ class TubeContacts : public ModelessDialog
fprintf( stderr, "could not start session with %s\n",
tp_contact_get_identifier( pContact ) );
else
+ {
mpSender->SetCollaboration( pConference );
+ mpSender->SendFile( OStringToOUString(
+ pConference->getUuid(), RTL_TEXTENCODING_UTF8 ) );
+ }
}
}
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index d22e4ba3b143..4b3d1c92f769 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -39,6 +39,7 @@
#include <tubes/manager.hxx>
#include <tubes/conference.hxx>
#include <tubes/contact-list.hxx>
+#include <tubes/constants.h>
// new file send/recv fun ...
#include <com/sun/star/uno/Sequence.hxx>
@@ -232,12 +233,13 @@ void ScDocFuncSend::SendMessage( ScChangeOpWriter &rOp )
mpDirect->RecvMessage( rOp.toString() );
}
-void ScDocFuncSend::SendFile( const rtl::OUString &rURL )
+void ScDocFuncSend::SendFile( const rtl::OUString &sUuid )
{
- (void)rURL;
-
String aTmpPath = utl::TempFile::CreateTempName();
- aTmpPath.Append( rtl::OUString( ".ods" ) );
+ aTmpPath.Append( OUString("_") );
+ aTmpPath.Append( sUuid );
+ aTmpPath.Append( OUString("_") );
+ aTmpPath.Append( OUString(".ods") );
rtl::OUString aFileURL;
::utl::LocalFileHelper::ConvertPhysicalNameToURL( aTmpPath, aFileURL );
@@ -416,22 +418,30 @@ sal_Bool ScDocFuncSend::MergeCells( const ScCellMergeOption& rOption, sal_Bool b
return ScDocFunc::MergeCells( rOption, bContents, bRecord, bApi );
}
-#ifdef INTERCEPT
-SC_DLLPRIVATE ScDocFunc *ScDocShell::CreateDocFunc()
+ScDocFunc *ScDocShell::CreateDocFunc()
{
if (getenv ("INTERCEPT"))
{
- boost::shared_ptr<ScDocFuncDirect> pDirect( new ScDocFuncDirect( *this ) );
+ ScDocFuncDirect* pDirect = new ScDocFuncDirect( *this );
boost::shared_ptr<ScDocFuncRecv> pReceiver( new ScDocFuncRecv( pDirect ) );
static boost::shared_ptr<ScDocFuncDemo> aDemoBus( new ScDocFuncDemo() );
aDemoBus->add_client( pReceiver ); // a lifecycle horror no doubt.
- return new ScDocFuncSend( *this, boost::shared_ptr<ScDocFuncRecv>( aDemoBus.get() ) );
+ return new ScDocFuncSend( *this, aDemoBus.get() );
+ }
+ else if (TeleManager::hasWaitingConference())
+ {
+ ScDocFuncDirect *pDirect = new ScDocFuncDirect( *this );
+ ScDocFuncRecv *pReceiver = new ScDocFuncRecv( pDirect );
+ ScDocFuncSend *pSender = new ScDocFuncSend( *this, pReceiver );
+ TeleManager *pManager = TeleManager::get();
+ pSender->SetCollaboration( pManager->getConference() );
+ pManager->unref();
+ return pSender;
}
else
return new ScDocFuncDirect( *this );
}
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx
index 981363358065..f9c2bcfaa239 100644
--- a/sc/source/ui/collab/sendfunc.hxx
+++ b/sc/source/ui/collab/sendfunc.hxx
@@ -229,7 +229,6 @@ class ScDocFuncSend : public ScDocFunc
TeleConference *mpConference;
void SendMessage( ScChangeOpWriter &rOp );
- void SendFile( const rtl::OUString &rURL );
public:
// FIXME: really ScDocFunc should be an abstract base, so
@@ -240,6 +239,8 @@ public:
void SetCollaboration( TeleConference* pConference );
TeleConference* GetConference();
ScDocFuncRecv* GetReceiver();
+ // TODO: I think this could be moved to TeleManager later.
+ void SendFile( const rtl::OUString &rURL );
virtual void EnterListAction( sal_uInt16 nNameResId );
virtual void EndListAction();
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index cfdd45590a46..2c3d5ac0c445 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2500,10 +2500,12 @@ sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter )
|| rFilter.EqualsAscii( pFilterRtf );
}
+#ifndef ENABLE_TELEPATHY
ScDocFunc *ScDocShell::CreateDocFunc()
{
return new ScDocFuncDirect( *this );
}
+#endif
ScDocShell::ScDocShell( const ScDocShell& rShell ) :
SvRefBase(),