summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-03-07 20:35:45 +0100
committerHenry Castro <hcastro@collabora.com>2017-05-02 17:11:07 -0400
commitdd5c3309faa2e3336382c606257eae588406100e (patch)
treeaded5a666b29d2368bbbf58df34efd28ab1596e6
parentf912285f4c13ab3f23f4d610693ede8a57a31cac (diff)
Resolves: tdf#106385 don't release ScCaptionPtr too early
Change-Id: Ibf0afa1d6c582251a5a2e00f2d6d9c1f267bf746
-rw-r--r--sc/source/core/data/postit.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 1e30882e70b7..24b3aad8b88f 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1058,9 +1058,7 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption(
// create the caption object
ScCaptionCreator aCreator( rDoc, rPos, bTailFront );
- // The caption object returned is completely unmanaged and stored
- // elsewhere.
- SdrCaptionObj* pCaption = aCreator.GetCaption().release();
+ SdrCaptionObj* pCaption = aCreator.GetCaption().get(); // just for ease of use
// insert caption into page (needed to set caption text)
rDrawPage.InsertObject( pCaption );
@@ -1091,7 +1089,10 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption(
// move caption into visible area
aCreator.AutoPlaceCaption( &aVisRect );
- return pCaption;
+
+ // The caption object returned is completely unmanaged and stored elsewhere.
+ // XXX Note it is already inserted to the draw page.
+ return aCreator.GetCaption().release();
}
ScPostIt* ScNoteUtil::CreateNoteFromCaption(