summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-28 20:58:12 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-29 07:08:00 +0000
commit73c8bc849c0024d5d81ab0370cffa6aa24b56d22 (patch)
tree4fde4721d1040292235714d89a71e30d5d6db41e /sw
parent27319418ed7601fa62993e39894bb8f8902a88d0 (diff)
sw layout xml dump: mention SfxViewShell addresses
Change-Id: I2e5c8102684494fd3d7c1c70971a09d0c940a124 Reviewed-on: https://gerrit.libreoffice.org/27637 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/source/core/text/xmldump.cxx12
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx10
3 files changed, 21 insertions, 3 deletions
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,