[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Tue Mar 7 19:37:59 UTC 2017


 sc/source/core/data/postit.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit da1f3b1c94af14767a638cc824ec510e889843eb
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Mar 7 20:35:45 2017 +0100

    Resolves: tdf#106385 don't release ScCaptionPtr too early
    
    Change-Id: Ibf0afa1d6c582251a5a2e00f2d6d9c1f267bf746

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 2bc0e99..6c75228 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(


More information about the Libreoffice-commits mailing list