summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-08-03 23:32:58 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-08-04 01:57:15 +0200
commit374fb913a78edaa765e0f731d823d6e8180f56fe (patch)
tree375a61d00fa5dabfc31049b677c2bce92f3287e5 /sc
parent56977dfaa541dfc06f2cec921a49f5a68a8dbcb9 (diff)
tubes: make ScDocShell* member of ScCollaboration
Change-Id: I8e9bab6d97e7fb4a3de3b3d3896a57c6496958bd
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/collab/sccollaboration.cxx16
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/inc/sccollaboration.hxx4
3 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/collab/sccollaboration.cxx b/sc/source/ui/collab/sccollaboration.cxx
index fbdbe0a0938d..aea2f0b34e2a 100644
--- a/sc/source/ui/collab/sccollaboration.cxx
+++ b/sc/source/ui/collab/sccollaboration.cxx
@@ -12,7 +12,8 @@
#include "docsh.hxx"
#include "sendfunc.hxx"
-ScCollaboration::ScCollaboration()
+ScCollaboration::ScCollaboration( ScDocShell* pScDocShell ) :
+ mpScDocShell( pScDocShell )
{
}
@@ -31,21 +32,20 @@ TeleConference* ScCollaboration::GetConference()
sal_uInt64 ScCollaboration::GetId()
{
- return reinterpret_cast<sal_uInt64> (SfxObjectShell::Current());
+ return reinterpret_cast<sal_uInt64> (mpScDocShell);
}
void ScCollaboration::SetCollaboration( TeleConference* pConference )
{
- ScDocShell* pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current());
- ScDocFunc* pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
+ ScDocFunc* pDocFunc = &mpScDocShell->GetDocFunc();
ScDocFuncSend* pSender = dynamic_cast<ScDocFuncSend*> (pDocFunc);
if (!pSender)
{
// This means pDocFunc has to be ScDocFuncDirect* and we are not collaborating yet.
ScDocFuncDirect *pDirect = dynamic_cast<ScDocFuncDirect*> (pDocFunc);
ScDocFuncRecv *pReceiver = new ScDocFuncRecv( pDirect );
- pSender = new ScDocFuncSend( *pScDocShell, pReceiver );
- pScDocShell->SetDocFunc( pSender );
+ pSender = new ScDocFuncSend( *mpScDocShell, pReceiver );
+ mpScDocShell->SetDocFunc( pSender );
}
pSender->SetCollaboration( pConference );
}
@@ -59,9 +59,7 @@ void ScCollaboration::SendFile( TpContact* pContact, const OUString& rURL )
ScDocFuncSend* ScCollaboration::GetScDocFuncSend()
{
- ScDocShell *pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current());
- ScDocFunc *pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
- return dynamic_cast<ScDocFuncSend*> (pDocFunc);
+ return dynamic_cast<ScDocFuncSend*> (&mpScDocShell->GetDocFunc());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 6bf7aec42875..228c6da23af7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2540,7 +2540,7 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) :
pSheetSaveData ( NULL ),
pModificator ( NULL )
#ifdef ENABLE_TELEPATHY
- , mpCollaboration( new ScCollaboration() )
+ , mpCollaboration( new ScCollaboration( this ) )
#endif
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
@@ -2589,7 +2589,7 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
pSheetSaveData ( NULL ),
pModificator ( NULL )
#ifdef ENABLE_TELEPATHY
- , mpCollaboration( new ScCollaboration() )
+ , mpCollaboration( new ScCollaboration( this ) )
#endif
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
diff --git a/sc/source/ui/inc/sccollaboration.hxx b/sc/source/ui/inc/sccollaboration.hxx
index 41b2c5866a57..283cce4dbeba 100644
--- a/sc/source/ui/inc/sccollaboration.hxx
+++ b/sc/source/ui/inc/sccollaboration.hxx
@@ -12,11 +12,13 @@
#include <tubes/collaboration.hxx>
class ScDocFuncSend;
+class ScDocShell;
class ScCollaboration : public Collaboration
{
+ ScDocShell* mpScDocShell;
public:
- ScCollaboration();
+ ScCollaboration( ScDocShell* pScDocShell );
virtual ~ScCollaboration();
virtual TeleConference* GetConference();