Kaydet (Commit) 56977dfa authored tarafından Matúš Kukan's avatar Matúš Kukan

tubes: fix leaking ScCollaboration; add it to ScDocShell

Change-Id: I43c951b5694ad38aa1a2e5da7cc99dfb52685349
üst 0c9aae91
...@@ -253,7 +253,7 @@ sal_Bool ScDocFuncSend::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& r ...@@ -253,7 +253,7 @@ sal_Bool ScDocFuncSend::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& r
SendFile( NULL, rText ); SendFile( NULL, rText );
if ( rtl::OUString( rText ) == "contacts" ) if ( rtl::OUString( rText ) == "contacts" )
tubes::createContacts( new ScCollaboration() ); tubes::createContacts( rDocShell.GetCollaboration() );
return true; // needs some code auditing action return true; // needs some code auditing action
} }
......
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
#include "cellsuno.hxx" #include "cellsuno.hxx"
#include "dpobject.hxx" #include "dpobject.hxx"
#include "markdata.hxx" #include "markdata.hxx"
#ifdef ENABLE_TELEPATHY
#include "sccollaboration.hxx"
#endif
#include <vector> #include <vector>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -2505,6 +2508,11 @@ ScDocFunc *ScDocShell::CreateDocFunc() ...@@ -2505,6 +2508,11 @@ ScDocFunc *ScDocShell::CreateDocFunc()
{ {
return new ScDocFuncDirect( *this ); return new ScDocFuncDirect( *this );
} }
#else
Collaboration* ScDocShell::GetCollaboration()
{
return mpCollaboration;
}
#endif #endif
ScDocShell::ScDocShell( const ScDocShell& rShell ) : ScDocShell::ScDocShell( const ScDocShell& rShell ) :
...@@ -2531,6 +2539,9 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) : ...@@ -2531,6 +2539,9 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) :
pSolverSaveData ( NULL ), pSolverSaveData ( NULL ),
pSheetSaveData ( NULL ), pSheetSaveData ( NULL ),
pModificator ( NULL ) pModificator ( NULL )
#ifdef ENABLE_TELEPATHY
, mpCollaboration( new ScCollaboration() )
#endif
{ {
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
...@@ -2577,6 +2588,9 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) : ...@@ -2577,6 +2588,9 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
pSolverSaveData ( NULL ), pSolverSaveData ( NULL ),
pSheetSaveData ( NULL ), pSheetSaveData ( NULL ),
pModificator ( NULL ) pModificator ( NULL )
#ifdef ENABLE_TELEPATHY
, mpCollaboration( new ScCollaboration() )
#endif
{ {
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ScDocShell" );
...@@ -2635,6 +2649,9 @@ ScDocShell::~ScDocShell() ...@@ -2635,6 +2649,9 @@ ScDocShell::~ScDocShell()
OSL_FAIL("The Modificator should not exist"); OSL_FAIL("The Modificator should not exist");
delete pModificator; delete pModificator;
} }
#ifdef ENABLE_TELEPATHY
delete mpCollaboration;
#endif
} }
//------------------------------------------------------------------ //------------------------------------------------------------------
......
...@@ -73,6 +73,9 @@ class ScOptSolverSave; ...@@ -73,6 +73,9 @@ class ScOptSolverSave;
class ScSheetSaveData; class ScSheetSaveData;
class ScFlatBoolRowSegments; class ScFlatBoolRowSegments;
struct ScColWidthParam; struct ScColWidthParam;
#ifdef ENABLE_TELEPATHY
class Collaboration;
#endif
namespace sfx2 { class FileDialogHelper; } namespace sfx2 { class FileDialogHelper; }
struct DocShell_Impl; struct DocShell_Impl;
...@@ -121,6 +124,9 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener ...@@ -121,6 +124,9 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
ScSheetSaveData* pSheetSaveData; ScSheetSaveData* pSheetSaveData;
ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading) ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
#ifdef ENABLE_TELEPATHY
Collaboration* mpCollaboration;
#endif
SC_DLLPRIVATE void InitItems(); SC_DLLPRIVATE void InitItems();
SC_DLLPRIVATE void DoEnterHandler(); SC_DLLPRIVATE void DoEnterHandler();
...@@ -186,6 +192,9 @@ public: ...@@ -186,6 +192,9 @@ public:
using SfxShell::Deactivate; // with sal_Bool bMDI using SfxShell::Deactivate; // with sal_Bool bMDI
using SfxObjectShell::Print; // print styles using SfxObjectShell::Print; // print styles
#ifdef ENABLE_TELEPATHY
SC_DLLPRIVATE Collaboration* GetCollaboration();
#endif
virtual void Activate(); virtual void Activate();
virtual void Deactivate(); virtual void Deactivate();
......
...@@ -118,7 +118,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ...@@ -118,7 +118,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
case SID_COLLABORATION: case SID_COLLABORATION:
#ifdef ENABLE_TELEPATHY #ifdef ENABLE_TELEPATHY
tubes::createContacts( new ScCollaboration() ); tubes::createContacts( GetViewData()->GetDocShell()->GetCollaboration() );
#endif #endif
break; break;
......
...@@ -185,7 +185,6 @@ public: ...@@ -185,7 +185,6 @@ public:
} }
virtual ~TubeContacts() virtual ~TubeContacts()
{ {
delete mpCollaboration;
delete mpManager; delete mpManager;
} }
......
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