sd/source/ui/sidebar/SlideBackground.cxx |   12 ++++++++++++
 sd/source/ui/sidebar/SlideBackground.hxx |    1 +
 2 files changed, 13 insertions(+)

New commits:
commit be3da73b9117bb94be779bfaaf25cb8e66182405
Author:     Mohit Marathe <[email protected]>
AuthorDate: Tue Oct 7 16:06:15 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Wed Jan 7 15:06:19 2026 +0100

    sd: update Format combobox selection upon page change
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I662f86e8a58845be688fe95825f2673c0532e1a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192059
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 0fac2a731ef2d33f4909c62d80f3274863ada3c1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196656
    Tested-by: Jenkins

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx 
b/sd/source/ui/sidebar/SlideBackground.cxx
index a7474d63cd30..eaa2aa179613 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -611,6 +611,7 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
                 SID_DISPLAY_MASTER_OBJECTS,
                 0 };
             updateMasterSlideSelection();
+            updatePaperSizeBoxSelection();
             GetBindings()->Invalidate( SidArray );
         }
         break;
@@ -688,6 +689,17 @@ void SlideBackground::updateMasterSlideSelection()
     }
 }
 
+void SlideBackground::updatePaperSizeBoxSelection()
+{
+    ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
+    SdPage* pPage = pMainViewShell ? pMainViewShell->getCurrentPage() : 
nullptr;
+    if (pPage != nullptr)
+    {
+        Paper ePaper = SvxPaperInfo::GetSvxPaper(pPage->GetSize(), 
MapUnit::Map100thMM);
+        mxPaperSizeBox->set_active_id(ePaper);
+    }
+}
+
 SlideBackground::~SlideBackground()
 {
     removeListener();
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx 
b/sd/source/ui/sidebar/SlideBackground.hxx
index 6dd7232ce4e3..bd0b5ce4be84 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -173,6 +173,7 @@ private:
     void ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const 
::tools::Long mnPageBottomMargin);
     void populateMasterSlideDropdown();
     void updateMasterSlideSelection();
+    void updatePaperSizeBoxSelection();
 
     static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem* 
pState);
 

Reply via email to