diff options
-rw-r--r-- | include/sfx2/viewsh.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 8 | ||||
-rw-r--r-- | sw/inc/view.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 10 |
5 files changed, 30 insertions, 3 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 56888cad22fd..a6659137807d 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -333,6 +333,7 @@ public: bool isTiledSearching() const; /// See lok::Document::getPart(). virtual int getPart() const; + virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 1bac0ac5d141..21086334dc78 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -85,6 +85,7 @@ #include <shellimpl.hxx> #include <vector> +#include <libxml/xmlwriter.h> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1501,6 +1502,13 @@ int SfxViewShell::getPart() const return 0; } +void SfxViewShell::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("sfxViewShell")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + xmlTextWriterEndElement(pWriter); +} + bool SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) /* [Description] diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index c9cccd04e6bb..38f7c6cac032 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -645,6 +645,8 @@ public: static SvxSearchItem* GetSearchItem() { return m_pSrchItem; } /// See SfxViewShell::getPart(). int getPart() const override; + /// See SfxViewShell::dumpAsXml(). + void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; inline long SwView::GetXScroll() const diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 808503684817..e97ba351d3fe 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -22,6 +22,7 @@ #include <anchoredobject.hxx> #include <libxml/xmlwriter.h> #include <SwPortionHandler.hxx> +#include <view.hxx> #include <svx/svdobj.hxx> class XmlPortionDumper:public SwPortionHandler @@ -293,9 +294,14 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const if (IsRootFrame()) { const SwRootFrame* pRootFrame = static_cast<const SwRootFrame*>(this); - xmlTextWriterStartElement(writer, BAD_CAST("shells")); - for (SwViewShell& rViewShell : pRootFrame->GetCurrShell()->GetRingContainer()) - rViewShell.dumpAsXml(writer); + xmlTextWriterStartElement(writer, BAD_CAST("sfxViewShells")); + SwView* pView = static_cast<SwView*>(SfxViewShell::GetFirst(true, checkSfxViewShell<SwView>)); + while (pView) + { + if (pView->GetObjectShell() == pRootFrame->GetCurrShell()->GetSfxViewShell()->GetObjectShell()) + pView->dumpAsXml(writer); + pView = static_cast<SwView*>(SfxViewShell::GetNext(*pView, true, checkSfxViewShell<SwView>)); + } xmlTextWriterEndElement(writer); } diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 852b51019946..1b727c8a2397 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/text/NotePrintMode.hpp> #include <cstdarg> +#include <libxml/xmlwriter.h> #include <cmdid.h> #include <sfx2/request.hxx> #include <sfx2/progress.hxx> @@ -258,6 +259,15 @@ int SwView::getPart() const return nPage - 1; } +void SwView::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swView")); + SfxViewShell::dumpAsXml(pWriter); + if (m_pWrtShell) + m_pWrtShell->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + // Create page printer/additions for SwView and SwPagePreview VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, |