diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-21 20:29:25 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-08 11:56:05 +0100 |
commit | 7a5100ee575a021cfa5f7afa6e71d79859af4bdc (patch) | |
tree | b918394bbc4dcfee8bde9d08312eb69fdb105f12 /sw | |
parent | 45ffc4296927dd4720fbca83b309dce7bd9f7376 (diff) |
Resolves: tdf#103359 undo of insert of multi column frame crashes
this pattern has been seen before in #i32968#, so fix the same way
Change-Id: I72ac628ee507abf23c38defede33058b34e17857
(cherry picked from commit e1dea8100b345b15705cad366d1bcc9516bb15e9)
Reviewed-on: https://gerrit.libreoffice.org/30153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 8f6d624843fef768a159724e199459a23f3ad2bb)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/colfrm.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index a583a1abeae6..3afdeb3fffd9 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -31,6 +31,7 @@ #include "ftnfrm.hxx" #include <IDocumentState.hxx> #include <IDocumentLayoutAccess.hxx> +#include <IDocumentUndoRedo.hxx> SwColumnFrame::SwColumnFrame( SwFrameFormat *pFormat, SwFrame* pSib ): SwFootnoteBossFrame( pFormat, pSib ) @@ -152,9 +153,12 @@ static bool lcl_AddColumns( SwLayoutFrame *pCont, sal_uInt16 nCount ) else { bRet = true; + // tdf#103359, like #i32968# Inserting columns in the section causes MakeFrameFormat to put + // nCount objects of type SwUndoFrameFormat on the undo stack. We don't want them. + ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); for ( sal_uInt16 i = 0; i < nCount; ++i ) { - SwFrameFormat *pFormat = pDoc->MakeFrameFormat( aEmptyOUStr, pDoc->GetDfltFrameFormat()); + SwFrameFormat *pFormat = pDoc->MakeFrameFormat(aEmptyOUStr, pDoc->GetDfltFrameFormat()); SwColumnFrame *pTmp = new SwColumnFrame( pFormat, pCont ); pTmp->SetMaxFootnoteHeight( nMax ); pTmp->Paste( pCont ); |