diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-10-10 12:50:02 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-10-10 12:53:47 +0200 |
commit | 4c03a2497c97568c244cd14767e840d200fbc440 (patch) | |
tree | 8f17b165dc18cebbfd76de0c5a0b3ad7f7370bce /sw/source/ui/docvw/PageBreakWin.cxx | |
parent | 61ae8caa020c76f3095ec91801c460a018872fae (diff) |
Page Break: Fix page break deletion when changing page style
Diffstat (limited to 'sw/source/ui/docvw/PageBreakWin.cxx')
-rw-r--r-- | sw/source/ui/docvw/PageBreakWin.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index 8a185d6f2813..31fe8a37c224 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -34,6 +34,7 @@ #include <DashedLine.hxx> #include <doc.hxx> #include <edtwin.hxx> +#include <fmtpdsc.hxx> #include <IDocumentUndoRedo.hxx> #include <PageBreakWin.hxx> #include <pagefrm.hxx> @@ -308,13 +309,21 @@ void SwPageBreakWin::Select( ) if ( pBodyFrm ) { SwCntntFrm *pCnt = const_cast< SwCntntFrm* >( pBodyFrm->ContainsCntnt() ); - sal_uInt16 nWhich = pCnt->GetAttrSet()->GetPool()->GetWhich( SID_ATTR_PARA_PAGEBREAK ); + //sal_uInt16 nWhich = pCnt->GetAttrSet()->GetPool()->GetWhich( SID_ATTR_PARA_PAGEBREAK ); SwCntntNode* pNd = pCnt->GetNode(); pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); - SvxFmtBreakItem aNoBreakItem( SVX_BREAK_NONE, nWhich ); + + SfxItemSet aSet( GetEditWin()->GetView().GetWrtShell().GetAttrPool(), + RES_PAGEDESC, RES_PAGEDESC, + RES_BREAK, RES_BREAK, + NULL ); + aSet.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) ); + aSet.Put( SwFmtPageDesc( NULL ) ); + SwPaM aPaM( *pNd ); - pNd->GetDoc()->InsertPoolItem( aPaM, aNoBreakItem, nsSetAttrMode::SETATTR_DEFAULT ); + pNd->GetDoc()->InsertItemSet( aPaM, aSet, nsSetAttrMode::SETATTR_DEFAULT ); + pNd->GetDoc()->GetIDocumentUndoRedo( ).EndUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); } } |