Kaydet (Commit) 374fb913 authored tarafından Matúš Kukan's avatar Matúš Kukan

tubes: make ScDocShell* member of ScCollaboration

Change-Id: I8e9bab6d97e7fb4a3de3b3d3896a57c6496958bd
üst 56977dfa
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
#include "docsh.hxx" #include "docsh.hxx"
#include "sendfunc.hxx" #include "sendfunc.hxx"
ScCollaboration::ScCollaboration() ScCollaboration::ScCollaboration( ScDocShell* pScDocShell ) :
mpScDocShell( pScDocShell )
{ {
} }
...@@ -31,21 +32,20 @@ TeleConference* ScCollaboration::GetConference() ...@@ -31,21 +32,20 @@ TeleConference* ScCollaboration::GetConference()
sal_uInt64 ScCollaboration::GetId() sal_uInt64 ScCollaboration::GetId()
{ {
return reinterpret_cast<sal_uInt64> (SfxObjectShell::Current()); return reinterpret_cast<sal_uInt64> (mpScDocShell);
} }
void ScCollaboration::SetCollaboration( TeleConference* pConference ) void ScCollaboration::SetCollaboration( TeleConference* pConference )
{ {
ScDocShell* pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current()); ScDocFunc* pDocFunc = &mpScDocShell->GetDocFunc();
ScDocFunc* pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
ScDocFuncSend* pSender = dynamic_cast<ScDocFuncSend*> (pDocFunc); ScDocFuncSend* pSender = dynamic_cast<ScDocFuncSend*> (pDocFunc);
if (!pSender) if (!pSender)
{ {
// This means pDocFunc has to be ScDocFuncDirect* and we are not collaborating yet. // This means pDocFunc has to be ScDocFuncDirect* and we are not collaborating yet.
ScDocFuncDirect *pDirect = dynamic_cast<ScDocFuncDirect*> (pDocFunc); ScDocFuncDirect *pDirect = dynamic_cast<ScDocFuncDirect*> (pDocFunc);
ScDocFuncRecv *pReceiver = new ScDocFuncRecv( pDirect ); ScDocFuncRecv *pReceiver = new ScDocFuncRecv( pDirect );
pSender = new ScDocFuncSend( *pScDocShell, pReceiver ); pSender = new ScDocFuncSend( *mpScDocShell, pReceiver );
pScDocShell->SetDocFunc( pSender ); mpScDocShell->SetDocFunc( pSender );
} }
pSender->SetCollaboration( pConference ); pSender->SetCollaboration( pConference );
} }
...@@ -59,9 +59,7 @@ void ScCollaboration::SendFile( TpContact* pContact, const OUString& rURL ) ...@@ -59,9 +59,7 @@ void ScCollaboration::SendFile( TpContact* pContact, const OUString& rURL )
ScDocFuncSend* ScCollaboration::GetScDocFuncSend() ScDocFuncSend* ScCollaboration::GetScDocFuncSend()
{ {
ScDocShell *pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current()); return dynamic_cast<ScDocFuncSend*> (&mpScDocShell->GetDocFunc());
ScDocFunc *pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
return dynamic_cast<ScDocFuncSend*> (pDocFunc);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -2540,7 +2540,7 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) : ...@@ -2540,7 +2540,7 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) :
pSheetSaveData ( NULL ), pSheetSaveData ( NULL ),
pModificator ( NULL ) pModificator ( NULL )
#ifdef ENABLE_TELEPATHY #ifdef ENABLE_TELEPATHY
, mpCollaboration( new ScCollaboration() ) , mpCollaboration( new ScCollaboration( this ) )
#endif #endif
{ {
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
...@@ -2589,7 +2589,7 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) : ...@@ -2589,7 +2589,7 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
pSheetSaveData ( NULL ), pSheetSaveData ( NULL ),
pModificator ( NULL ) pModificator ( NULL )
#ifdef ENABLE_TELEPATHY #ifdef ENABLE_TELEPATHY
, mpCollaboration( new ScCollaboration() ) , mpCollaboration( new ScCollaboration( this ) )
#endif #endif
{ {
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
......
...@@ -12,11 +12,13 @@ ...@@ -12,11 +12,13 @@
#include <tubes/collaboration.hxx> #include <tubes/collaboration.hxx>
class ScDocFuncSend; class ScDocFuncSend;
class ScDocShell;
class ScCollaboration : public Collaboration class ScCollaboration : public Collaboration
{ {
ScDocShell* mpScDocShell;
public: public:
ScCollaboration(); ScCollaboration( ScDocShell* pScDocShell );
virtual ~ScCollaboration(); virtual ~ScCollaboration();
virtual TeleConference* GetConference(); virtual TeleConference* GetConference();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment