summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-02 20:37:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-03 16:16:06 +0100
commit768a2d61c3b0a71fef0d9d732ae83938fe24633e (patch)
tree19e021be46486fe297d17ae716b0dea8d36e03a3 /svx
parent1191ed8584f9fd63c39514dd2e3e71682913d4bc (diff)
coverity#1302605 Resource leak in object
Change-Id: I574714c2d587ac22fcc812ffe8217f151ac40cb6
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 45b55fbe84ba..ddd1ce1fd41c 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -38,7 +38,7 @@ namespace drawinglayer
// all-text attributes. The SdrText itself and a copy
// of the OPO
const SdrText* mpSdrText;
- const OutlinerParaObject* mpOutlinerParaObject;
+ std::shared_ptr<OutlinerParaObject> mxOutlinerParaObject;
// Set when it's a FormText; contains all FormText attributes
SdrFormTextAttribute maSdrFormTextAttribute;
@@ -88,7 +88,7 @@ namespace drawinglayer
bool bFixedCellHeight,
bool bWrongSpell)
: mpSdrText(pSdrText),
- mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
+ mxOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
maSdrFormTextAttribute(),
maTextLeftDistance(aTextLeftDistance),
maTextUpperDistance(aTextUpperDistance),
@@ -125,7 +125,6 @@ namespace drawinglayer
ImpSdrTextAttribute()
: mpSdrText(0),
- mpOutlinerParaObject(0),
maSdrFormTextAttribute(),
maTextLeftDistance(0),
maTextUpperDistance(0),
@@ -155,8 +154,8 @@ namespace drawinglayer
const OutlinerParaObject& getOutlinerParaObject() const
{
- assert(mpOutlinerParaObject && "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
- return *mpOutlinerParaObject;
+ assert(mxOutlinerParaObject && "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
+ return *mxOutlinerParaObject;
}
bool isContour() const { return mbContour; }
@@ -180,9 +179,9 @@ namespace drawinglayer
// compare operator
bool operator==(const ImpSdrTextAttribute& rCandidate) const
{
- if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
+ if (mxOutlinerParaObject.get() != rCandidate.mxOutlinerParaObject.get())
{
- if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject)
+ if (mxOutlinerParaObject && rCandidate.mxOutlinerParaObject)
{
// compares OPO and it's contents, but traditionally not the RedLining
// which is not seen as model, but as temporary information