diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-05-31 16:11:42 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-05-31 21:59:57 +0200 |
commit | 8f3e11dc9a4b3fd9ad1985d88b241df7bcb66fec (patch) | |
tree | 8eae2567501177794d0a22a6585eeb324af90eff /sw/source/ui | |
parent | 65b5569459ae19d2404864edb8fa68020ad699cc (diff) |
tdf#160984 sw continuous endnotes: hide not functional UI in this mode
Previous commits bug have fixed cases where opening a Word document
rendered a different foot/endnote separator than expected for Word. The
followings were modified:
- distance between body text and separator, between separator and first
note
- the vertical position of the line
- the length of the line
Now ODT files keep the original feature set and Word files look as
expected, but a couple of UI controls are ignored by the layout, hide
these as they intentionally don't do anything while we're in Word compat
mode.
Change-Id: I72a3dde637d3e224038886a79550fa069253a4f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168295
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/misc/pgfnote.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 0316f6251eaa..9ed64e3e3de6 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -29,6 +29,7 @@ #include <svx/pageitem.hxx> #include <svl/eitem.hxx> #include <editeng/ulspitem.hxx> +#include <svl/grabbagitem.hxx> #include <uitool.hxx> #include <pagedesc.hxx> #include <pgfnote.hxx> @@ -99,13 +100,17 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button("maxheightpage")) , m_xMaxHeightBtn(m_xBuilder->weld_radio_button("maxheight")) , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button("maxheightsb", FieldUnit::CM)) + , m_xDistLabel(m_xBuilder->weld_label("spacetotextlabel")) , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spacetotext", FieldUnit::CM)) + , m_xLinePosLabel(m_xBuilder->weld_label("positionlabel")) , m_xLinePosBox(m_xBuilder->weld_combo_box("position")) , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button("style"))) , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("thickness", FieldUnit::POINT)) , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button("color"), [this]{ return GetDialogController()->getDialog(); })) + , m_xLineLengthLabel(m_xBuilder->weld_label("lengthlabel")) , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button("length", FieldUnit::PERCENT)) + , m_xLineDistLabel(m_xBuilder->weld_label("spacingtocontentslabel")) , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button("spacingtocontents", FieldUnit::CM)) { SetExchangeSupport(); @@ -116,6 +121,30 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134; m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP); + + bool bContinuousEndnotes = false; + if (const SfxGrabBagItem* pGragbagItem = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG)) + { + auto it = pGragbagItem->GetGrabBag().find("ContinuousEndnotes"); + if (it != pGragbagItem->GetGrabBag().end()) + { + it->second >>= bContinuousEndnotes; + } + } + + if (bContinuousEndnotes) + { + // These are ignored in SwFootnoteContFrame::Format() and SwFootnoteContFrame::PaintLine(), + // hide them. + m_xDistLabel->set_visible(false); + m_xDistEdit->set_visible(false); + m_xLinePosLabel->set_visible(false); + m_xLinePosBox->set_visible(false); + m_xLineLengthLabel->set_visible(false); + m_xLineLengthEdit->set_visible(false); + m_xLineDistLabel->set_visible(false); + m_xLineDistEdit->set_visible(false); + } } SwFootNotePage::~SwFootNotePage() |