sw/inc/viewopt.hxx | 4 ++++ sw/source/core/view/viewsh.cxx | 1 + sw/source/uibase/config/viewopt.cxx | 15 +++++++++++++++ 3 files changed, 20 insertions(+)
New commits: commit 8fc478308f680227d7253b4becfc698e289f2be1 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Fri Jan 26 08:00:46 2024 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Jan 26 09:01:28 2024 +0100 sw layout xml dump: show if formatting marks are on Because that influences the layout, and sometimes it's far from trivial that it gets disabled, e.g. during printing/PDF export. Change-Id: Icb6accf3cb8bacd02f7267d55fbf56a4b10550bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162591 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 95c547e5c691..a98da0dc3cdf 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -137,6 +137,8 @@ struct ViewOptFlags1 && bShowChangesInMargin == rOther.bShowChangesInMargin && bShowChangesInMargin2 == rOther.bShowChangesInMargin2; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; enum class ViewOptCoreFlags2 { @@ -854,6 +856,8 @@ public: sal_uInt8 GetIdxEntryLvl() const { return m_nIdxEntryLvl; } void SetIdxEntryLvl(sal_uInt8 n) { m_nIdxEntryLvl = n; } + void dumpAsXml(xmlTextWriterPtr pWriter) const; + // Useful for when getting the current view SwViewOption is not possible otherwise static const SwViewOption& GetCurrentViewOptions(); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index a7222d95b049..e7dfd326791f 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -156,6 +156,7 @@ bool SwViewShell::isOutputToWindow() const void SwViewShell::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwViewShell")); + mpOpt->dumpAsXml(pWriter); (void)xmlTextWriterEndElement(pWriter); } diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index abd8bbc85768..4ffb7a7c47f9 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -638,4 +638,19 @@ const SwViewOption& SwViewOption::GetCurrentViewOptions() return aDefaultViewOptions; } +void SwViewOption::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwViewOption")); + m_nCoreOptions.dumpAsXml(pWriter); + (void)xmlTextWriterEndElement(pWriter); +} + +void ViewOptFlags1::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ViewOptFlags1")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("view-metachars"), "%s", + BAD_CAST(OString::boolean(bViewMetachars).getStr())); + (void)xmlTextWriterEndElement(pWriter); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */