chart2/source/controller/dialogs/dlg_ObjectProperties.cxx    |   55 +++++------
 chart2/source/controller/inc/dlg_ObjectProperties.hxx        |    4 
 chart2/source/controller/main/ChartController_Insert.cxx     |    4 
 chart2/source/controller/main/ChartController_Properties.cxx |    2 
 chart2/uiconfig/ui/attributedialog.ui                        |   47 ++++-----
 5 files changed, 55 insertions(+), 57 deletions(-)

New commits:
commit d8e2e63fbfd859874e82c8f50a9745c40158860e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Jul 14 14:22:19 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Jul 15 08:45:30 2025 +0200

    chart: Switch SchAttribTabDlg::m_pParameter to const ref
    
    ... and rename to `m_rParameter` accordingly.
    
    This makes clear this is always non-null and
    allows to drop a corresponding null check in
    SchAttribTabDlg::PageCreated.
    
    Change-Id: I82f18d7db7b026f31ed6e93b71fecda0f3c7fe89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187861
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 
b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 3d34617ee244..4c51fb0b8a81 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -328,11 +328,11 @@ void 
SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorSte
 
 SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
                                  const SfxItemSet* pAttr,
-                                 const ObjectPropertiesDialogParameter* 
pDialogParameter,
+                                 const ObjectPropertiesDialogParameter& 
rDialogParameter,
                                  const ViewElementListProvider* 
pViewElementListProvider,
                                  const uno::Reference< 
util::XNumberFormatsSupplier >& xNumberFormatsSupplier)
     : SfxTabDialogController(pParent, 
u"modules/schart/ui/attributedialog.ui"_ustr, u"AttributeDialog"_ustr, pAttr)
-    , m_pParameter( pDialogParameter )
+    , m_rParameter(rDialogParameter)
     , m_pViewElementListProvider( pViewElementListProvider )
     , m_pNumberFormatter(nullptr)
     , m_fAxisMinorStepWidthForErrorBarDecimals(0.1)
@@ -341,9 +341,9 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
     NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
     m_pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
 
-    m_xDialog->set_title(pDialogParameter->getLocalizedName());
+    m_xDialog->set_title(rDialogParameter.getLocalizedName());
 
