summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/colfrm.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-21 20:29:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-21 20:30:42 +0100
commite1dea8100b345b15705cad366d1bcc9516bb15e9 (patch)
tree881318eb8311058b2894653accd475ed7eb27fea /sw/source/core/layout/colfrm.cxx
parent0e93a8053442e3fecc90cf7602f724ac05d4dbb1 (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
Diffstat (limited to 'sw/source/core/layout/colfrm.cxx')
-rw-r--r--sw/source/core/layout/colfrm.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 137bce269ba5..3bb752413645 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 );