summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2019-07-25 21:40:48 +0300
committerXisco Faulí <xiscofauli@libreoffice.org>2019-08-13 18:03:08 +0200
commit7558ad766b8a03ef3d16205a506dbeb414b3328f (patch)
treedebf988e9de7aaa3d746f941e867c103e2f67c1e /sd
parent1ac02ebd93cfaccc4fc7fee27d44dcbce5b57677 (diff)
tdf#125923 Fix reset button.
Reset/Revert button worked as cancel, not reset. That commit provides reset button to do its own job. Reviewed-on: https://gerrit.libreoffice.org/76341 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit 15664117ef4db51bdcabb46b7990573509da0d73) Change-Id: I82d3e838bff3fd690cb5a901232ecb5f76257b95 Reviewed-on: https://gerrit.libreoffice.org/76345 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/BulletAndPositionDlg.cxx11
-rw-r--r--sd/source/ui/inc/BulletAndPositionDlg.hxx3
2 files changed, 14 insertions, 0 deletions
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
index c09c6a79987f..f6eb2d709c76 100644
--- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -34,6 +34,8 @@
#include <editeng/brushitem.hxx>
#include <svl/intitem.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/sfxresid.hxx>
+#include <sfx2/strings.hrc>
#include <vcl/graph.hxx>
#include <vcl/settings.hxx>
#include <editeng/flstitem.hxx>
@@ -115,6 +117,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)
, bPreset(false)
@@ -162,6 +165,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);
@@ -187,6 +191,8 @@ 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->set_label(SfxResId(STR_RESET));
+ m_xReset->connect_clicked(LINK(this, SvxBulletAndPositionDlg, ResetHdl_Impl));
aInvalidateTimer.SetInvokeHandler(
LINK(this, SvxBulletAndPositionDlg, PreviewInvalidateHdl_Impl));
@@ -1193,6 +1199,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 54fe2abcd057..5dd28638fedc 100644
--- a/sd/source/ui/inc/BulletAndPositionDlg.hxx
+++ b/sd/source/ui/inc/BulletAndPositionDlg.hxx
@@ -57,6 +57,7 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
std::unique_ptr<SvxNumRule> pActNum;
std::unique_ptr<SvxNumRule> pSaveNum;
+ const SfxItemSet& rFirstStateSet;
Size aInitSize[SVX_MAX_NUM];
@@ -116,6 +117,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
@@ -143,6 +145,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);