[Libreoffice-commits] core.git: sc/source sc/uiconfig solenv/sanitizers

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 11 07:54:34 UTC 2019


 sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx |   22 -
 sc/source/ui/inc/ExponentialSmoothingDialog.hxx               |    9 
 sc/source/ui/inc/reffact.hxx                                  |    2 
 sc/source/ui/view/tabvwshc.cxx                                |   11 
 sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui            |  146 +++++-----
 solenv/sanitizers/ui/modules/scalc.suppr                      |    2 
 6 files changed, 97 insertions(+), 95 deletions(-)

New commits:
commit ab2906c593c280c95de7f1984b4e0eea7b52b768
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 10 10:32:56 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Apr 11 09:54:12 2019 +0200

    weld ScExponentialSmoothingDialog
    
    Change-Id: Ib648cc1c877eeddcf76c4c5add9058116816d707
    Reviewed-on: https://gerrit.libreoffice.org/70510
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
index b2ab5b48f438..3a94e7c5de72 100644
--- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
@@ -18,28 +18,22 @@
 
 ScExponentialSmoothingDialog::ScExponentialSmoothingDialog(
                     SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
-                    vcl::Window* pParent, ScViewData* pViewData ) :
-    ScStatisticsInputOutputDialog(
+                    weld::Window* pParent, ScViewData* pViewData )
+    : ScStatisticsInputOutputDialogController(
             pSfxBindings, pChildWindow, pParent, pViewData,
-            "ExponentialSmoothingDialog", "modules/scalc/ui/exponentialsmoothingdialog.ui" )
+            "modules/scalc/ui/exponentialsmoothingdialog.ui",
+            "ExponentialSmoothingDialog")
+    , mxSmoothingFactor(m_xBuilder->weld_spin_button("smoothing-factor-spin"))
 {
-    get(mpSmoothingFactor, "smoothing-factor-spin");
 }
 
 ScExponentialSmoothingDialog::~ScExponentialSmoothingDialog()
 {
-    disposeOnce();
 }
 
-void ScExponentialSmoothingDialog::dispose()
+void ScExponentialSmoothingDialog::Close()
 {
-    mpSmoothingFactor.clear();
-    ScStatisticsInputOutputDialog::dispose();
-}
-
-bool ScExponentialSmoothingDialog::Close()
-{
-    return DoClose( ScExponentialSmoothingDialogWrapper::GetChildWindowId() );
+    DoClose( ScExponentialSmoothingDialogWrapper::GetChildWindowId() );
 }
 
 const char* ScExponentialSmoothingDialog::GetUndoNameId()
@@ -54,7 +48,7 @@ ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell)
     FormulaTemplate aTemplate(mDocument);
 
     // Smoothing factor
-    double aSmoothingFactor = mpSmoothingFactor->GetValue() / 100.0;
+    double aSmoothingFactor = mxSmoothingFactor->get_value() / 100.0;
 
     // Alpha
     output.writeBoldString(ScResId(STR_LABEL_ALPHA));
diff --git a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
index ae2b255df918..f8fad4fa95cf 100644
--- a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
+++ b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
@@ -16,20 +16,19 @@
 
 #include "StatisticsInputOutputDialog.hxx"
 
-class ScExponentialSmoothingDialog : public ScStatisticsInputOutputDialog
+class ScExponentialSmoothingDialog : public ScStatisticsInputOutputDialogController
 {
 private:
-    VclPtr<NumericField> mpSmoothingFactor;
+    std::unique_ptr<weld::SpinButton> mxSmoothingFactor;
 
 public:
     ScExponentialSmoothingDialog(
         SfxBindings* pB, SfxChildWindow* pCW,
-        vcl::Window* pParent, ScViewData* pViewData );
+        weld::Window* pParent, ScViewData* pViewData );
 
     virtual ~ScExponentialSmoothingDialog() override;
-    virtual void dispose() override;
 
-    virtual bool Close() override;
+    virtual void Close() override;
 
 protected:
     virtual const char* GetUndoNameId() override;
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index fe9070e61771..eb4923dc7903 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -93,7 +93,7 @@ private:
 };
 
 class ScExponentialSmoothingDialogWrapper :
-    public ChildWindowWrapper<SID_EXPONENTIAL_SMOOTHING_DIALOG>
+    public ChildControllerWrapper<SID_EXPONENTIAL_SMOOTHING_DIALOG>
 {
 private:
     ScExponentialSmoothingDialogWrapper() = delete;
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 818a1f610b28..5052ab24ec55 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -330,12 +330,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
         }
         break;
 
-        case SID_EXPONENTIAL_SMOOTHING_DIALOG:
-        {
-            pResult = VclPtr<ScExponentialSmoothingDialog>::Create( pB, pCW, pParent, &GetViewData() );
-        }
-        break;
-
         case SID_MOVING_AVERAGE_DIALOG:
         {
             pResult = VclPtr<ScMovingAverageDialog>::Create( pB, pCW, pParent, &GetViewData() );
@@ -534,6 +528,11 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
             xResult.reset(new ScCovarianceDialog(pB, pCW, pParent, &GetViewData()));
         }
         break;
+        case SID_EXPONENTIAL_SMOOTHING_DIALOG:
+        {
+            xResult.reset(new ScExponentialSmoothingDialog(pB, pCW, pParent, &GetViewData()));
+        }
+        break;
     }
 
     if (xResult)
diff --git a/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui b/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
index 4d3335c83bcd..01e8ce5269e9 100644
--- a/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
+++ b/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkAdjustment" id="smoothing-factor-adjustment">
     <property name="upper">1</property>
     <property name="value">0.20000000000000001</property>
@@ -14,12 +13,76 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="exponentialsmoothingdialog|ExponentialSmoothingDialog">Exponential Smoothing</property>
     <property name="resizable">False</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <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>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-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="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</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="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkFrame" id="frame5">
             <property name="visible">True</property>
@@ -44,10 +107,10 @@
                       <object class="GtkLabel" id="input-range-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="exponentialsmoothingdialog|input-range-label">Input range:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">input-range-edit</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -55,11 +118,12 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="foruilo-RefEdit" id="input-range-edit">
+                      <object class="GtkEntry" id="input-range-edit">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="valign">center</property>
                         <property name="hexpand">True</property>
+                        <property name="activates_default">True</property>
                         <property name="width_chars">30</property>
                       </object>
                       <packing>
@@ -68,7 +132,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="foruilo-RefButton" id="input-range-button">
+                      <object class="GtkButton" id="input-range-button">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
@@ -82,10 +146,10 @@
                       <object class="GtkLabel" id="output-range-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="exponentialsmoothingdialog|output-range-label">Results to:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">output-range-edit</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -93,11 +157,12 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="foruilo-RefEdit" id="output-range-edit">
+                      <object class="GtkEntry" id="output-range-edit">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="valign">center</property>
                         <property name="hexpand">True</property>
+                        <property name="activates_default">True</property>
                         <property name="width_chars">30</property>
                       </object>
                       <packing>
@@ -106,7 +171,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="foruilo-RefButton" id="output-range-button">
+                      <object class="GtkButton" id="output-range-button">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
@@ -137,65 +202,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-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="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label">gtk-cancel</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="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="help">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
-                <property name="secondary">True</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkFrame" id="frame4">
             <property name="visible">True</property>
@@ -293,10 +299,10 @@
                       <object class="GtkLabel" id="smoothing-factor-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="exponentialsmoothingdialog|smoothing-factor-label">Smoothing factor:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">smoothing-factor-spin</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -307,7 +313,8 @@
                       <object class="GtkSpinButton" id="smoothing-factor-spin">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="text" translatable="no">0,20</property>
+                        <property name="activates_default">True</property>
+                        <property name="text">0,20</property>
                         <property name="adjustment">smoothing-factor-adjustment</property>
                         <property name="digits">2</property>
                         <property name="value">0.20000000298023224</property>
@@ -342,6 +349,7 @@
     </child>
     <action-widgets>
       <action-widget response="-5">ok</action-widget>
+      <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
   </object>
diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr
index ad0488618b36..9b2dc4330814 100644
--- a/solenv/sanitizers/ui/modules/scalc.suppr
+++ b/solenv/sanitizers/ui/modules/scalc.suppr
@@ -74,6 +74,8 @@ sc/uiconfig/scalc/ui/deletecolumnentry.ui://GtkEntry[@id='ed_columns'] no-labell
 sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui://GtkButton[@id='input-range-button'] button-no-label
 sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui://GtkButton[@id='output-range-button'] button-no-label
 sc/uiconfig/scalc/ui/doubledialog.ui://GtkEntry[@id='value'] no-labelled-by
+sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui://GtkButton[@id='input-range-button'] button-no-label
+sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui://GtkButton[@id='output-range-button'] button-no-label
 sc/uiconfig/scalc/ui/externaldata.ui://GtkTreeView[@id='ranges'] no-labelled-by
 sc/uiconfig/scalc/ui/externaldata.ui://GtkTreeViewColumn[@id='treeviewcolumn1'] no-labelled-by
 sc/uiconfig/scalc/ui/externaldata.ui://GtkLabel[@id='secondsft'] orphan-label


More information about the Libreoffice-commits mailing list