summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-27 03:02:17 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-27 06:26:07 +0100
commit13e8f68e82713cae2d081a236b260bda12aafa23 (patch)
tree5a62849da834c5ef151d8190c3d1405cf34682cf /sfx2
parentc7631f94625debbe120f810b80b189301da83396 (diff)
coverity#705698: fix memory leak and add some documentation
Change-Id: I082ac7c47a59f1cb0ef4e098739d6c7fa98e3795
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/app.hxx3
-rw-r--r--sfx2/inc/sfx2/docfile.hxx6
-rw-r--r--sfx2/source/appl/appopen.cxx1
3 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 6fe8bc071809..24c0294211d9 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -164,6 +164,9 @@ public:
void RemoveDdeTopic( SfxObjectShell* );
// "static" methods
+ /**
+ * @param pArgs Takes ownership
+ */
sal_uIntPtr LoadTemplate( SfxObjectShellLock& xDoc, const String& rFileName, sal_Bool bCopy=sal_True, SfxItemSet* pArgs = 0 );
SfxTemplateDialog* GetTemplateDialog();
Window* GetTopWindow() const;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index d4ee981266c1..05b6c915ec2d 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -96,9 +96,15 @@ public:
SfxMedium(String const &, StreamMode, void *)
SAL_DELETED_FUNCTION;
+ /**
+ * @param pSet does NOT take ownership
+ */
SfxMedium( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
const String& rBaseURL,
const SfxItemSet* pSet=0 );
+ /**
+ * @param pSet does NOT take ownership
+ */
SfxMedium( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
const String& rBaseURL,
const String& rTypeName,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index aaee060eea62..de1e79d33df5 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -375,6 +375,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String
xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() );
SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet );
+ delete pSet;
if(!xDoc->DoLoad(pMedium))
{
ErrCode nErrCode = xDoc->GetErrorCode();