[Libreoffice-commits] core.git: 2 commits - writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sun Aug 17 04:07:00 PDT 2014
writerfilter/source/ooxml/factoryimpl.py | 2 ++
writerfilter/source/ooxml/factoryimpl_ns.py | 2 ++
writerfilter/source/ooxml/namespaceids.py | 16 +++++-----------
3 files changed, 9 insertions(+), 11 deletions(-)
New commits:
commit 99b9e06b7cdfd1f3336226583d73aa49cc6ce305
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Aug 17 12:57:03 2014 +0200
Sync oox -> writerfilter namespace includes
Change-Id: I940efc1197e0694c93d25e5c4542eeef12cbb10f
diff --git a/writerfilter/source/ooxml/factoryimpl.py b/writerfilter/source/ooxml/factoryimpl.py
index c527ef2..3b1ae00 100644
--- a/writerfilter/source/ooxml/factoryimpl.py
+++ b/writerfilter/source/ooxml/factoryimpl.py
@@ -185,6 +185,8 @@ def createImpl(model):
print("""namespace writerfilter {
namespace ooxml {
+using namespace com::sun::star;
+
/// @cond GENERATED
""")
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py
index 03136dc..bbcbc59 100644
--- a/writerfilter/source/ooxml/factoryimpl_ns.py
+++ b/writerfilter/source/ooxml/factoryimpl_ns.py
@@ -700,6 +700,8 @@ def createImpl(modelNode, nsName):
namespace writerfilter {
namespace ooxml {
+using namespace com::sun::star;
+
/// @cond GENERATED""" % nsName)
print()
diff --git a/writerfilter/source/ooxml/namespaceids.py b/writerfilter/source/ooxml/namespaceids.py
index 506645e..c201e7a 100644
--- a/writerfilter/source/ooxml/namespaceids.py
+++ b/writerfilter/source/ooxml/namespaceids.py
@@ -21,17 +21,10 @@ class ContentHandler(xml.sax.handler.ContentHandler):
#ifndef INCLUDED_OOXML_NAMESPACESIDS_HXX
#define INCLUDED_OOXML_NAMESPACESIDS_HXX
-#include <map>
-#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <string>
-
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <sal/types.h>
namespace writerfilter {
namespace ooxml {
-using namespace ::std;
-using namespace ::com::sun::star;
""")
def endDocument(self):
commit 7791b3f600eb01ce7d878ca6defafb898e3858b7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Aug 17 12:53:22 2014 +0200
writerfilter: sort namespaces in generated header
Change-Id: I1c08fbe841161323325c6ffd153f09daf30c095b
diff --git a/writerfilter/source/ooxml/namespaceids.py b/writerfilter/source/ooxml/namespaceids.py
index 151e809..506645e 100644
--- a/writerfilter/source/ooxml/namespaceids.py
+++ b/writerfilter/source/ooxml/namespaceids.py
@@ -14,7 +14,7 @@ import sys
class ContentHandler(xml.sax.handler.ContentHandler):
def __init__(self):
- self.tokens = []
+ self.tokens = {}
def startDocument(self):
print("""
@@ -35,6 +35,8 @@ using namespace ::com::sun::star;
""")
def endDocument(self):
+ for alias in sorted(self.tokens.keys()):
+ print(self.tokens[alias])
print("""
}}
#endif //INCLUDED_OOXML_NAMESPACESIDS_HXX""")
@@ -43,8 +45,7 @@ using namespace ::com::sun::star;
if name == "namespace-alias":
token = """const sal_Int32 NMSP_%s = %s;""" % (attrs["alias"], attrs["id"])
if token not in self.tokens:
- self.tokens.append(token)
- print(token)
+ self.tokens[attrs["alias"]] = token
parser = xml.sax.make_parser()
parser.setContentHandler(ContentHandler())
More information about the Libreoffice-commits
mailing list