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