Update ooo320-m1
[ooovba.git] / writerfilter / source / doctok / resourceids.xsl
blobe4495183891be56de1216e52e704c2fda16dd4bb
1 <!--
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * Copyright 2008 by Sun Microsystems, Inc.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * $RCSfile: resourceids.xsl,v $
12 * $Revision: 1.9 $
14 * This file is part of OpenOffice.org.
16 * OpenOffice.org is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License version 3
18 * only, as published by the Free Software Foundation.
20 * OpenOffice.org is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Lesser General Public License version 3 for more details
24 * (a copy is included in the LICENSE file that accompanied this code).
26 * You should have received a copy of the GNU Lesser General Public License
27 * version 3 along with OpenOffice.org. If not, see
28 * <http://www.openoffice.org/license.html>
29 * for a copy of the LGPLv3 License.
31 ************************************************************************/
33 -->
34 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
35 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
36 <xsl:output method="text" />
38 <!-- Key all attributes with the same name and same value -->
39 <xsl:key name="same-valued-tagged-data"
40 match="UML:TaggedValue.dataValue" use="." />
42 <xsl:template match="/">
43 <out>
44 <xsl:text>
45 /*************************************************************************
47 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
49 * Copyright 2008 by Sun Microsystems, Inc.
51 * OpenOffice.org - a multi-platform office productivity suite
53 * $RCSfile: resourceids.xsl,v $
55 * $Revision: 1.9 $
57 * This file is part of OpenOffice.org.
59 * OpenOffice.org is free software: you can redistribute it and/or modify
60 * it under the terms of the GNU Lesser General Public License version 3
61 * only, as published by the Free Software Foundation.
63 * OpenOffice.org is distributed in the hope that it will be useful,
64 * but WITHOUT ANY WARRANTY; without even the implied warranty of
65 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66 * GNU Lesser General Public License version 3 for more details
67 * (a copy is included in the LICENSE file that accompanied this code).
69 * You should have received a copy of the GNU Lesser General Public License
70 * version 3 along with OpenOffice.org. If not, see
71 * http://www.openoffice.org/license.html
72 * for a copy of the LGPLv3 License.
74 ************************************************************************/
77 THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
80 #ifndef INCLUDED_RESOURCESIDS
81 #define INCLUDED_RESOURCESIDS
83 #include &lt;sal/types.h&gt;
84 #include &lt;resourcemodel/WW8ResourceModel.hxx&gt;
86 namespace writerfilter {
88 namespace NS_rtf {
90 /* Attributes */</xsl:text>
91 <xsl:for-each select='.//UML:Attribute[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]'>
92 <xsl:variable name="pos" select="position()"/>
93 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
94 <xsl:choose>
95 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
96 <!-- <xsl:when test='.//UML:TaggedValue.dataValue = preceding::*//UML:TaggedValue.dataValue'/>-->
97 <xsl:otherwise>
98 <xsl:text>
99 const Id </xsl:text>
100 <xsl:call-template name='idtoqname'>
101 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
102 </xsl:call-template>
103 <xsl:text> = </xsl:text>
104 <xsl:variable name="id" select="10000 + $pos"/>
105 <xsl:value-of select='$id'/>
106 <xsl:text>; // 0x</xsl:text>
107 <xsl:call-template name="dectohex">
108 <xsl:with-param name="number" select="$id"/>
109 </xsl:call-template>
110 </xsl:otherwise>
111 </xsl:choose>
112 </xsl:for-each>
113 </xsl:for-each>
114 <xsl:text>
116 /* Operations */</xsl:text>
117 <xsl:for-each select='.//UML:Operation[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]'>
118 <xsl:variable name="pos" select="position()"/>
119 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
120 <xsl:choose>
121 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
122 <xsl:otherwise>
123 <xsl:text>
124 const Id </xsl:text>
125 <xsl:call-template name='idtoqname'>
126 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
127 </xsl:call-template>
128 <xsl:text> = </xsl:text>
129 <xsl:variable name="id" select="20000 + $pos"/>
130 <xsl:value-of select='$id'/>
131 <xsl:text>; // 0x</xsl:text>
132 <xsl:call-template name="dectohex">
133 <xsl:with-param name="number" select="$id"/>
134 </xsl:call-template>
135 </xsl:otherwise>
136 </xsl:choose>
137 </xsl:for-each>
138 </xsl:for-each>
139 <xsl:text>
141 /* Classes */</xsl:text>
142 <xsl:for-each select='.//UML:Class[@name!="reserved"]'>
143 <xsl:variable name="pos" select="position()"/>
144 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
145 <xsl:choose>
146 <xsl:when test='.//UML:Stereotype[@xmi.idref="noqname"]'/>
147 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
148 <xsl:otherwise>
149 <xsl:text>
150 const Id </xsl:text>
151 <xsl:call-template name='idtoqname'>
152 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
153 </xsl:call-template>
154 <xsl:text> = </xsl:text>
155 <xsl:value-of select='30000 + $pos'/>
156 <xsl:text>; // 0x</xsl:text>
157 <xsl:call-template name="dectohex">
158 <xsl:with-param name="number" select="30000 + position()"/>
159 </xsl:call-template>
160 </xsl:otherwise>
161 </xsl:choose>
162 </xsl:for-each>
163 </xsl:for-each>
164 <xsl:text>
167 namespace NS_dff
168 {</xsl:text>
169 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.idref="dffopt"]'>
170 <xsl:variable name ="optname">
171 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="optname"]/UML:TaggedValue.dataValue'/>
172 </xsl:variable>
173 <xsl:variable name="fopid">
174 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="fopid"]'>
175 <xsl:value-of select='UML:TaggedValue.dataValue'/>
176 </xsl:for-each>
177 </xsl:variable>
178 <xsl:text>
179 const Id </xsl:text>
180 <xsl:call-template name="idtoqname">
181 <xsl:with-param name="id"><xsl:value-of select="$optname"/></xsl:with-param>
182 </xsl:call-template>
183 <xsl:text> = </xsl:text>
184 <xsl:value-of select="$fopid"/>
185 <xsl:text>; // 0x</xsl:text>
186 <xsl:call-template name="dectohex">
187 <xsl:with-param name="number" select="$fopid"/>
188 </xsl:call-template>
189 </xsl:for-each>
190 <xsl:text>
196 #endif // INCLUDED_RESOURCESIDS&#xa;</xsl:text></out>
197 </xsl:template>
199 <xsl:template name='idtoqname'>
200 <xsl:param name='id'/>LN_<xsl:value-of select='substring-after($id, ":")'/>
201 </xsl:template>
203 <xsl:template name='dectohex'>
204 <xsl:param name="number"/>
205 <xsl:if test="$number > 16">
206 <xsl:call-template name="dectohex">
207 <xsl:with-param name="number" select="floor($number div 16)"/>
208 </xsl:call-template>
209 </xsl:if>
210 <xsl:value-of select="substring('0123456789abcdef', $number mod 16 + 1, 1)"/>
211 </xsl:template>
213 </xsl:stylesheet>