Kaydet (Commit) 2e44c2b2 authored tarafından Miklos Vajna's avatar Miklos Vajna

sd: add SdDrawDocument::dumpAsXml()

SdDrawDocument inherits from SdrModel which already has an XML dumper,
so just add an sd method that can create the XML writer and then we get
the rest for free.

Change-Id: Iac9bfb779e111f9887f171db6f5bd5151dd7e447
üst df38ccec
...@@ -661,7 +661,7 @@ public: ...@@ -661,7 +661,7 @@ public:
also during the runtime of the Undo() and Redo() methods. */ also during the runtime of the Undo() and Redo() methods. */
bool IsUndoEnabled() const; bool IsUndoEnabled() const;
void dumpAsXml(struct _xmlTextWriter* pWriter) const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
......
...@@ -591,6 +591,8 @@ public: ...@@ -591,6 +591,8 @@ public:
SAL_DLLPRIVATE bool IsUsingEmbededFonts() { return mbUseEmbedFonts; } SAL_DLLPRIVATE bool IsUsingEmbededFonts() { return mbUseEmbedFonts; }
SAL_DLLPRIVATE void SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; } SAL_DLLPRIVATE void SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; }
void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
private: private:
/** This member stores the printer independent layout mode. Please /** This member stores the printer independent layout mode. Please
refer to <member>SetPrinterIndependentLayout()</member> for its refer to <member>SetPrinterIndependentLayout()</member> for its
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <libxml/xmlwriter.h>
#include "PageListWatcher.hxx" #include "PageListWatcher.hxx"
#include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <com/sun/star/document/PrinterIndependentLayout.hpp>
...@@ -1047,4 +1049,22 @@ void SdDrawDocument::InitObjectVector() ...@@ -1047,4 +1049,22 @@ void SdDrawDocument::InitObjectVector()
} }
} }
} }
void SdDrawDocument::dumpAsXml(xmlTextWriterPtr pWriter) const
{
bool bOwns = false;
if (!pWriter)
{
pWriter = xmlNewTextWriterFilename("model.xml", 0);
xmlTextWriterStartDocument(pWriter, NULL, NULL, NULL);
bOwns = true;
}
FmFormModel::dumpAsXml(pWriter);
if (bOwns)
{
xmlTextWriterEndDocument(pWriter);
xmlFreeTextWriter(pWriter);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -213,6 +213,12 @@ void Window::Paint(const Rectangle& rRect) ...@@ -213,6 +213,12 @@ void Window::Paint(const Rectangle& rRect)
void Window::KeyInput(const KeyEvent& rKEvt) void Window::KeyInput(const KeyEvent& rKEvt)
{ {
if (getenv("SD_DEBUG") && rKEvt.GetKeyCode().GetCode() == KEY_F12 && mpViewShell)
{
mpViewShell->GetDoc()->dumpAsXml(0);
return;
}
if (!(mpViewShell && mpViewShell->KeyInput(rKEvt, this))) if (!(mpViewShell && mpViewShell->KeyInput(rKEvt, this)))
{ {
if (mpViewShell && rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE) if (mpViewShell && rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment