tdf#125923 Fix reset button.
Reset/Revert button worked as cancel, not reset.
That commit provides reset button to do its own job.
Change-Id: I82d3e838bff3fd690cb5a901232ecb5f76257b95
Reviewed-on: https://gerrit.libreoffice.org/76341
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
diff --git a/cui/uiconfig/ui/bulletandposition.ui b/cui/uiconfig/ui/bulletandposition.ui
index 1b8c825..44b8503 100644
--- a/cui/uiconfig/ui/bulletandposition.ui
+++ b/cui/uiconfig/ui/bulletandposition.ui
@@ -111,11 +111,10 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="label">Reset</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>
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
index 17e7b20..05f5942 100644
--- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -116,6 +116,7 @@ class SdDrawDocument;
SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const SfxItemSet& rSet,
::sd::View* pView)
: GenericDialogController(pWindow, "cui/ui/bulletandposition.ui", "BulletAndPosition")
, rFirstStateSet(rSet)
, bLastWidthModified(false)
, bModified(false)
, bInInitControl(false)
@@ -159,6 +160,7 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf
, m_xSlideRB(m_xBuilder->weld_radio_button("sliderb"))
, m_xSelectionRB(m_xBuilder->weld_radio_button("selectionrb"))
, m_xApplyToMaster(m_xBuilder->weld_toggle_button("applytomaster"))
, m_xReset(m_xBuilder->weld_button("reset"))
{
m_xBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FieldUnit::PERCENT);
@@ -184,6 +186,7 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf
LINK(this, SvxBulletAndPositionDlg, SelectCenterAlignmentHdl_Impl));
m_xRightTB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, SelectRightAlignmentHdl_Impl));
m_xApplyToMaster->connect_toggled(LINK(this, SvxBulletAndPositionDlg, ApplyToMasterHdl_Impl));
m_xReset->connect_clicked(LINK(this, SvxBulletAndPositionDlg, ResetHdl_Impl));
aInvalidateTimer.SetInvokeHandler(
LINK(this, SvxBulletAndPositionDlg, PreviewInvalidateHdl_Impl));
@@ -1158,6 +1161,11 @@ IMPL_LINK(SvxBulletAndPositionDlg, ApplyToMasterHdl_Impl, weld::ToggleButton&, r
bApplyToMaster = rButton.get_active();
}
IMPL_LINK_NOARG(SvxBulletAndPositionDlg, ResetHdl_Impl, weld::Button&, void)
{
Reset(&rFirstStateSet);
}
IMPL_LINK(SvxBulletAndPositionDlg, EditModifyHdl_Impl, weld::Entry&, rEdit, void)
{
EditModifyHdl_Impl(&rEdit);
diff --git a/sd/source/ui/inc/BulletAndPositionDlg.hxx b/sd/source/ui/inc/BulletAndPositionDlg.hxx
index 63139c3..1a90c98 100644
--- a/sd/source/ui/inc/BulletAndPositionDlg.hxx
+++ b/sd/source/ui/inc/BulletAndPositionDlg.hxx
@@ -54,6 +54,7 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
std::unique_ptr<SvxNumRule> pActNum;
std::unique_ptr<SvxNumRule> pSaveNum;
const SfxItemSet& rFirstStateSet;
Size aInitSize[SVX_MAX_NUM];
@@ -108,6 +109,7 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
std::unique_ptr<weld::RadioButton> m_xSlideRB;
std::unique_ptr<weld::RadioButton> m_xSelectionRB;
std::unique_ptr<weld::ToggleButton> m_xApplyToMaster;
std::unique_ptr<weld::Button> m_xReset;
void InitControls();
/** To switch between the numbering type
@@ -135,6 +137,7 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
DECL_LINK(SelectCenterAlignmentHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(SelectRightAlignmentHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(ApplyToMasterHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(ResetHdl_Impl, weld::Button&, void);
void EditModifyHdl_Impl(const weld::Entry*);
void InitPosAndSpaceMode();
void SetAlignmentHdl_Impl(SvxAdjust);