[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Mar 14 07:01:23 UTC 2016
sc/inc/textuno.hxx | 6 ++++--
sc/source/filter/excel/xeextlst.cxx | 3 +--
sc/source/ui/unoobj/textuno.cxx | 7 ++-----
3 files changed, 7 insertions(+), 9 deletions(-)
New commits:
commit 7cdf055109d75ce37611bd0c4f796d67614d93d2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Mar 14 07:15:34 2016 +0100
use unique_ptr for memory owning ptr
Change-Id: I26efcebf750ff9947b936e990ce87ddbcb41b7ba
diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx
index 8629758..ef98720 100644
--- a/sc/inc/textuno.hxx
+++ b/sc/inc/textuno.hxx
@@ -33,6 +33,8 @@
#include <rtl/ref.hxx>
#include "scdllapi.h"
+#include <memory>
+
#include <boost/noncopyable.hpp>
class EditEngine;
@@ -111,7 +113,7 @@ public:
class ScHeaderFooterTextData : private boost::noncopyable
{
private:
- EditTextObject* mpTextObj;
+ std::unique_ptr<EditTextObject> mpTextObj;
rtl::Reference<ScHeaderFooterContentObj> rContentObj;
sal_uInt16 nPart;
ScEditEngineDefaulter* pEditEngine;
@@ -132,7 +134,7 @@ public:
sal_uInt16 GetPart() const { return nPart; }
rtl::Reference<ScHeaderFooterContentObj> GetContentObj() const { return rContentObj; }
- const EditTextObject* GetTextObject() const { return mpTextObj; }
+ const EditTextObject* GetTextObject() const { return mpTextObj.get(); }
void dispose() { rContentObj.clear(); }
};
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 0578c1f..f960d87 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -198,7 +198,6 @@ ScHeaderFooterTextData::~ScHeaderFooterTextData()
delete pForwarder;
delete pEditEngine;
- delete mpTextObj;
}
SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder()
@@ -247,15 +246,13 @@ void ScHeaderFooterTextData::UpdateData()
{
if (pEditEngine)
{
- delete mpTextObj;
- mpTextObj = pEditEngine->CreateTextObject();
+ mpTextObj.reset(pEditEngine->CreateTextObject());
}
}
void ScHeaderFooterTextData::UpdateData(EditEngine& rEditEngine)
{
- delete mpTextObj;
- mpTextObj = rEditEngine.CreateTextObject();
+ mpTextObj.reset(rEditEngine.CreateTextObject());
bDataValid = false;
}
commit 82ed61ab269eca25c8bc22537327e812efe222bb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 13 23:45:45 2016 +0100
fix memory leak in cond format xlsx export
Change-Id: I0f11b30b33abf029f56ccbd8c0eb95b0acd35df4
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index 16f0cc4..c8f9d8b 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -101,8 +101,7 @@ XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry&
OUString aFormula;
if(pArr)
{
- aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), rSrcPos,
- pArr->Clone());
+ aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), rSrcPos, pArr);
}
maValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 );
}
More information about the Libreoffice-commits
mailing list