summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-14 17:32:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-15 09:51:59 +0200
commitd9f4c8ded46ddc4892bb47128011ba85d6f7cd22 (patch)
tree85caaff4c867c06b8ec1c5e7f43f6b8ca8fb7995 /sc/source/ui
parent0e4f93e88bfae3489d2de84fc2febed100880628 (diff)
weld ScFillSeriesDlg
Change-Id: I1b4c6777d3334813c6bfe47efbb67f065efa555c Reviewed-on: https://gerrit.libreoffice.org/54338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx26
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx10
-rw-r--r--sc/source/ui/inc/filldlg.hxx86
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx252
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
5 files changed, 176 insertions, 200 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 35279d838fc8..d00b2d76f0a0 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -96,7 +96,10 @@ short AbstractScDeleteContentsDlg_Impl::Execute()
return m_xDlg->run();
}
-IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
+short AbstractScFillSeriesDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
short AbstractScGroupDlg_Impl::Execute()
{
@@ -289,42 +292,42 @@ InsertDeleteFlags AbstractScDeleteContentsDlg_Impl::GetDelContentsCmdBits() cons
FillDir AbstractScFillSeriesDlg_Impl::GetFillDir() const
{
- return pDlg->GetFillDir();
+ return m_xDlg->GetFillDir();
}
FillCmd AbstractScFillSeriesDlg_Impl::GetFillCmd() const
{
- return pDlg->GetFillCmd();
+ return m_xDlg->GetFillCmd();
}
FillDateCmd AbstractScFillSeriesDlg_Impl::GetFillDateCmd() const
{
- return pDlg->GetFillDateCmd();
+ return m_xDlg->GetFillDateCmd();
}
double AbstractScFillSeriesDlg_Impl::GetStart() const
{
- return pDlg->GetStart();
+ return m_xDlg->GetStart();
}
double AbstractScFillSeriesDlg_Impl::GetStep() const
{
- return pDlg->GetStep();
+ return m_xDlg->GetStep();
}
double AbstractScFillSeriesDlg_Impl::GetMax() const
{
- return pDlg->GetMax();
+ return m_xDlg->GetMax();
}
OUString AbstractScFillSeriesDlg_Impl::GetStartStr() const
{
- return pDlg->GetStartStr();
+ return m_xDlg->GetStartStr();
}
void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag)
{
- pDlg->SetEdStartValEnabled(bFlag);
+ m_xDlg->SetEdStartValEnabled(bFlag);
}
bool AbstractScGroupDlg_Impl::GetColsChecked() const
@@ -724,7 +727,7 @@ VclPtr<AbstractScDeleteContentsDlg> ScAbstractDialogFactory_Impl::CreateScDelete
return VclPtr<AbstractScDeleteContentsDlg_Impl>::Create(new ScDeleteContentsDlg(pParent));
}
-VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( vcl::Window* pParent,
+VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg(weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
@@ -734,8 +737,7 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries
double fMax,
sal_uInt16 nPossDir)
{
- VclPtr<ScFillSeriesDlg> pDlg = VclPtr<ScFillSeriesDlg>::Create( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
- return VclPtr<AbstractScFillSeriesDlg_Impl>::Create( pDlg );
+ return VclPtr<AbstractScFillSeriesDlg_Impl>::Create(new ScFillSeriesDlg(pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir));
}
VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup)
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 3da1d5a9767d..f0fdfbf67fa2 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -193,7 +193,13 @@ public:
class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg
{
- DECL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl, ScFillSeriesDlg)
+ std::unique_ptr<ScFillSeriesDlg> m_xDlg;
+public:
+ explicit AbstractScFillSeriesDlg_Impl(ScFillSeriesDlg* p)
+ : m_xDlg(p)
+ {
+ }
+ virtual short Execute() override;
virtual FillDir GetFillDir() const override;
virtual FillCmd GetFillCmd() const override;
virtual FillDateCmd GetFillDateCmd() const override;
@@ -485,7 +491,7 @@ public:
virtual VclPtr<AbstractScDeleteContentsDlg> CreateScDeleteContentsDlg(weld::Window* pParent) override;
- virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg( vcl::Window* pParent,
+ virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg(weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx
index 4692bf4585fc..de6ec72dcb54 100644
--- a/sc/source/ui/inc/filldlg.hxx
+++ b/sc/source/ui/inc/filldlg.hxx
@@ -20,30 +20,26 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
+#include <vcl/weld.hxx>
#include <global.hxx>
class ScDocument;
#include "scui_def.hxx"
-class ScFillSeriesDlg : public ModalDialog
+class ScFillSeriesDlg : public weld::GenericDialogController
{
public:
- ScFillSeriesDlg( vcl::Window* pParent,
- ScDocument& rDocument,
- FillDir eFillDir,
- FillCmd eFillCmd,
- FillDateCmd eFillDateCmd,
- const OUString& aStartStr,
- double fStep,
- double fMax,
- sal_uInt16 nPossDir );
- virtual ~ScFillSeriesDlg() override;
- virtual void dispose() override;
+ ScFillSeriesDlg( weld::Window* pParent,
+ ScDocument& rDocument,
+ FillDir eFillDir,
+ FillCmd eFillCmd,
+ FillDateCmd eFillDateCmd,
+ const OUString& aStartStr,
+ double fStep,
+ double fMax,
+ sal_uInt16 nPossDir );
+ virtual ~ScFillSeriesDlg() override;
FillDir GetFillDir() const { return theFillDir; }
FillCmd GetFillCmd() const { return theFillCmd; }
@@ -52,38 +48,12 @@ public:
double GetStep() const { return fIncrement; }
double GetMax() const { return fEndVal; }
- OUString GetStartStr() const { return m_pEdStartVal->GetText(); }
+ OUString GetStartStr() const { return m_xEdStartVal->get_text(); }
void SetEdStartValEnabled(bool bFlag);
private:
- VclPtr<FixedText> m_pFtStartVal;
- VclPtr<Edit> m_pEdStartVal;
const OUString aStartStrVal;
-
- VclPtr<FixedText> m_pFtEndVal;
- VclPtr<Edit> m_pEdEndVal;
-
- VclPtr<FixedText> m_pFtIncrement;
- VclPtr<Edit> m_pEdIncrement;
- VclPtr<RadioButton> m_pBtnDown;
- VclPtr<RadioButton> m_pBtnRight;
- VclPtr<RadioButton> m_pBtnUp;
- VclPtr<RadioButton> m_pBtnLeft;
-
- VclPtr<RadioButton> m_pBtnArithmetic;
- VclPtr<RadioButton> m_pBtnGeometric;
- VclPtr<RadioButton> m_pBtnDate;
- VclPtr<RadioButton> m_pBtnAutoFill;
-
- VclPtr<FixedText> m_pFtTimeUnit;
- VclPtr<RadioButton> m_pBtnDay;
- VclPtr<RadioButton> m_pBtnDayOfWeek;
- VclPtr<RadioButton> m_pBtnMonth;
- VclPtr<RadioButton> m_pBtnYear;
-
- VclPtr<OKButton> m_pBtnOk;
-
const OUString aErrMsgInvalidVal;
ScDocument& rDoc;
@@ -94,13 +64,39 @@ private:
double fIncrement;
double fEndVal;
+ std::unique_ptr<weld::Label> m_xFtStartVal;
+ std::unique_ptr<weld::Entry> m_xEdStartVal;
+
+ std::unique_ptr<weld::Label> m_xFtEndVal;
+ std::unique_ptr<weld::Entry> m_xEdEndVal;
+
+ std::unique_ptr<weld::Label> m_xFtIncrement;
+ std::unique_ptr<weld::Entry> m_xEdIncrement;
+ std::unique_ptr<weld::RadioButton> m_xBtnDown;
+ std::unique_ptr<weld::RadioButton> m_xBtnRight;
+ std::unique_ptr<weld::RadioButton> m_xBtnUp;
+ std::unique_ptr<weld::RadioButton> m_xBtnLeft;
+
+ std::unique_ptr<weld::RadioButton> m_xBtnArithmetic;
+ std::unique_ptr<weld::RadioButton> m_xBtnGeometric;
+ std::unique_ptr<weld::RadioButton> m_xBtnDate;
+ std::unique_ptr<weld::RadioButton> m_xBtnAutoFill;
+
+ std::unique_ptr<weld::Label> m_xFtTimeUnit;
+ std::unique_ptr<weld::RadioButton> m_xBtnDay;
+ std::unique_ptr<weld::RadioButton> m_xBtnDayOfWeek;
+ std::unique_ptr<weld::RadioButton> m_xBtnMonth;
+ std::unique_ptr<weld::RadioButton> m_xBtnYear;
+
+ std::unique_ptr<weld::Button> m_xBtnOk;
+
void Init( sal_uInt16 nPossDir );
bool CheckStartVal();
bool CheckIncrementVal();
bool CheckEndVal();
- DECL_LINK( OKHdl, Button*, void );
- DECL_LINK( DisableHdl, Button*, void );
+ DECL_LINK(OKHdl, weld::Button&, void);
+ DECL_LINK(DisableHdl, weld::ToggleButton&, void);
};
#endif // INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index adf3aac517d0..dbcdc1c25f6f 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -31,7 +31,7 @@
// class ScFillSeriesDlg
-ScFillSeriesDlg::ScFillSeriesDlg( vcl::Window* pParent,
+ScFillSeriesDlg::ScFillSeriesDlg( weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
@@ -40,118 +40,91 @@ ScFillSeriesDlg::ScFillSeriesDlg( vcl::Window* pParent,
double fStep,
double fMax,
sal_uInt16 nPossDir )
- : ModalDialog(pParent, "FillSeriesDialog", "modules/scalc/ui/filldlg.ui"),
- aStartStrVal ( aStartStr),
- aErrMsgInvalidVal( ScResId(SCSTR_VALERR) ),
- rDoc ( rDocument ),
- theFillDir ( eFillDir ),
- theFillCmd ( eFillCmd ),
- theFillDateCmd ( eFillDateCmd ),
- fIncrement ( fStep ),
- fEndVal ( fMax )
+ : GenericDialogController(pParent, "modules/scalc/ui/filldlg.ui", "FillSeriesDialog")
+ , aStartStrVal(aStartStr)
+ , aErrMsgInvalidVal(ScResId(SCSTR_VALERR))
+ , rDoc(rDocument)
+ , theFillDir(eFillDir)
+ , theFillCmd(eFillCmd)
+ , theFillDateCmd(eFillDateCmd)
+ , fIncrement(fStep)
+ , fEndVal(fMax)
+ , m_xFtStartVal(m_xBuilder->weld_label("startL"))
+ , m_xEdStartVal(m_xBuilder->weld_entry("startValue"))
+ , m_xFtEndVal(m_xBuilder->weld_label("endL"))
+ , m_xEdEndVal(m_xBuilder->weld_entry("endValue"))
+ , m_xFtIncrement(m_xBuilder->weld_label("incrementL"))
+ , m_xEdIncrement(m_xBuilder->weld_entry("increment"))
+ , m_xBtnDown(m_xBuilder->weld_radio_button("down"))
+ , m_xBtnRight(m_xBuilder->weld_radio_button("right"))
+ , m_xBtnUp(m_xBuilder->weld_radio_button("up"))
+ , m_xBtnLeft(m_xBuilder->weld_radio_button("left"))
+ , m_xBtnArithmetic(m_xBuilder->weld_radio_button("linear"))
+ , m_xBtnGeometric(m_xBuilder->weld_radio_button("growth"))
+ , m_xBtnDate(m_xBuilder->weld_radio_button("date"))
+ , m_xBtnAutoFill(m_xBuilder->weld_radio_button("autofill"))
+ , m_xFtTimeUnit(m_xBuilder->weld_label("tuL"))
+ , m_xBtnDay(m_xBuilder->weld_radio_button("day"))
+ , m_xBtnDayOfWeek(m_xBuilder->weld_radio_button("week"))
+ , m_xBtnMonth(m_xBuilder->weld_radio_button("month"))
+ , m_xBtnYear(m_xBuilder->weld_radio_button("year"))
+ , m_xBtnOk(m_xBuilder->weld_button("ok"))
{
- get(m_pFtStartVal, "startL");
- get(m_pEdStartVal, "startValue");
- get(m_pFtEndVal, "endL");
- get(m_pEdEndVal, "endValue");
- get(m_pFtIncrement, "incrementL");
- get(m_pEdIncrement, "increment");
- get(m_pBtnDown, "down");
- get(m_pBtnRight, "right");
- get(m_pBtnUp, "up");
- get(m_pBtnLeft, "left");
- get(m_pBtnArithmetic, "linear");
- get(m_pBtnGeometric, "growth");
- get(m_pBtnDate, "date");
- get(m_pBtnAutoFill, "autofill");
- get(m_pFtTimeUnit, "tuL");
- get(m_pBtnDay, "day");
- get(m_pBtnDayOfWeek, "week");
- get(m_pBtnMonth, "month");
- get(m_pBtnYear, "year");
- get(m_pBtnOk, "ok");
-
- Init( nPossDir );
+ Init(nPossDir);
}
ScFillSeriesDlg::~ScFillSeriesDlg()
{
- disposeOnce();
-}
-
-void ScFillSeriesDlg::dispose()
-{
- m_pFtStartVal.clear();
- m_pEdStartVal.clear();
- m_pFtEndVal.clear();
- m_pEdEndVal.clear();
- m_pFtIncrement.clear();
- m_pEdIncrement.clear();
- m_pBtnDown.clear();
- m_pBtnRight.clear();
- m_pBtnUp.clear();
- m_pBtnLeft.clear();
- m_pBtnArithmetic.clear();
- m_pBtnGeometric.clear();
- m_pBtnDate.clear();
- m_pBtnAutoFill.clear();
- m_pFtTimeUnit.clear();
- m_pBtnDay.clear();
- m_pBtnDayOfWeek.clear();
- m_pBtnMonth.clear();
- m_pBtnYear.clear();
- m_pBtnOk.clear();
- ModalDialog::dispose();
}
void ScFillSeriesDlg::SetEdStartValEnabled(bool bFlag)
{
if(bFlag)
{
- m_pFtStartVal->Enable();
- m_pEdStartVal->Enable();
+ m_xFtStartVal->set_sensitive(true);
+ m_xEdStartVal->set_sensitive(true);
}
else
{
- m_pFtStartVal->Disable();
- m_pEdStartVal->Disable();
+ m_xFtStartVal->set_sensitive(false);
+ m_xEdStartVal->set_sensitive(false);
}
}
void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
{
- m_pBtnOk->SetClickHdl ( LINK( this, ScFillSeriesDlg, OKHdl ) );
- m_pBtnArithmetic->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
- m_pBtnGeometric->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
- m_pBtnDate->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
- m_pBtnAutoFill->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
+ m_xBtnOk->connect_clicked ( LINK( this, ScFillSeriesDlg, OKHdl ) );
+ m_xBtnArithmetic->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
+ m_xBtnGeometric->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
+ m_xBtnDate->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
+ m_xBtnAutoFill->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
if( nPossDir == FDS_OPT_NONE )
{
- m_pBtnLeft->Disable();
- m_pBtnRight->Disable();
- m_pBtnDown->Disable();
- m_pBtnUp->Disable();
+ m_xBtnLeft->set_sensitive(false);
+ m_xBtnRight->set_sensitive(false);
+ m_xBtnDown->set_sensitive(false);
+ m_xBtnUp->set_sensitive(false);
}
if( nPossDir == FDS_OPT_HORZ )
{
- m_pBtnDown->Disable();
- m_pBtnUp->Disable();
+ m_xBtnDown->set_sensitive(false);
+ m_xBtnUp->set_sensitive(false);
}
if( nPossDir == FDS_OPT_VERT )
{
- m_pBtnLeft->Disable();
- m_pBtnRight->Disable();
+ m_xBtnLeft->set_sensitive(false);
+ m_xBtnRight->set_sensitive(false);
}
switch ( theFillDir )
{
- case FILL_TO_LEFT: m_pBtnLeft->Check(); break;
- case FILL_TO_RIGHT: m_pBtnRight->Check(); break;
- case FILL_TO_BOTTOM: m_pBtnDown->Check(); break;
- case FILL_TO_TOP: m_pBtnUp->Check(); break;
+ case FILL_TO_LEFT: m_xBtnLeft->set_active(true); break;
+ case FILL_TO_RIGHT: m_xBtnRight->set_active(true); break;
+ case FILL_TO_BOTTOM: m_xBtnDown->set_active(true); break;
+ case FILL_TO_TOP: m_xBtnUp->set_active(true); break;
default:
break;
}
@@ -159,20 +132,20 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
switch ( theFillCmd )
{
case FILL_LINEAR:
- m_pBtnArithmetic->Check();
- DisableHdl( m_pBtnArithmetic );
+ m_xBtnArithmetic->set_active(true);
+ DisableHdl(*m_xBtnArithmetic);
break;
case FILL_GROWTH:
- m_pBtnGeometric->Check();
- DisableHdl( m_pBtnGeometric );
+ m_xBtnGeometric->set_active(true);
+ DisableHdl(*m_xBtnGeometric );
break;
case FILL_DATE:
- m_pBtnDate->Check();
- DisableHdl( m_pBtnDate );
+ m_xBtnDate->set_active(true);
+ DisableHdl(*m_xBtnDate);
break;
case FILL_AUTO:
- m_pBtnAutoFill->Check();
- DisableHdl( m_pBtnAutoFill );
+ m_xBtnAutoFill->set_active(true);
+ DisableHdl(*m_xBtnAutoFill);
break;
default:
break;
@@ -180,34 +153,34 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
switch ( theFillDateCmd )
{
- case FILL_DAY: m_pBtnDay->Check(); break;
- case FILL_WEEKDAY: m_pBtnDayOfWeek->Check(); break;
- case FILL_MONTH: m_pBtnMonth->Check(); break;
- case FILL_YEAR: m_pBtnYear->Check(); break;
+ case FILL_DAY: m_xBtnDay->set_active(true); break;
+ case FILL_WEEKDAY: m_xBtnDayOfWeek->set_active(true); break;
+ case FILL_MONTH: m_xBtnMonth->set_active(true); break;
+ case FILL_YEAR: m_xBtnYear->set_active(true); break;
default:
break;
}
fStartVal = MAXDOUBLE;
- m_pEdStartVal->SetText( aStartStrVal);
+ m_xEdStartVal->set_text( aStartStrVal);
OUString aIncrTxt;
rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt );
- m_pEdIncrement->SetText( aIncrTxt );
+ m_xEdIncrement->set_text( aIncrTxt );
OUString aEndTxt;
if ( fEndVal != MAXDOUBLE )
rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
- m_pEdEndVal->SetText( aEndTxt );
+ m_xEdEndVal->set_text( aEndTxt );
}
bool ScFillSeriesDlg::CheckStartVal()
{
bool bValOk = false;
- OUString aStr = m_pEdStartVal->GetText();
+ OUString aStr = m_xEdStartVal->get_text();
- if ( aStr.isEmpty() || m_pBtnAutoFill->IsChecked())
+ if ( aStr.isEmpty() || m_xBtnAutoFill->get_active())
{
fStartVal = MAXDOUBLE;
bValOk = true;
@@ -223,7 +196,7 @@ bool ScFillSeriesDlg::CheckStartVal()
bool ScFillSeriesDlg::CheckIncrementVal()
{
sal_uInt32 nKey = 0;
- OUString aStr = m_pEdIncrement->GetText();
+ OUString aStr = m_xEdIncrement->get_text();
return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement );
}
@@ -231,7 +204,7 @@ bool ScFillSeriesDlg::CheckIncrementVal()
bool ScFillSeriesDlg::CheckEndVal()
{
bool bValOk = false;
- OUString aStr = m_pEdEndVal->GetText();
+ OUString aStr = m_xEdEndVal->get_text();
if (aStr.isEmpty())
{
@@ -247,84 +220,83 @@ bool ScFillSeriesDlg::CheckEndVal()
}
// Handler:
-
-IMPL_LINK( ScFillSeriesDlg, DisableHdl, Button *, pBtn, void )
+IMPL_LINK(ScFillSeriesDlg, DisableHdl, weld::ToggleButton&, rBtn, void)
{
- if ( pBtn == m_pBtnDate )
+ if (&rBtn == m_xBtnDate.get())
{
- m_pBtnDay->Enable();
- m_pBtnDayOfWeek->Enable();
- m_pBtnMonth->Enable();
- m_pBtnYear->Enable();
- m_pFtTimeUnit->Enable();
+ m_xBtnDay->set_sensitive(true);
+ m_xBtnDayOfWeek->set_sensitive(true);
+ m_xBtnMonth->set_sensitive(true);
+ m_xBtnYear->set_sensitive(true);
+ m_xFtTimeUnit->set_sensitive(true);
}
else
{
- m_pBtnDay->Disable();
- m_pBtnDayOfWeek->Disable();
- m_pBtnMonth->Disable();
- m_pBtnYear->Disable();
- m_pFtTimeUnit->Disable();
+ m_xBtnDay->set_sensitive(false);
+ m_xBtnDayOfWeek->set_sensitive(false);
+ m_xBtnMonth->set_sensitive(false);
+ m_xBtnYear->set_sensitive(false);
+ m_xFtTimeUnit->set_sensitive(false);
}
- if ( pBtn != m_pBtnAutoFill )
+ if (&rBtn != m_xBtnAutoFill.get())
{
- m_pFtIncrement->Enable();
- m_pEdIncrement->Enable();
- m_pFtEndVal->Enable();
- m_pEdEndVal->Enable();
+ m_xFtIncrement->set_sensitive(true);
+ m_xEdIncrement->set_sensitive(true);
+ m_xFtEndVal->set_sensitive(true);
+ m_xEdEndVal->set_sensitive(true);
}
else
{
- m_pFtIncrement->Disable();
- m_pEdIncrement->Disable();
- m_pFtEndVal->Disable();
- m_pEdEndVal->Disable();
+ m_xFtIncrement->set_sensitive(false);
+ m_xEdIncrement->set_sensitive(false);
+ m_xFtEndVal->set_sensitive(false);
+ m_xEdEndVal->set_sensitive(false);
}
}
-IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl, Button*, void)
+IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl, weld::Button&, void)
{
- if ( m_pBtnLeft->IsChecked() ) theFillDir = FILL_TO_LEFT;
- else if ( m_pBtnRight->IsChecked() ) theFillDir = FILL_TO_RIGHT;
- else if ( m_pBtnDown->IsChecked() ) theFillDir = FILL_TO_BOTTOM;
- else if ( m_pBtnUp->IsChecked() ) theFillDir = FILL_TO_TOP;
+ if ( m_xBtnLeft->get_active() ) theFillDir = FILL_TO_LEFT;
+ else if ( m_xBtnRight->get_active() ) theFillDir = FILL_TO_RIGHT;
+ else if ( m_xBtnDown->get_active() ) theFillDir = FILL_TO_BOTTOM;
+ else if ( m_xBtnUp->get_active() ) theFillDir = FILL_TO_TOP;
- if ( m_pBtnArithmetic->IsChecked() ) theFillCmd = FILL_LINEAR;
- else if ( m_pBtnGeometric->IsChecked() ) theFillCmd = FILL_GROWTH;
- else if ( m_pBtnDate->IsChecked() ) theFillCmd = FILL_DATE;
- else if ( m_pBtnAutoFill->IsChecked() ) theFillCmd = FILL_AUTO;
+ if ( m_xBtnArithmetic->get_active() ) theFillCmd = FILL_LINEAR;
+ else if ( m_xBtnGeometric->get_active() ) theFillCmd = FILL_GROWTH;
+ else if ( m_xBtnDate->get_active() ) theFillCmd = FILL_DATE;
+ else if ( m_xBtnAutoFill->get_active() ) theFillCmd = FILL_AUTO;
- if ( m_pBtnDay->IsChecked() ) theFillDateCmd = FILL_DAY;
- else if ( m_pBtnDayOfWeek->IsChecked() ) theFillDateCmd = FILL_WEEKDAY;
- else if ( m_pBtnMonth->IsChecked() ) theFillDateCmd = FILL_MONTH;
- else if ( m_pBtnYear->IsChecked() ) theFillDateCmd = FILL_YEAR;
+ if ( m_xBtnDay->get_active() ) theFillDateCmd = FILL_DAY;
+ else if ( m_xBtnDayOfWeek->get_active() ) theFillDateCmd = FILL_WEEKDAY;
+ else if ( m_xBtnMonth->get_active() ) theFillDateCmd = FILL_MONTH;
+ else if ( m_xBtnYear->get_active() ) theFillDateCmd = FILL_YEAR;
bool bAllOk = true;
- Edit* pEdWrong = nullptr;
+ weld::Entry* pEdWrong = nullptr;
if ( !CheckStartVal() )
{
bAllOk = false;
- pEdWrong = m_pEdStartVal;
+ pEdWrong = m_xEdStartVal.get();
}
else if ( !CheckIncrementVal() )
{
bAllOk = false;
- pEdWrong = m_pEdIncrement;
+ pEdWrong = m_xEdIncrement.get();
}
else if ( !CheckEndVal() )
{
bAllOk = false;
- pEdWrong = m_pEdEndVal;
+ pEdWrong = m_xEdEndVal.get();
}
if ( bAllOk )
- EndDialog( RET_OK );
+ m_xDialog->response(RET_OK);
else
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning,
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning,
VclButtonsType::Ok, aErrMsgInvalidVal));
xBox->run();
- pEdWrong->GrabFocus();
+ pEdWrong->grab_focus();
}
}
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index ebc8c4363f68..e7bab31942b6 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -721,7 +721,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(),
+ ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetFrameWeld(),
*pDoc,
eFillDir, eFillCmd, eFillDateCmd,
aStartStr, fIncVal, fMaxVal,