diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-11 17:09:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-11 20:32:36 +0100 |
commit | 7c201f2e961d6eefdcaf410edc2499112df3896b (patch) | |
tree | f1faa808d213a0a8226eb3c716a9c0cf79351c89 | |
parent | 0f974b91ddc19dffe62b3ea9716d04b0b1b8becf (diff) |
Resolves: tdf#129763 resize to request happening on every activate
even though the state remains the same, so only do the resize
if the EnableClearFormatButton[All] state changes.
also change the default to off, which is what writer typically
set it to, and make calc the one that enables it explicitly. Its
easier to grow a dialog than shrink a dialog.
Change-Id: I449df7b7dcf0204b5143b8ad88e528668b84d0a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86613
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svx/ctredlin.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/acredlin.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/ctredlin.cxx | 13 |
3 files changed, 18 insertions, 6 deletions
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index 91c95fa52454..55462c9dce28 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -262,6 +262,9 @@ private: bool bEnableRejectAll; bool bEnableUndo; + bool bEnableClearFormat; + bool bEnableClearFormatAll; + weld::Window* m_pDialog; std::unique_ptr<weld::Button> m_xAccept; std::unique_ptr<weld::Button> m_xReject; @@ -272,6 +275,7 @@ private: DECL_LINK( PbClickHdl, weld::Button&, void ); + void EnableClearFormatButton(weld::Button&, bool bFlag); public: SvxTPView(weld::Container* pParent, weld::Window* pDialog, weld::Builder* pTopLevel); virtual ~SvxTPView() override; @@ -282,7 +286,6 @@ public: void EnableAcceptAll(bool bFlag); void EnableReject(bool bFlag); void EnableRejectAll(bool bFlag); - void EnableClearFormatButton(weld::Button&, bool bFlag); void EnableClearFormat(bool bFlag); void EnableClearFormatAll(bool bFlag); void EnableUndo(bool bFlag=true); diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 583733befb41..ba2edd3d554b 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -106,6 +106,12 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Windo pTPFilter = m_xAcceptChgCtr->GetFilterPage(); pTPView = m_xAcceptChgCtr->GetViewPage(); + + // set wider window for the optional extending button labels + // eg. "Reject/Clear formatting" instead of "Reject" + pTPView->EnableClearFormat(true); + pTPView->EnableClearFormatAll(true); + pTheView = pTPView->GetTableControl(); pTheView->SetCalcView(); aSelectionIdle.SetInvokeHandler(LINK( this, ScAcceptChgDlg, UpdateSelectionHdl )); diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index f5defbb30ba8..15155c6c6edc 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -304,6 +304,8 @@ SvxTPView::SvxTPView(weld::Container* pParent, weld::Window* pDialog, weld::Buil , bEnableReject(true) , bEnableRejectAll(true) , bEnableUndo(true) + , bEnableClearFormat(false) + , bEnableClearFormatAll(false) , m_pDialog(pDialog) , m_xAccept(pTopLevel->weld_button("accept")) , m_xReject(pTopLevel->weld_button("reject")) @@ -313,11 +315,6 @@ SvxTPView::SvxTPView(weld::Container* pParent, weld::Window* pDialog, weld::Buil , m_xViewData(new SvxRedlinTable(m_xBuilder->weld_tree_view("writerchanges"), m_xBuilder->weld_tree_view("calcchanges"))) { - // set wider window for the optional extending button labels - // eg. "Reject/Clear formatting" instead of "Reject" - EnableClearFormat(true); - EnableClearFormatAll(true); - Size aControlSize(80, 65); m_xViewData->set_size_request(aControlSize.Width(), aControlSize.Height()); @@ -440,12 +437,18 @@ void SvxTPView::EnableClearFormatButton(weld::Button& rButton, bool bFlag) void SvxTPView::EnableClearFormat(bool bFlag) { + if (bEnableClearFormat == bFlag) + return; EnableClearFormatButton(*m_xReject, bFlag); + bEnableClearFormat = bFlag; } void SvxTPView::EnableClearFormatAll(bool bFlag) { + if (bEnableClearFormatAll == bFlag) + return; EnableClearFormatButton(*m_xRejectAll, bFlag); + bEnableClearFormatAll = bFlag; } void SvxTPView::ShowUndo() |