-    ObjectType eType = pDialogParameter->getObjectType();
+    ObjectType eType = rDialogParameter.getObjectType();
     switch (eType)
     {
         case OBJECTTYPE_TITLE:
@@ -386,21 +386,21 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
 
         case OBJECTTYPE_DATA_SERIES:
         case OBJECTTYPE_DATA_POINT:
-            if( m_pParameter->ProvidesSecondaryYAxis() || 
m_pParameter->ProvidesOverlapAndGapWidth() || 
m_pParameter->ProvidesMissingValueTreatments() )
+            if (m_rParameter.ProvidesSecondaryYAxis() || 
m_rParameter.ProvidesOverlapAndGapWidth() || 
m_rParameter.ProvidesMissingValueTreatments())
                 AddTabPage(u"options"_ustr, 
TabResId(RID_TAB_CHART_OPTIONS.aLabel), SchOptionTabPage::Create,
                            RID_M + RID_TAB_CHART_OPTIONS.sIconName);
-            if( m_pParameter->ProvidesStartingAngle())
+            if (m_rParameter.ProvidesStartingAngle())
                 AddTabPage(u"polaroptions"_ustr, 
TabResId(RID_TAB_CHART_OPTIONS.aLabel), PolarOptionsTabPage::Create,
                            RID_M + RID_TAB_CHART_OPTIONS.sIconName);
-            if (m_pParameter->IsPieChartDataPoint())
+            if (m_rParameter.IsPieChartDataPoint())
                 AddTabPage(u"datapointoption"_ustr, 
TabResId(RID_TAB_CHART_OPTIONS.aLabel), DataPointOptionTabPage::Create,
                            RID_M + RID_TAB_CHART_OPTIONS.sIconName);
 
-            if( m_pParameter->HasGeometryProperties() )
+            if (m_rParameter.HasGeometryProperties())
                 AddTabPage(u"layout"_ustr, 
TabResId(RID_TAB_CHART_LAYOUT.aLabel), SchLayoutTabPage::Create,
                            RID_M + RID_TAB_CHART_LAYOUT.sIconName);
 
-            if(m_pParameter->HasAreaProperties())
+            if (m_rParameter.HasAreaProperties())
             {
                 AddTabPage(u"area"_ustr, TabResId(RID_TAB_AREA.aLabel), 
RID_SVXPAGE_AREA,
                            RID_M + RID_TAB_AREA.sIconName);
@@ -435,7 +435,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
 
         case OBJECTTYPE_AXIS:
         {
-            if( m_pParameter->HasScaleProperties() )
+            if (m_rParameter.HasScaleProperties())
             {
                 AddTabPage(u"scale"_ustr, 
TabResId(RID_TAB_CHART_SCALE.aLabel), ScaleTabPage::Create,
                            RID_M + RID_TAB_CHART_SCALE.sIconName);
@@ -447,7 +447,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
                        RID_M + RID_TAB_BORDER.sIconName);
             AddTabPage(u"axislabel"_ustr, 
TabResId(RID_TAB_CHART_AXISLABEL.aLabel), SchAxisLabelTabPage::Create,
                        RID_M + RID_TAB_CHART_AXISLABEL.sIconName);
-            if( m_pParameter->HasNumberProperties() )
+            if (m_rParameter.HasNumberProperties())
                 AddTabPage(u"numberformat"_ustr, 
TabResId(RID_TAB_NUMBERS.aLabel), RID_SVXPAGE_NUMBERFORMAT,
                            RID_M + RID_TAB_NUMBERS.sIconName);
             AddTabPage(u"fontname"_ustr, TabResId(RID_TAB_FONT.aLabel), 
RID_SVXPAGE_CHAR_NAME,
@@ -574,7 +574,7 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
         aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nNoArrowNoShadowDlg));
 
-        if( m_pParameter->HasSymbolProperties() )
+        if (m_rParameter.HasSymbolProperties())
         {
             
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
             if( m_oSymbolShapeProperties )
@@ -613,10 +613,10 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
     }
     else if (rId == "axislabel")
     {
-        bool bShowStaggeringControls = 
m_pParameter->CanAxisLabelsBeStaggered();
+        bool bShowStaggeringControls = m_rParameter.CanAxisLabelsBeStaggered();
         auto & rLabelPage = static_cast<SchAxisLabelTabPage&>(rPage);
         rLabelPage.ShowStaggeringControls( bShowStaggeringControls );
-        rLabelPage.SetComplexCategories( 
m_pParameter->IsComplexCategoriesAxis() );
+        
rLabelPage.SetComplexCategories(m_rParameter.IsComplexCategoriesAxis());
     }
     else if (rId == "axispos")
     {
@@ -624,13 +624,13 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         if(pPage)
         {
             pPage->SetNumFormatter( m_pNumberFormatter );
-            if( m_pParameter->IsCrossingAxisIsCategoryAxis() )
+            if (m_rParameter.IsCrossingAxisIsCategoryAxis())
             {
-                pPage->SetCrossingAxisIsCategoryAxis( 
m_pParameter->IsCrossingAxisIsCategoryAxis() );
-                pPage->SetCategories( m_pParameter->GetCategories() );
+                
pPage->SetCrossingAxisIsCategoryAxis(m_rParameter.IsCrossingAxisIsCategoryAxis());
+                pPage->SetCategories(m_rParameter.GetCategories());
             }
-            pPage->SupportAxisPositioning( 
m_pParameter->IsSupportingAxisPositioning() );
-            pPage->SupportCategoryPositioning( 
m_pParameter->IsSupportingCategoryPositioning() );
+            
pPage->SupportAxisPositioning(m_rParameter.IsSupportingAxisPositioning());
+            
pPage->SupportCategoryPositioning(m_rParameter.IsSupportingCategoryPositioning());
         }
     }
     else if (rId == "scale")
@@ -639,7 +639,7 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         if(pScaleTabPage)
         {
             pScaleTabPage->SetNumFormatter( m_pNumberFormatter );
-            pScaleTabPage->ShowAxisOrigin( m_pParameter->ShowAxisOrigin() );
+            pScaleTabPage->ShowAxisOrigin(m_rParameter.ShowAxisOrigin());
         }
     }
     else if (rId == "datalabels")
@@ -661,7 +661,7 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         {
             pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
             pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_X );
-            pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
+            
pTabPage->SetChartDocumentForRangeChoosing(m_rParameter.getDocument());
         }
     }
     else if (rId == "yerrorbar")
@@ -672,15 +672,16 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         {
             pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
             pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_Y );
-            pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
+            
pTabPage->SetChartDocumentForRangeChoosing(m_rParameter.getDocument());
         }
     }
     else if (rId == "options")
     {
         SchOptionTabPage* pTabPage = dynamic_cast< SchOptionTabPage* >( &rPage 
);
-        if( pTabPage && m_pParameter )
-            pTabPage->Init( m_pParameter->ProvidesSecondaryYAxis(), 
m_pParameter->ProvidesOverlapAndGapWidth(),
-                m_pParameter->ProvidesBarConnectors() );
+        if (pTabPage)
+            pTabPage->Init(m_rParameter.ProvidesSecondaryYAxis(),
+                           m_rParameter.ProvidesOverlapAndGapWidth(),
+                           m_rParameter.ProvidesBarConnectors());
     }
     else if (rId == "trendline")
     {
@@ -688,7 +689,7 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         if(pTrendlineTabPage)
         {
             pTrendlineTabPage->SetNumFormatter( m_pNumberFormatter );
-            pTrendlineTabPage->SetNbPoints( m_pParameter->getNbPoints() );
+            pTrendlineTabPage->SetNbPoints(m_rParameter.getNbPoints());
         }
     }
     else if (rId == "colorpalette")
@@ -696,7 +697,7 @@ void SchAttribTabDlg::PageCreated(const OUString& rId, 
SfxTabPage &rPage)
         auto* pColorPaletteTabPage = dynamic_cast<ChartColorPaletteTabPage*>( 
&rPage );
         if (pColorPaletteTabPage)
         {
-            pColorPaletteTabPage->init(m_pParameter->getDocument());
+            pColorPaletteTabPage->init(m_rParameter.getDocument());
         }
     }
 }
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx 
b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index f16aee1e611b..228ec1e654a8 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -112,7 +112,7 @@ class ViewElementListProvider;
 class SchAttribTabDlg final : public SfxTabDialogController
 {
 private:
-    const ObjectPropertiesDialogParameter * const        m_pParameter;
+    const ObjectPropertiesDialogParameter& m_rParameter;
     const ViewElementListProvider* const                 
m_pViewElementListProvider;
     SvNumberFormatter* m_pNumberFormatter;
 
@@ -128,7 +128,7 @@ private:
 
 public:
     SchAttribTabDlg(weld::Window* pParent, const SfxItemSet* pAttr,
-                    const ObjectPropertiesDialogParameter* pDialogParameter,
+                    const ObjectPropertiesDialogParameter& rDialogParameter,
                     const ViewElementListProvider* pViewElementListProvider,
                     const css::uno::Reference< 
css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
     virtual ~SchAttribTabDlg() override;
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx 
b/chart2/source/controller/main/ChartController_Insert.cxx
index 5b930ee7190c..da50b06a8482 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -497,7 +497,7 @@ void ChartController::executeDispatch_InsertTrendline()
     aDialogParameter.init( getChartModel() );
     ViewElementListProvider aViewElementListProvider( 
m_pDrawModelWrapper.get());
     SolarMutexGuard aGuard;
-    auto aDialog = std::make_shared<SchAttribTabDlg>(GetChartFrame(), 
&aItemSet, &aDialogParameter,
+    auto aDialog = std::make_shared<SchAttribTabDlg>(GetChartFrame(), 
&aItemSet, aDialogParameter,
                                                      
&aViewElementListProvider, getChartModel());
 
     // note: when a user pressed "OK" but didn't change any settings in the
@@ -555,7 +555,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool 
bYError )
         ViewElementListProvider aViewElementListProvider( 
m_pDrawModelWrapper.get());
         SolarMutexGuard aGuard;
         auto aDlg = std::make_shared<SchAttribTabDlg>(
-                GetChartFrame(), &aItemSet, &aDialogParameter,
+                GetChartFrame(), &aItemSet, aDialogParameter,
                 &aViewElementListProvider,
                 getChartModel() );
         aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx 
b/chart2/source/controller/main/ChartController_Properties.cxx
index 762d730d0539..7a8b0b2c6646 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -747,7 +747,7 @@ void 
ChartController::executeDlg_ObjectProperties_withUndoGuard(
 
         SolarMutexGuard aGuard;
         std::shared_ptr<SchAttribTabDlg> aDlgPtr = 
std::make_shared<SchAttribTabDlg>(
-            GetChartFrame(), &aItemSet, &aDialogParameter,
+            GetChartFrame(), &aItemSet, aDialogParameter,
             &aViewElementListProvider,
             xChartDoc);
 
commit a614dbcc144ebb1c4bd09d323531fef77d35de43
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Jul 14 14:11:42 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Jul 15 08:45:19 2025 +0200

    chart2: Resave attributedialog.ui with glade 3.40
    
    The dialog can be triggered from Writer as follows:
    
    * "Insert" -> "Chart"
    * Hover over the X Axis until an "X Axis" tooltip appears
    * double-click
    
    Change-Id: Iaabca9238dd5009a7134f2561f7f47a099ab2db0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187860
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/chart2/uiconfig/ui/attributedialog.ui 
b/chart2/uiconfig/ui/attributedialog.ui
index af58cc3aa67b..0625dec4cbd5 100644
--- a/chart2/uiconfig/ui/attributedialog.ui
+++ b/chart2/uiconfig/ui/attributedialog.ui
@@ -1,32 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="chart">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkDialog" id="AttributeDialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
+    <property name="can-focus">False</property>
+    <property name="border-width">6</property>
     <property name="modal">True</property>
-    <property name="default_width">0</property>
-    <property name="default_height">0</property>
-    <property name="type_hint">dialog</property>
-    <child>
-      <placeholder/>
-    </child>
+    <property name="default-width">0</property>
+    <property name="default-height">0</property>
+    <property name="type-hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
-        <property name="can_focus">False</property>
+        <property name="can-focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="can-focus">False</property>
+            <property name="layout-style">end</property>
             <child>
               <object class="GtkButton" id="reset">
                 <property name="label" translatable="yes" 
context="stock">_Reset</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -39,10 +36,10 @@
               <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" 
context="stock">_OK</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="can-default">True</property>
+                <property name="has-default">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -55,8 +52,8 @@
               <object class="GtkButton" id="cancel">
                 <property name="label" translatable="yes" 
context="stock">_Cancel</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -69,8 +66,8 @@
               <object class="GtkButton" id="help">
                 <property name="label" translatable="yes" 
context="stock">_Help</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -84,18 +81,18 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="pack_type">end</property>
+            <property name="pack-type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkNotebook" id="tabcontrol">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
+            <property name="can-focus">True</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
-            <property name="scrollable">True</property>
             <property name="tab-pos">left</property>
+            <property name="scrollable">True</property>
           </object>
           <packing>
             <property name="expand">False</property>

Reply via email to