sw/source/uibase/utlui/uitool.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit f6d10cc341e869f646efb67c49f79adeac5b14d5 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Thu Apr 17 16:46:11 2025 +0200 Commit: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> CommitDate: Wed Apr 23 17:17:13 2025 +0200 tdf#166230 Switch off page number of page breaks Makes is possible to switch off the page number of page breaks in paragraph dialog. Change-Id: Ic185e492080630ffd9906492e0a00e7d8b87d028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184422 Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Tested-by: allotropia jenkins <jenk...@allotropia.de> diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 12ed53513cf2..9bce7b6566e2 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -670,6 +670,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)) { @@ -686,6 +687,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) } case SfxItemState::UNKNOWN: case SfxItemState::DEFAULT: + bRemoveNumOffset = true; break; default: assert(false); // unexpected @@ -713,13 +715,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<SwPageDesc*>(pPageDesc) ); } } } - if(bChanged) rSet.Put( aPgDesc ); }