diff options
author | Jim Raykowski <raykowj@gmail.com> | 2020-07-27 13:11:54 -0800 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-30 12:03:36 +0200 |
commit | b2686de46250d0c8d14365a2af8428387baa0c24 (patch) | |
tree | 2bb088360d254509ed01fe1d3e49ebc1245dc244 /sw/source/ui | |
parent | 63308aa3b109271ffb4fd47e9fea2e3281a1552d (diff) |
tdf#38093 Writer outline folding - feature sensitivity
Patch 1/6
-Adds option 'Show outline visibility button' to options writer view
tab in Display section.
-Adds UNO command '.uno:ShowOutlineContentVisibilityButton' to toggle
option on and off from menus, toolbars, and key bindings.
-Makes feature experimental mode.
Change-Id: If5a57defd8f568736ea08625ab6eb08e30b15c03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99652
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 70a2db75fcb7..fda991a7abfb 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -52,6 +52,7 @@ #include <editeng/svxenum.hxx> #include <sal/macros.h> #include <sfx2/dialoghelper.hxx> +#include <sfx2/dispatch.hxx> #include <sfx2/printer.hxx> #include <sfx2/bindings.hxx> #include <sfx2/viewfrm.hxx> @@ -67,6 +68,8 @@ #include <optload.hxx> +#include <svtools/miscopt.hxx> + using namespace ::com::sun::star; namespace { @@ -99,9 +102,14 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, weld::DialogControlle , m_xMetricLabel(m_xBuilder->weld_label("measureunitlabel")) , m_xMetricLB(m_xBuilder->weld_combo_box("measureunit")) , m_xShowInlineTooltips(m_xBuilder->weld_check_button("changestooltip")) + , m_xShowOutlineContentVisibilityButton(m_xBuilder->weld_check_button("outlinecontentvisibilitybutton")) , m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield")) , m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield")) { + SvtMiscOptions aMiscOptions; + if (!aMiscOptions.IsExperimentalMode()) + m_xShowOutlineContentVisibilityButton->hide(); + /* This part is visible only with Writer/Web->View dialogue. */ const SfxPoolItem* pItem; if (! (SfxItemState::SET == rCoreSet.GetItemState(SID_HTML_MODE, false, &pItem ) @@ -198,8 +206,11 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet) m_xVRulerRightCBox->set_active(pElemAttr->m_bVertRulerRight); m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll); m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips); + m_xShowOutlineContentVisibilityButton->set_active(pElemAttr->m_bShowOutlineContentVisibilityButton); m_xFieldHiddenCB->set_active( pElemAttr->m_bFieldHiddenText ); m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara ); + if (GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton() != pElemAttr->m_bShowOutlineContentVisibilityButton) + GetActiveWrtShell()->GetView().GetDocShell()->GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON); } m_xMetricLB->set_active(-1); lcl_SelectMetricLB(*m_xMetricLB, SID_ATTR_METRIC, *rSet); @@ -222,9 +233,13 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) aElem.m_bVertRulerRight = m_xVRulerRightCBox->get_active(); aElem.m_bSmoothScroll = m_xSmoothCBox->get_active(); aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active(); + aElem.m_bShowOutlineContentVisibilityButton = m_xShowOutlineContentVisibilityButton->get_active(); aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active(); aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active(); + if (GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton() != aElem.m_bShowOutlineContentVisibilityButton) + GetActiveWrtShell()->GetView().GetDocShell()->GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON); + bool bRet = !pOldAttr || aElem != *pOldAttr; if(bRet) bRet = nullptr != rSet->Put(aElem); |