3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from __future__
import print_function
11 from xml
.dom
import minidom
15 def createInclude(model
):
17 #ifndef INCLUDED_OOXML_FACTORY_GENERATED_HXX
18 #define INCLUDED_OOXML_FACTORY_GENERATED_HXX
20 namespace writerfilter {
28 for namespace
in sorted([ns
.getAttribute("name") for ns
in model
.getElementsByTagName("namespace")]):
29 print("const Id NN_%s = %s << 16;" % (namespace
.replace('-', '_'), counter
))
35 for define
in sorted([ns
.getAttribute("name") for ns
in model
.getElementsByTagName("define")]):
36 if define
not in defines
:
37 print("const Id DEFINE_%s = %s;" % (define
, counter
))
38 defines
.append(define
)
43 #endif // INCLUDED_OOXML_FACTORY_GENERATED_HXX""")
46 modelPath
= sys
.argv
[1]
47 model
= minidom
.parse(modelPath
)
50 # vim:set shiftwidth=4 softtabstop=4 expandtab: