diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index f165cf5e91d6..4b716265da60 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -662,6 +662,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) SwFormatPageDesc aPgDesc; bool bChanged = false; + bool bRemoveNumOffset = false; // Page number switch (rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem)) { @@ -678,6 +679,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) } case SfxItemState::UNKNOWN: case SfxItemState::DEFAULT: + bRemoveNumOffset = true; break; default: assert(false); // unexpected @@ -705,13 +707,14 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) if(const SwFormatPageDesc* pPageDescItem = aCoreSet.GetItemIfSet( RES_PAGEDESC ) ) { const SwPageDesc* pPageDesc = pPageDescItem->GetPageDesc(); + if (bRemoveNumOffset && pPageDescItem->GetNumOffset()) + bChanged = true; if( pPageDesc ) { aPgDesc.RegisterToPageDesc( *const_cast(pPageDesc) ); } } } - if(bChanged) rSet.Put( aPgDesc ); }