sd/source/ui/app/sdmod2.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 968608eb1c65d96b54292d4926cdd0706ce594f4
Author:     Andreas Heinisch <[email protected]>
AuthorDate: Fri Nov 7 10:33:39 2025 +0100
Commit:     Andreas Heinisch <[email protected]>
CommitDate: Tue Nov 11 09:37:34 2025 +0100

    tdf#68320 - Impress: include/exclude hidden pages in slide count field
    
    Include/exclude hidden pages in slide count field. This improves the count 
consistency in the slide sorter and in various printing situations, i.e., 
printing slides or handouts including hidden pages.
    
    Change-Id: I91950736f272695644aabc383d9f1e8fc17a22a8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193572
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <[email protected]>

diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 52ebc7b33c5e..7a0687b26e15 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -299,11 +299,20 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, 
pInfo, void)
 
         if( !bMasterView )
         {
-            if( pPage && (pPage->GetPageKind() == PageKind::Handout) && 
pViewSh )
+            if (pPage)
             {
-                nPageCount = pViewSh->GetPrintedHandoutPageCount();
+                const auto ePageKind = pPage->GetPageKind();
+                if (pViewSh && ePageKind == PageKind::Handout)
+                {
+                    nPageCount = pViewSh->GetPrintedHandoutPageCount();
+                }
+                else if (pDoc)
+                {
+                    // tdf#68320 - include hidden pages in slide count field
+                    nPageCount = pDoc->GetSdPageCount(ePageKind);
+                }
             }
-            else if( pDoc )
+            else if (pDoc)
             {
                 nPageCount = pDoc->GetActiveSdPageCount();
             }

Reply via email to