summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-12-05 20:57:15 -0900
committerJim Raykowski <raykowj@gmail.com>2020-12-24 07:12:59 +0100
commitc405bae468d887ec77dd3830b7678fcedc2debfd (patch)
tree711071ec86bfc55b74d2250e5e3b9bce6740b431 /sw/source/ui
parent85f39dc62b7feb357535582deec1c18f72f9ef0d (diff)
tdf#138136 tdf#38093 add option to treat sub outline levels as content
Also included in this patch: - Modifications to make all outline content visible during move operations. - Removal of code intended to redraw buttons when layout is changed that seems not to work as intended. - Function IsOutlineContentFolded changed to IsOutlineContentVisible - Change of delay before button is shown to half of what it was. Change-Id: I0dde555ccd0693ca382c1f15326edfdc2fc44a93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107815 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optpage.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 5820f260886e..b6f0b696a91b 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -53,7 +53,6 @@
#include <officecfg/Office/Common.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>
@@ -101,13 +100,23 @@ 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_xOutlineLabel(m_xBuilder->weld_label("outlinelabel"))
, m_xShowOutlineContentVisibilityButton(m_xBuilder->weld_check_button("outlinecontentvisibilitybutton"))
+ , m_xTreatSubOutlineLevelsAsContent(m_xBuilder->weld_check_button("suboutlinelevelsascontent"))
, m_xShowChangesInMargin(m_xBuilder->weld_check_button("changesinmargin"))
, m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield"))
, m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield"))
{
if (!officecfg::Office::Common::Misc::ExperimentalMode::get())
+ {
+ m_xOutlineLabel->hide();
m_xShowOutlineContentVisibilityButton->hide();
+ m_xTreatSubOutlineLevelsAsContent->hide();
+ }
+ else
+ {
+ m_xShowOutlineContentVisibilityButton->connect_toggled(LINK(this, SwContentOptPage, ShowOutlineContentVisibilityButtonHdl));
+ }
/* This part is visible only with Writer/Web->View dialogue. */
const SfxPoolItem* pItem;
@@ -206,11 +215,11 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet)
m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll);
m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips);
m_xShowOutlineContentVisibilityButton->set_active(pElemAttr->m_bShowOutlineContentVisibilityButton);
+ m_xTreatSubOutlineLevelsAsContent->set_active(pElemAttr->m_bTreatSubOutlineLevelsAsContent);
+ m_xTreatSubOutlineLevelsAsContent->set_sensitive(pElemAttr->m_bShowOutlineContentVisibilityButton);
m_xShowChangesInMargin->set_active(pElemAttr->m_bShowChangesInMargin);
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);
@@ -234,13 +243,11 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet)
aElem.m_bSmoothScroll = m_xSmoothCBox->get_active();
aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active();
aElem.m_bShowOutlineContentVisibilityButton = m_xShowOutlineContentVisibilityButton->get_active();
+ aElem.m_bTreatSubOutlineLevelsAsContent = m_xTreatSubOutlineLevelsAsContent->get_active();
aElem.m_bShowChangesInMargin = m_xShowChangesInMargin->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);
@@ -277,6 +284,11 @@ IMPL_LINK(SwContentOptPage, VertRulerHdl, weld::ToggleButton&, rBox, void)
m_xVRulerRightCBox->set_sensitive(rBox.get_sensitive() && rBox.get_active());
}
+IMPL_LINK(SwContentOptPage, ShowOutlineContentVisibilityButtonHdl, weld::ToggleButton&, rBox, void)
+{
+ m_xTreatSubOutlineLevelsAsContent->set_sensitive(rBox.get_active());
+}
+
// TabPage Printer additional settings
SwAddPrinterTabPage::SwAddPrinterTabPage(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet& rCoreSet)