diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-03 22:53:26 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-04 01:57:14 +0200 |
commit | 56977dfaa541dfc06f2cec921a49f5a68a8dbcb9 (patch) | |
tree | 8beb13123a4b6fe2464188568d84172f415d6519 /sc | |
parent | 0c9aae91bcbd0cb7b0f0f7e8631aa4aeebb20993 (diff) |
tubes: fix leaking ScCollaboration; add it to ScDocShell
Change-Id: I43c951b5694ad38aa1a2e5da7cc99dfb52685349
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/collab/sendfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 2 |
4 files changed, 28 insertions, 2 deletions
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index d52f8b035ba9..e3ee4dccd1b3 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -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 } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 2c3d5ac0c445..6bf7aec42875 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -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 } //------------------------------------------------------------------ diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index dc551022d13c..307659222e1b 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -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(); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 32b5a00bf1dc..4850229243c8 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -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; |