sw/source/uibase/utlui/uitool.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6ea60a38f8bd10c454cda06cee3a777e2ef402cc
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 15:49:48 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/+/184336
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
    Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

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<SwPageDesc*>(pPageDesc) );
             }
         }
     }
-
     if(bChanged)
         rSet.Put( aPgDesc );
 }

Reply via email to