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 xml
.dom
import minidom
14 def createInclude(model
):
16 #ifndef INCLUDED_OOXML_FACTORY_GENERATED_HXX
17 #define INCLUDED_OOXML_FACTORY_GENERATED_HXX
19 namespace writerfilter {
27 for namespace
in sorted([ns
.getAttribute("name") for ns
in model
.getElementsByTagName("namespace")]):
28 print("const Id NN_%s = %s << 16;" % (namespace
.replace('-', '_'), counter
))
34 for define
in sorted([ns
.getAttribute("name") for ns
in model
.getElementsByTagName("define")]):
35 if define
not in defines
:
36 print("const Id DEFINE_%s = %s;" % (define
, counter
))
37 defines
.append(define
)
42 #endif // INCLUDED_OOXML_FACTORY_GENERATED_HXX""")
45 modelPath
= sys
.argv
[1]
46 model
= minidom
.parse(modelPath
)
49 # vim:set shiftwidth=4 softtabstop=4 expandtab: