sc/source/ui/dbgui/PivotLayoutDialog.cxx       |   12 ++++++++++++
 sc/source/ui/inc/PivotLayoutDialog.hxx         |    1 +
 sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui |    3 ++-
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit b32e27ceb40b1006347e83c167c9f30e86f1bcca
Author:     shark <[email protected]>
AuthorDate: Mon Feb 9 14:43:42 2026 +0000
Commit:     Heiko Tietze <[email protected]>
CommitDate: Fri Feb 13 11:32:09 2026 +0100

    tdf#165270 disable expand/collapse option when drill option is disabled in 
sc
    
    Change-Id: Ie19d6ef35bdfb24d014d7a42f9a9bb033b7b7906
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199003
    Tested-by: Heiko Tietze <[email protected]>
    Reviewed-by: Heiko Tietze <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 45dc4a12317a..e0d986272001 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -117,6 +117,8 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
     mxSourceRadioNamedRange->connect_toggled(aLink2);
     mxSourceRadioSelection->connect_toggled(aLink2);
 
+    mxCheckDrillToDetail->connect_toggled(LINK(this, ScPivotLayoutDialog, 
UpdateCheckExpandCollapse));
+
     mxSourceEdit->SetReferences(this, mxSourceFrame.get());
     mxSourceButton->SetReferences(this, mxSourceEdit.get());
 
@@ -184,6 +186,8 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
     mxCheckTotalColumns->set_active(maPivotParameters.bMakeTotalCol);
     mxCheckTotalRows->set_active(maPivotParameters.bMakeTotalRow);
 
+    UpdateCheckExpandCollapse(*mxCheckDrillToDetail);
+
     SetupSource();
     SetupDestination();
 }
@@ -720,4 +724,12 @@ void ScPivotLayoutDialog::ToggleDestination()
     mxDestinationEdit->GetWidget()->set_sensitive(bSelection);
 }
 
+IMPL_LINK_NOARG(ScPivotLayoutDialog, UpdateCheckExpandCollapse, 
weld::Toggleable&, void)
+{
+    bool bChecked = mxCheckDrillToDetail->get_active();
+    if (!bChecked)
+        mxCheckExpandCollapse->set_active(false);
+    mxCheckExpandCollapse->set_sensitive(bChecked);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx 
b/sc/source/ui/inc/PivotLayoutDialog.hxx
index e27e6c9c2264..406aa2f50091 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -98,6 +98,7 @@ private:
     DECL_LINK(ToggleDestination, weld::Toggleable&, void);
     DECL_LINK(SourceListSelected, weld::ComboBox&, void);
     DECL_LINK(SourceEditModified, formula::RefEdit&, void);
+    DECL_LINK(UpdateCheckExpandCollapse, weld::Toggleable&, void);
     void ToggleSource();
     void ToggleDestination();
     virtual void Close() override;
diff --git a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui 
b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
index b959f42471a9..cec91b816e99 100644
--- a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
+++ b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
@@ -741,6 +741,7 @@
                         <property name="receives-default">False</property>
                         <property name="use-underline">True</property>
                         <property name="draw-indicator">True</property>
+                        <property name="margin-start">20</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" 
id="check-show-expand-collapse-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" 
context="pivottablelayoutdialog|extended_tip|check-show-expand-collapse">Select 
this check box to show expand/collapse buttons for field members</property>
@@ -748,7 +749,7 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left-attach">0</property>
+                        <property name="left-attach">1</property>
                         <property name="top-attach">3</property>
                       </packing>
                     </child>

Reply via email to