sw/source/core/doc/doctxm.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 76f57ccc93558a2b6c6c734c0b5e3a51755136fd Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Feb 25 09:08:35 2015 +0100 Fix dangling pointer (cherry picked from commit 1c4e95db104cd5f732bc41a539a7dc5fd9269ef6) Conflicts: sw/source/core/doc/doctxm.cxx Change-Id: I352702ac50708a8f8c40e2752821178223052b7c Reviewed-on: https://gerrit.libreoffice.org/14633 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index c16f576..5536387 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -19,6 +19,7 @@ #include <limits.h> #include <hintids.hxx> +#include <boost/scoped_ptr.hpp> #include <comphelper/string.hxx> #include <editeng/langitem.hxx> #include <editeng/formatbreakitem.hxx> @@ -162,6 +163,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark ) SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode()); OSL_ENSURE( rTxtNd.GetpSwpHints(), "cannot be deleted" ); + boost::scoped_ptr<SwRegHistory> aRHst; if (GetIDocumentUndoRedo().DoesUndo()) { // save attributes for Undo @@ -170,8 +172,8 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark ) RES_TXTATR_TOXMARK ); GetIDocumentUndoRedo().AppendUndo( pUndo ); - SwRegHistory aRHst( rTxtNd, &pUndo->GetHistory() ); - rTxtNd.GetpSwpHints()->Register( &aRHst ); + aRHst.reset(new SwRegHistory(rTxtNd, &pUndo->GetHistory())); + rTxtNd.GetpSwpHints()->Register(aRHst.get()); } rTxtNd.DeleteAttribute( const_cast<SwTxtTOXMark*>(pTxtTOXMark) );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits