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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 29 18:29:22 UTC 2019


 sc/source/ui/cctrl/editfield.cxx   |    6 -
 sc/source/ui/dbgui/dpgroupdlg.cxx  |    8 -
 sc/source/ui/inc/dpgroupdlg.hxx    |   12 +-
 sc/source/ui/inc/editfield.hxx     |    4 
 sc/source/ui/inc/tpcalc.hxx        |    2 
 sc/source/ui/inc/tpformula.hxx     |   47 +++-----
 sc/source/ui/optdlg/tpcalc.cxx     |    2 
 sc/source/ui/optdlg/tpformula.cxx  |  205 ++++++++++++++++---------------------
 sc/uiconfig/scalc/ui/optformula.ui |    9 +
 9 files changed, 136 insertions(+), 159 deletions(-)

New commits:
commit d73e8c0df224dec52ac60ac278947f4633d6405b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 12:23:12 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jul 29 20:28:29 2019 +0200

    weld ScTpFormulaOptions
    
    Change-Id: I8d45dfc745dbb7f90346028eb29a432309db0845
    Reviewed-on: https://gerrit.libreoffice.org/76547
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 53e8496d38e7..dd7ec5ced453 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -21,58 +21,38 @@
 #define INCLUDED_SC_SOURCE_UI_INC_TPFORMULA_HXX
 
 #include <sfx2/tabdlg.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
 
 #include <calcconfig.hxx>
 #include <docoptio.hxx>
 
-class Edit;
-
 class ScTpFormulaOptions : public SfxTabPage
 {
     friend class VclPtr<ScTpFormulaOptions>;
 public:
     using SfxTabPage::DeactivatePage;
 
-    static  VclPtr<SfxTabPage> Create (TabPageParent pParent, const SfxItemSet* rCoreSet);
+    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
 
     virtual bool FillItemSet(SfxItemSet* rCoreSet) override;
     virtual void Reset( const SfxItemSet* rCoreSet ) override;
     virtual DeactivateRC DeactivatePage(SfxItemSet* pSet ) override;
 
 private:
-    explicit ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& rCoreSet);
+    explicit ScTpFormulaOptions(TabPageParent pParent, const SfxItemSet& rCoreSet);
     virtual ~ScTpFormulaOptions() override;
-    virtual void dispose() override;
     void ResetSeparators();
-    void OnFocusSeparatorInput(Edit* pEdit);
+    void OnFocusSeparatorInput(weld::Entry* pEdit);
     void UpdateCustomCalcRadioButtons(bool bDefault);
     void LaunchCustomCalcSettings();
 
     bool IsValidSeparator(const OUString& rSep) const;
     bool IsValidSeparatorSet() const;
 
-    DECL_LINK( ButtonHdl, Button*, void );
-    DECL_LINK( SepModifyHdl, Edit&, void );
-    DECL_LINK( SepEditOnFocusHdl, Control&, void );
+    DECL_LINK( ButtonHdl, weld::Button&, void );
+    DECL_LINK( SepModifyHdl, weld::Entry&, void );
+    DECL_LINK( SepEditOnFocusHdl, weld::Widget&, void );
 
 private:
-    VclPtr<ListBox>     mpLbFormulaSyntax;
-    VclPtr<CheckBox>    mpCbEnglishFuncName;
-
-    VclPtr<RadioButton> mpBtnCustomCalcDefault;
-    VclPtr<RadioButton> mpBtnCustomCalcCustom;
-    VclPtr<PushButton>  mpBtnCustomCalcDetails;
-
-    VclPtr<Edit>        mpEdSepFuncArg;
-    VclPtr<Edit>        mpEdSepArrayCol;
-    VclPtr<Edit>        mpEdSepArrayRow;
-    VclPtr<PushButton>  mpBtnSepReset;
-
-    VclPtr<ListBox>     mpLbOOXMLRecalcOptions;
-    VclPtr<ListBox>     mpLbODFRecalcOptions;
-
     /** Stores old separator value of currently focused separator edit box.
         This value is used to revert undesired value change. */
     OUString maOldSepValue;
@@ -84,6 +64,21 @@ private:
     ScDocOptions maCurrentDocOptions;
 
     sal_Unicode mnDecSep;
+
+    std::unique_ptr<weld::ComboBox> mxLbFormulaSyntax;
+    std::unique_ptr<weld::CheckButton> mxCbEnglishFuncName;
+
+    std::unique_ptr<weld::RadioButton> mxBtnCustomCalcDefault;
+    std::unique_ptr<weld::RadioButton> mxBtnCustomCalcCustom;
+    std::unique_ptr<weld::Button> mxBtnCustomCalcDetails;
+
+    std::unique_ptr<weld::Entry> mxEdSepFuncArg;
+    std::unique_ptr<weld::Entry> mxEdSepArrayCol;
+    std::unique_ptr<weld::Entry> mxEdSepArrayRow;
+    std::unique_ptr<weld::Button> mxBtnSepReset;
+
+    std::unique_ptr<weld::ComboBox> mxLbOOXMLRecalcOptions;
+    std::unique_ptr<weld::ComboBox> mxLbODFRecalcOptions;
 };
 
 #endif
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index fff31c327635..abdd14a99f3f 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -31,42 +31,40 @@
 
 #include <unotools/localedatawrapper.hxx>
 
-
-ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& rCoreAttrs) :
-    SfxTabPage(pParent, "OptFormula", "modules/scalc/ui/optformula.ui", &rCoreAttrs),
-    mnDecSep(0)
+ScTpFormulaOptions::ScTpFormulaOptions(TabPageParent pParent, const SfxItemSet& rCoreAttrs)
+    : SfxTabPage(pParent, "modules/scalc/ui/optformula.ui", "OptFormula", &rCoreAttrs)
+    , mnDecSep(0)
+    , mxLbFormulaSyntax(m_xBuilder->weld_combo_box("formulasyntax"))
+    , mxCbEnglishFuncName(m_xBuilder->weld_check_button("englishfuncname"))
+    , mxBtnCustomCalcDefault(m_xBuilder->weld_radio_button("calcdefault"))
+    , mxBtnCustomCalcCustom(m_xBuilder->weld_radio_button("calccustom"))
+    , mxBtnCustomCalcDetails(m_xBuilder->weld_button("details"))
+    , mxEdSepFuncArg(m_xBuilder->weld_entry("function"))
+    , mxEdSepArrayCol(m_xBuilder->weld_entry("arraycolumn"))
+    , mxEdSepArrayRow(m_xBuilder->weld_entry("arrayrow"))
+    , mxBtnSepReset(m_xBuilder->weld_button("reset"))
+    , mxLbOOXMLRecalcOptions(m_xBuilder->weld_combo_box("ooxmlrecalc"))
+    , mxLbODFRecalcOptions(m_xBuilder->weld_combo_box("odfrecalc"))
 {
-    get(mpLbFormulaSyntax, "formulasyntax");
-    get(mpCbEnglishFuncName, "englishfuncname");
-    get(mpBtnCustomCalcDefault, "calcdefault");
-    get(mpBtnCustomCalcCustom, "calccustom");
-    get(mpBtnCustomCalcDetails, "details");
-    get(mpEdSepFuncArg, "function");
-    get(mpEdSepArrayCol, "arraycolumn");
-    get(mpEdSepArrayRow, "arrayrow");
-    get(mpBtnSepReset, "reset");
-    get(mpLbOOXMLRecalcOptions, "ooxmlrecalc");
-    get(mpLbODFRecalcOptions, "odfrecalc");
-
-    mpLbFormulaSyntax->InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_CALC_A1));
-    mpLbFormulaSyntax->InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_XL_A1));
-    mpLbFormulaSyntax->InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_XL_R1C1));
-
-    Link<Button*,void> aLink2 = LINK( this, ScTpFormulaOptions, ButtonHdl );
-    mpBtnSepReset->SetClickHdl(aLink2);
-    mpBtnCustomCalcDefault->SetClickHdl(aLink2);
-    mpBtnCustomCalcCustom->SetClickHdl(aLink2);
-    mpBtnCustomCalcDetails->SetClickHdl(aLink2);
-
-    Link<Edit&,void> aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl );
-    mpEdSepFuncArg->SetModifyHdl(aLink);
-    mpEdSepArrayCol->SetModifyHdl(aLink);
-    mpEdSepArrayRow->SetModifyHdl(aLink);
-
-    Link<Control&,void> aLink3 = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl );
-    mpEdSepFuncArg->SetGetFocusHdl(aLink3);
-    mpEdSepArrayCol->SetGetFocusHdl(aLink3);
-    mpEdSepArrayRow->SetGetFocusHdl(aLink3);
+    mxLbFormulaSyntax->append_text(ScResId(SCSTR_FORMULA_SYNTAX_CALC_A1));
+    mxLbFormulaSyntax->append_text(ScResId(SCSTR_FORMULA_SYNTAX_XL_A1));
+    mxLbFormulaSyntax->append_text(ScResId(SCSTR_FORMULA_SYNTAX_XL_R1C1));
+
+    Link<weld::Button&,void> aLink2 = LINK( this, ScTpFormulaOptions, ButtonHdl );
+    mxBtnSepReset->connect_clicked(aLink2);
+    mxBtnCustomCalcDefault->connect_clicked(aLink2);
+    mxBtnCustomCalcCustom->connect_clicked(aLink2);
+    mxBtnCustomCalcDetails->connect_clicked(aLink2);
+
+    Link<weld::Entry&,void> aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl );
+    mxEdSepFuncArg->connect_changed(aLink);
+    mxEdSepArrayCol->connect_changed(aLink);
+    mxEdSepArrayRow->connect_changed(aLink);
+
+    Link<weld::Widget&,void> aLink3 = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl );
+    mxEdSepFuncArg->connect_focus_in(aLink3);
+    mxEdSepArrayCol->connect_focus_in(aLink3);
+    mxEdSepArrayRow->connect_focus_in(aLink3);
 
     // Get the decimal separator for current locale.
     OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
@@ -78,59 +76,40 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r
 
 ScTpFormulaOptions::~ScTpFormulaOptions()
 {
-    disposeOnce();
-}
-
-void ScTpFormulaOptions::dispose()
-{
-    mpLbFormulaSyntax.clear();
-    mpCbEnglishFuncName.clear();
-    mpBtnCustomCalcDefault.clear();
-    mpBtnCustomCalcCustom.clear();
-    mpBtnCustomCalcDetails.clear();
-    mpEdSepFuncArg.clear();
-    mpEdSepArrayCol.clear();
-    mpEdSepArrayRow.clear();
-    mpBtnSepReset.clear();
-    mpLbOOXMLRecalcOptions.clear();
-    mpLbODFRecalcOptions.clear();
-    SfxTabPage::dispose();
 }
 
 void ScTpFormulaOptions::ResetSeparators()
 {
     OUString aFuncArg, aArrayCol, aArrayRow;
     ScFormulaOptions::GetDefaultFormulaSeparators(aFuncArg, aArrayCol, aArrayRow);
-    mpEdSepFuncArg->SetText(aFuncArg);
-    mpEdSepArrayCol->SetText(aArrayCol);
-    mpEdSepArrayRow->SetText(aArrayRow);
+    mxEdSepFuncArg->set_text(aFuncArg);
+    mxEdSepArrayCol->set_text(aArrayCol);
+    mxEdSepArrayRow->set_text(aArrayRow);
 }
 
-void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit)
+void ScTpFormulaOptions::OnFocusSeparatorInput(weld::Entry* pEdit)
 {
     if (!pEdit)
         return;
 
     // Make sure the entire text is selected.
-    sal_Int32 nLen = pEdit->GetText().getLength();
-    Selection aSel(0, static_cast<sal_uInt16>(nLen));
-    pEdit->SetSelection(aSel);
-    maOldSepValue = pEdit->GetText();
+    pEdit->select_region(0, -1);
+    maOldSepValue = pEdit->get_text();
 }
 
 void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
 {
     if (bDefault)
     {
-        mpBtnCustomCalcDefault->Check();
-        mpBtnCustomCalcCustom->Check(false);
-        mpBtnCustomCalcDetails->Disable();
+        mxBtnCustomCalcDefault->set_active(true);
+        mxBtnCustomCalcCustom->set_active(false);
+        mxBtnCustomCalcDetails->set_sensitive(false);
     }
     else
     {
-        mpBtnCustomCalcDefault->Check(false);
-        mpBtnCustomCalcCustom->Check();
-        mpBtnCustomCalcDetails->Enable();
+        mxBtnCustomCalcDefault->set_active(false);
+        mxBtnCustomCalcCustom->set_active(true);
+        mxBtnCustomCalcDetails->set_sensitive(true);
     }
 }
 
@@ -185,76 +164,76 @@ bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const
 bool ScTpFormulaOptions::IsValidSeparatorSet() const
 {
     // Make sure the column and row separators are different.
-    OUString aColStr = mpEdSepArrayCol->GetText();
-    OUString aRowStr = mpEdSepArrayRow->GetText();
+    OUString aColStr = mxEdSepArrayCol->get_text();
+    OUString aRowStr = mxEdSepArrayRow->get_text();
     return aColStr != aRowStr;
 }
 
-IMPL_LINK( ScTpFormulaOptions, ButtonHdl, Button*, pBtn, void )
+IMPL_LINK( ScTpFormulaOptions, ButtonHdl, weld::Button&, rBtn, void )
 {
-    if (pBtn == mpBtnSepReset)
+    if (&rBtn == mxBtnSepReset.get())
         ResetSeparators();
-    else if (pBtn == mpBtnCustomCalcDefault)
+    else if (&rBtn == mxBtnCustomCalcDefault.get())
         UpdateCustomCalcRadioButtons(true);
-    else if (pBtn == mpBtnCustomCalcCustom)
+    else if (&rBtn == mxBtnCustomCalcCustom.get())
         UpdateCustomCalcRadioButtons(false);
-    else if (pBtn == mpBtnCustomCalcDetails)
+    else if (&rBtn == mxBtnCustomCalcDetails.get())
         LaunchCustomCalcSettings();
 }
 
-IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit&, rEdit, void )
+IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, weld::Entry&, rEdit, void )
 {
-    OUString aStr = rEdit.GetText();
+    OUString aStr = rEdit.get_text();
     if (aStr.getLength() > 1)
     {
         // In case the string is more than one character long, only grab the
         // first character.
         aStr = aStr.copy(0, 1);
-        rEdit.SetText(aStr);
+        rEdit.set_text(aStr);
     }
 
     if ((!IsValidSeparator(aStr) || !IsValidSeparatorSet()) && !maOldSepValue.isEmpty())
         // Invalid separator.  Restore the old value.
-        rEdit.SetText(maOldSepValue);
+        rEdit.set_text(maOldSepValue);
 
     OnFocusSeparatorInput(&rEdit);
 }
 
-IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Control&, rControl, void )
+IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, weld::Widget&, rControl, void )
 {
-    OnFocusSeparatorInput(static_cast<Edit*>(&rControl));
+    OnFocusSeparatorInput(dynamic_cast<weld::Entry*>(&rControl));
 }
 
 VclPtr<SfxTabPage> ScTpFormulaOptions::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
 {
-    return VclPtr<ScTpFormulaOptions>::Create(pParent.pParent, *rCoreSet);
+    return VclPtr<ScTpFormulaOptions>::Create(pParent, *rCoreSet);
 }
 
 bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
 {
     bool bRet = false;
     ScFormulaOptions aOpt;
-    bool bEnglishFuncName = mpCbEnglishFuncName->IsChecked();
-    sal_Int16 aSyntaxPos      = mpLbFormulaSyntax->GetSelectedEntryPos();
-    OUString aSep             = mpEdSepFuncArg->GetText();
-    OUString aSepArrayCol     = mpEdSepArrayCol->GetText();
-    OUString aSepArrayRow     = mpEdSepArrayRow->GetText();
-    sal_Int16 nOOXMLRecalcMode = mpLbOOXMLRecalcOptions->GetSelectedEntryPos();
-    sal_Int16 nODFRecalcMode = mpLbODFRecalcOptions->GetSelectedEntryPos();
-
-    if (mpBtnCustomCalcDefault->IsChecked())
+    bool bEnglishFuncName = mxCbEnglishFuncName->get_active();
+    sal_Int16 aSyntaxPos      = mxLbFormulaSyntax->get_active();
+    OUString aSep             = mxEdSepFuncArg->get_text();
+    OUString aSepArrayCol     = mxEdSepArrayCol->get_text();
+    OUString aSepArrayRow     = mxEdSepArrayRow->get_text();
+    sal_Int16 nOOXMLRecalcMode = mxLbOOXMLRecalcOptions->get_active();
+    sal_Int16 nODFRecalcMode = mxLbODFRecalcOptions->get_active();
+
+    if (mxBtnCustomCalcDefault->get_active())
     {
         // When Default is selected, reset all the calc config settings to default.
         maCurrentConfig.reset();
     }
 
-    if ( mpLbFormulaSyntax->GetSavedValue() != aSyntaxPos
-         || mpCbEnglishFuncName->GetSavedValue() != (bEnglishFuncName ? 1 : 0)
-         || mpEdSepFuncArg->GetSavedValue() != aSep
-         || mpEdSepArrayCol->GetSavedValue() != aSepArrayCol
-         || mpEdSepArrayRow->GetSavedValue() != aSepArrayRow
-         || mpLbOOXMLRecalcOptions->GetSavedValue() != nOOXMLRecalcMode
-         || mpLbODFRecalcOptions->GetSavedValue() != nODFRecalcMode
+    if ( mxLbFormulaSyntax->get_saved_value() != mxLbFormulaSyntax->get_text(aSyntaxPos)
+         || mxCbEnglishFuncName->get_saved_state() != (bEnglishFuncName ? 1 : 0)
+         || mxEdSepFuncArg->get_saved_value() != aSep
+         || mxEdSepArrayCol->get_saved_value() != aSepArrayCol
+         || mxEdSepArrayRow->get_saved_value() != aSepArrayRow
+         || mxLbOOXMLRecalcOptions->get_saved_value() != mxLbOOXMLRecalcOptions->get_text(nOOXMLRecalcMode)
+         || mxLbODFRecalcOptions->get_saved_value() != mxLbODFRecalcOptions->get_text(nODFRecalcMode)
          || maSavedConfig != maCurrentConfig
          || maSavedDocOptions != maCurrentDocOptions )
     {
@@ -308,31 +287,31 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet)
     switch (eGram)
     {
     case ::formula::FormulaGrammar::GRAM_NATIVE:
-        mpLbFormulaSyntax->SelectEntryPos(0);
+        mxLbFormulaSyntax->set_active(0);
         break;
     case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1:
-        mpLbFormulaSyntax->SelectEntryPos(1);
+        mxLbFormulaSyntax->set_active(1);
         break;
     case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1:
-        mpLbFormulaSyntax->SelectEntryPos(2);
+        mxLbFormulaSyntax->set_active(2);
         break;
     default:
-        mpLbFormulaSyntax->SelectEntryPos(0);
+        mxLbFormulaSyntax->set_active(0);
     }
 
-    mpLbFormulaSyntax->SaveValue();
+    mxLbFormulaSyntax->save_value();
 
     ScRecalcOptions eOOXMLRecalc = aOpt.GetOOXMLRecalcOptions();
-    mpLbOOXMLRecalcOptions->SelectEntryPos(static_cast<sal_uInt16>(eOOXMLRecalc));
-    mpLbOOXMLRecalcOptions->SaveValue();
+    mxLbOOXMLRecalcOptions->set_active(static_cast<sal_uInt16>(eOOXMLRecalc));
+    mxLbOOXMLRecalcOptions->save_value();
 
     ScRecalcOptions eODFRecalc = aOpt.GetODFRecalcOptions();
-    mpLbODFRecalcOptions->SelectEntryPos(static_cast<sal_uInt16>(eODFRecalc));
-    mpLbODFRecalcOptions->SaveValue();
+    mxLbODFRecalcOptions->set_active(static_cast<sal_uInt16>(eODFRecalc));
+    mxLbODFRecalcOptions->save_value();
 
     // english function name.
-    mpCbEnglishFuncName->Check( aOpt.GetUseEnglishFuncName() );
-    mpCbEnglishFuncName->SaveValue();
+    mxCbEnglishFuncName->set_active( aOpt.GetUseEnglishFuncName() );
+    mxCbEnglishFuncName->save_state();
 
     // Separators
     OUString aSep = aOpt.GetFormulaSepArg();
@@ -342,13 +321,13 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet)
     if (aSep.getLength() == 1 && aSepArrayRow.getLength() == 1 && aSepArrayCol.getLength() == 1)
     {
         // Each separator must be one character long.
-        mpEdSepFuncArg->SetText(aSep);
-        mpEdSepArrayCol->SetText(aSepArrayCol);
-        mpEdSepArrayRow->SetText(aSepArrayRow);
+        mxEdSepFuncArg->set_text(aSep);
+        mxEdSepArrayCol->set_text(aSepArrayCol);
+        mxEdSepArrayRow->set_text(aSepArrayRow);
 
-        mpEdSepFuncArg->SaveValue();
-        mpEdSepArrayCol->SaveValue();
-        mpEdSepArrayRow->SaveValue();
+        mxEdSepFuncArg->save_value();
+        mxEdSepArrayCol->save_value();
+        mxEdSepArrayRow->save_value();
     }
     else
         ResetSeparators();
diff --git a/sc/uiconfig/scalc/ui/optformula.ui b/sc/uiconfig/scalc/ui/optformula.ui
index 0804854bdec0..8b8f2a8dfa6f 100644
--- a/sc/uiconfig/scalc/ui/optformula.ui
+++ b/sc/uiconfig/scalc/ui/optformula.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkGrid" id="OptFormula">
@@ -47,7 +47,7 @@
                     <property name="hexpand">True</property>
                     <property name="column_spacing">12</property>
                     <child>
-                      <object class="GtkComboBox" id="formulasyntax">
+                      <object class="GtkComboBoxText" id="formulasyntax">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="hexpand">True</property>
@@ -222,8 +222,8 @@
                     <property name="receives_default">False</property>
                     <property name="use_underline">True</property>
                     <property name="xalign">0</property>
+                    <property name="active">True</property>
                     <property name="draw_indicator">True</property>
-                    <property name="group">calccustom</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -357,6 +357,7 @@
                   <object class="GtkEntry" id="function">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
                     <property name="width_chars">5</property>
                     <property name="max_width_chars">1</property>
                   </object>
@@ -369,6 +370,7 @@
                   <object class="GtkEntry" id="arraycolumn">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
                     <property name="width_chars">5</property>
                     <property name="max_width_chars">1</property>
                   </object>
@@ -381,6 +383,7 @@
                   <object class="GtkEntry" id="arrayrow">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
                     <property name="width_chars">5</property>
                     <property name="max_width_chars">1</property>
                   </object>
commit 741db80a08e98b7832c2e3be3b23d535037e836c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 12:02:32 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jul 29 20:28:10 2019 +0200

    rename DoubleField back to ScDoubleField
    
    Change-Id: I3d3923f3131e13abde145f96468ade0d0c8cc142
    Reviewed-on: https://gerrit.libreoffice.org/76546
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index 4066ec4b5e3a..edf9a1e49545 100644
--- a/sc/source/ui/cctrl/editfield.cxx
+++ b/sc/source/ui/cctrl/editfield.cxx
@@ -35,12 +35,12 @@ sal_Unicode lclGetDecSep()
 
 } // namespace
 
-DoubleField::DoubleField(std::unique_ptr<weld::Entry> xEntry)
+ScDoubleField::ScDoubleField(std::unique_ptr<weld::Entry> xEntry)
     : m_xEntry(std::move(xEntry))
 {
 }
 
-bool DoubleField::GetValue( double& rfValue ) const
+bool ScDoubleField::GetValue( double& rfValue ) const
 {
     OUString aStr(comphelper::string::strip(m_xEntry->get_text(), ' '));
     bool bOk = !aStr.isEmpty();
@@ -54,7 +54,7 @@ bool DoubleField::GetValue( double& rfValue ) const
     return bOk;
 }
 
-void DoubleField::SetValue( double fValue, sal_Int32 nDecPlaces )
+void ScDoubleField::SetValue( double fValue, sal_Int32 nDecPlaces )
 {
     m_xEntry->set_text( ::rtl::math::doubleToUString( fValue, rtl_math_StringFormat_G,
         nDecPlaces, lclGetDecSep(), true/*bEraseTrailingDecZeros*/ ) );
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index 1edace5962c3..adbcee0f1874 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -109,7 +109,7 @@ IMPL_LINK(ScDPGroupEditHelper, ClickHdl, weld::Button&, rButton, void)
 }
 
 ScDPNumGroupEditHelper::ScDPNumGroupEditHelper(weld::RadioButton& rRbAuto,
-    weld::RadioButton& rRbMan, DoubleField& rEdValue)
+    weld::RadioButton& rRbMan, ScDoubleField& rEdValue)
     : ScDPGroupEditHelper(rRbAuto, rRbMan, rEdValue.get_widget())
     , mrEdValue(rEdValue)
 {
@@ -150,11 +150,11 @@ ScDPNumGroupDlg::ScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo&
     : GenericDialogController(pParent, "modules/scalc/ui/groupbynumber.ui", "PivotTableGroupByNumber")
     , mxRbAutoStart(m_xBuilder->weld_radio_button("auto_start"))
     , mxRbManStart(m_xBuilder->weld_radio_button("manual_start"))
-    , mxEdStart(new DoubleField(m_xBuilder->weld_entry("edit_start")))
+    , mxEdStart(new ScDoubleField(m_xBuilder->weld_entry("edit_start")))
     , mxRbAutoEnd(m_xBuilder->weld_radio_button("auto_end"))
     , mxRbManEnd(m_xBuilder->weld_radio_button("manual_end"))
-    , mxEdEnd(new DoubleField(m_xBuilder->weld_entry("edit_end")))
-    , mxEdBy(new DoubleField(m_xBuilder->weld_entry("edit_by")))
+    , mxEdEnd(new ScDoubleField(m_xBuilder->weld_entry("edit_end")))
+    , mxEdBy(new ScDoubleField(m_xBuilder->weld_entry("edit_by")))
     , maStartHelper(*mxRbAutoStart, *mxRbManStart, *mxEdStart)
     , maEndHelper(*mxRbAutoEnd, *mxRbManEnd, *mxEdEnd)
 {
diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index 0c49b97605c6..9bf99e197f23 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -23,7 +23,7 @@
 #include <vcl/weld.hxx>
 #include <dpnumgroupinfo.hxx>
 
-class DoubleField;
+class ScDoubleField;
 class SvtCalendarBox;
 
 class ScDPGroupEditHelper
@@ -57,7 +57,7 @@ class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
 public:
     explicit ScDPNumGroupEditHelper(weld::RadioButton& rRbAuto,
                                     weld::RadioButton& rRbMan,
-                                    DoubleField& rEdValue);
+                                    ScDoubleField& rEdValue);
 
     virtual             ~ScDPNumGroupEditHelper() {}
 private:
@@ -65,7 +65,7 @@ private:
     virtual void        ImplSetValue( double fValue ) override;
 
 private:
-    DoubleField&        mrEdValue;
+    ScDoubleField&        mrEdValue;
 };
 
 class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
@@ -97,11 +97,11 @@ public:
 private:
     std::unique_ptr<weld::RadioButton> mxRbAutoStart;
     std::unique_ptr<weld::RadioButton> mxRbManStart;
-    std::unique_ptr<DoubleField> mxEdStart;
+    std::unique_ptr<ScDoubleField> mxEdStart;
     std::unique_ptr<weld::RadioButton> mxRbAutoEnd;
     std::unique_ptr<weld::RadioButton> mxRbManEnd;
-    std::unique_ptr<DoubleField> mxEdEnd;
-    std::unique_ptr<DoubleField> mxEdBy;
+    std::unique_ptr<ScDoubleField> mxEdEnd;
+    std::unique_ptr<ScDoubleField> mxEdBy;
     ScDPNumGroupEditHelper maStartHelper;
     ScDPNumGroupEditHelper maEndHelper;
 };
diff --git a/sc/source/ui/inc/editfield.hxx b/sc/source/ui/inc/editfield.hxx
index ce6e9a9ac027..359ab20549ad 100644
--- a/sc/source/ui/inc/editfield.hxx
+++ b/sc/source/ui/inc/editfield.hxx
@@ -24,12 +24,12 @@
 #include <vcl/weld.hxx>
 
 /** An edit control that contains a double precision floating-point value. */
-class DoubleField
+class ScDoubleField
 {
 private:
     std::unique_ptr<weld::Entry> m_xEntry;
 public:
-    explicit            DoubleField(std::unique_ptr<weld::Entry> xEntry);
+    explicit ScDoubleField(std::unique_ptr<weld::Entry> xEntry);
 
     bool GetValue(double& rfValue) const;
     void SetValue(double fValue, sal_Int32 nDecPlaces = 12);
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 6d1fb5d06bea..53f3f3e480bd 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -52,7 +52,7 @@ private:
     std::unique_ptr<weld::Label> m_xFtSteps;
     std::unique_ptr<weld::SpinButton> m_xEdSteps;
     std::unique_ptr<weld::Label> m_xFtEps;
-    std::unique_ptr<DoubleField> m_xEdEps;
+    std::unique_ptr<ScDoubleField> m_xEdEps;
 
     std::unique_ptr<weld::RadioButton> m_xBtnDateStd;
     std::unique_ptr<weld::RadioButton> m_xBtnDateSc10;
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index aea5a6f15e2f..5a6f60337911 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -43,7 +43,7 @@ ScTpCalcOptions::ScTpCalcOptions(TabPageParent pParent, const SfxItemSet& rCoreA
     , m_xFtSteps(m_xBuilder->weld_label("stepsft"))
     , m_xEdSteps(m_xBuilder->weld_spin_button("steps"))
     , m_xFtEps(m_xBuilder->weld_label("minchangeft"))
-    , m_xEdEps(new DoubleField(m_xBuilder->weld_entry("minchange")))
+    , m_xEdEps(new ScDoubleField(m_xBuilder->weld_entry("minchange")))
     , m_xBtnDateStd(m_xBuilder->weld_radio_button("datestd"))
     , m_xBtnDateSc10(m_xBuilder->weld_radio_button("datesc10"))
     , m_xBtnDate1904(m_xBuilder->weld_radio_button("date1904"))


More information about the Libreoffice-commits mailing list