2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 <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#"
19 xmlns:
rdfs=
"http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:
space=
"default">
20 <xsl:output method=
"text" />
22 <xsl:include href=
"resourcetools.xsl"/>
24 <xsl:template match=
"/">
25 <xsl:call-template name=
"licenseheader"/>
27 #include
<doctok/resources.hxx
>
29 #ifndef WW8_OUTPUT_WITH_DEPTH
30 #include
<doctok/WW8OutputWithDepth.hxx
>
33 #ifndef INCLUDED_SPRMIDS_HXX
34 #include
<doctok/sprmids.hxx
>
37 namespace writerfilter {
40 extern WW8OutputWithDepth output;
42 using namespace ::std;
44 <xsl:apply-templates select='/XMI/XMI.content/UML:Model'
mode=
"sprmkind"/>
45 <xsl:apply-templates select='.//UML:Class' mode='class'
/>
46 <xsl:apply-templates select='//UML:Model' mode='createsprmprops'
/>
47 <xsl:apply-templates select='/XMI/XMI.content/UML:Model'
48 mode='createsprmbinary'
/>
49 <xsl:apply-templates select='/XMI/XMI.content/UML:Model'
50 mode='createdffrecord'
/>
51 <xsl:apply-templates select='/XMI/XMI.content/UML:Model' mode='ww8foptename'
/>
52 <xsl:apply-templates select='/XMI/XMI.content/UML:Model'
53 mode='isbooleandffopt'
/>
59 <xsl:template match=
"UML:Class" mode=
"class">
61 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8resource"]'
>
62 <xsl:apply-templates select=
"." mode=
"ww8resource">
63 <xsl:with-param name=
"classprefix">WW8
</xsl:with-param>
64 <xsl:with-param name=
"needsinit">true
</xsl:with-param>
65 </xsl:apply-templates>
67 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"dffrecord"]'
>
68 <xsl:apply-templates select=
"." mode=
"ww8resource">
69 <xsl:with-param name=
"classprefix">Dff
</xsl:with-param>
70 </xsl:apply-templates>
75 <xsl:template match=
"UML:Class" mode=
"ww8resource">
76 <xsl:param name=
"classprefix"/>
77 <xsl:param name=
"needsinit"/>
78 <xsl:variable name=
"parentresource">
79 <xsl:call-template name='parenttype'
>
80 <xsl:with-param name='type'
><xsl:value-of select='@xmi.id'
/></xsl:with-param>
83 <xsl:variable name='size_'
><xsl:value-of select='./*/UML:TaggedValue[./*/UML:TagDefinition/@xmi.
idref=
"size"]/UML:TaggedValue.dataValue'
/></xsl:variable>
84 <xsl:variable name='size'
>
86 <xsl:when test='$size_ !=
""'
><xsl:value-of select='$size_'
/></xsl:when>
87 <xsl:otherwise>0</xsl:otherwise>
90 <xsl:variable name=
"classname"><xsl:value-of select=
"$classprefix"/><xsl:value-of select=
"@name"/></xsl:variable>
91 <xsl:variable name=
"superclass">
93 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
94 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
97 <xsl:variable name=
"surroundclass">
99 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
100 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
105 Automatically generated class:
</xsl:text><xsl:value-of select=
"@name"/><xsl:text>
107 <xsl:for-each select='./UML:ModelElement.stereotype/UML:Stereotype'
>
109 Stereotype
</xsl:text>
110 <xsl:value-of select='@xmi.idref'
/>
111 <xsl:text>
</xsl:text>
114 Parent Resource:
</xsl:text>
115 <xsl:value-of select=
"$parentresource"/>
117 Size:
</xsl:text><xsl:value-of select='$size'
/>
122 <xsl:value-of select=
"$classname"/>
123 <xsl:text>::~
</xsl:text>
124 <xsl:value-of select=
"$classname"/>
129 <xsl:if test=
"$needsinit='true'">
132 <xsl:value-of select=
"$classname"/>
136 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withmembers"]'
>
137 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
138 <xsl:apply-templates select='.' mode='initmembers'
/>
141 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"initimpl"]'
>
142 <xsl:text> initImpl();

</xsl:text>
149 <xsl:when test='$
parentresource=
"Properties"'
>
150 <xsl:apply-templates select=
"." mode=
"resolveProperties">
151 <xsl:with-param name=
"classname" select=
"$classname"/>
152 </xsl:apply-templates>
154 <xsl:when test='$
parentresource=
"Table"'
>
155 <xsl:apply-templates select=
"." mode=
"resolveTable">
156 <xsl:with-param name=
"classname" select=
"$classname"/>
157 </xsl:apply-templates>
163 <xsl:template match=
"UML:Class" mode=
"resolveProperties">
164 <xsl:param name=
"classname"/>
165 <xsl:variable name=
"rHandler">
167 <xsl:when test='.//UML:Attribute[@name!=
"reserved"]'
>
168 <xsl:if test='.//UML:Stereotype[@xmi.idref !=
"noresolve"]'
>
169 <xsl:text>rHandler
</xsl:text>
172 <xsl:when test='.//UML:Operation[@name!=
"reserved"]'
>
173 <xsl:if test='.//UML:Stereotype[@xmi.idref !=
"noresolve"]'
>
174 <xsl:text>rHandler
</xsl:text>
177 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
178 <xsl:text>rHandler
</xsl:text>
184 <xsl:value-of select=
"$classname"/>
186 <xsl:when test=
".//UML:Stereotype[@xmi.idref='ww8resource']">
187 <xsl:text>::resolve(Properties
& </xsl:text>
188 <xsl:value-of select=
"$rHandler"/>
189 <xsl:text>)
</xsl:text>
191 <xsl:when test=
".//UML:Stereotype[@xmi.idref='dffrecord']">
192 <xsl:text>::resolveLocal(Properties
& </xsl:text>
193 <xsl:value-of select=
"$rHandler"/>
194 <xsl:text>)
</xsl:text>
199 <xsl:if test='.//UML:Stereotype[@xmi.
idref=
"debug"]'
>
201 dump(output);
</xsl:text>
206 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
208 <xsl:when test='.//UML:Stereotype[@xmi.
idref=
"noresolve"]'
>
211 <xsl:apply-templates select='.' mode='resolveAttribute'
/>
215 <xsl:for-each select='.//UML:Operation[@name!=
"reserved"]'
>
217 <xsl:when test='.//UML:Stereotype[@xmi.
idref=
"noresolve"]'
>
220 <xsl:apply-templates select='.' mode='resolveOperation'
/>
225 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
226 resolveNoAuto(rHandler);
229 } catch (const Exception
& e) {
230 clog
<< e.getText()
<< endl;
236 <xsl:value-of select=
"$classname"/>
237 <xsl:text>::dump(OutputWithDepth
< string
> & o) const
239 o.addItem(
"<dump type='</xsl:text>
240 <xsl:value-of select='@name'/>
243 WW8StructBase::dump(o);
</xsl:text>
244 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
245 <xsl:apply-templates select='.' mode='dumpAttribute'
/>
249 o.addItem(
"</dump>");
253 <xsl:template match='UML:Attribute' mode='resolveAttribute'
>
254 <xsl:variable name=
"attrid">
255 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"attrid"]'
>
256 <xsl:value-of select='UML:TaggedValue.dataValue'
/>
259 <xsl:variable name=
"qname">
260 <xsl:call-template name='idtoqname'
>
261 <xsl:with-param name='id'
>
262 <xsl:value-of select='$attrid'
/>
267 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"attribute"'
>
270 WW8Value::Pointer_t pVal = createValue(get_
</xsl:text>
271 <xsl:value-of select=
"@name"/>
273 rHandler.attribute(
</xsl:text>
274 <xsl:value-of select=
"$qname"/>
278 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"array"'
>
279 <xsl:variable name=
"elementtype">
280 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
282 <xsl:variable name=
"parentclass">
283 <xsl:call-template name='parenttype'
>
284 <xsl:with-param name='type'
>
285 <xsl:value-of select='$elementtype'
/>
291 sal_uInt32 nCount = get_
</xsl:text>
292 <xsl:value-of select=
"@name"/>
294 for (sal_uInt32 n =
0; n
< nCount; ++n)
296 WW8Value::Pointer_t pVal = createValue(get_
</xsl:text>
297 <xsl:value-of select=
"@name"/>
299 rHandler.attribute(
</xsl:text>
300 <xsl:value-of select=
"$qname"/>
305 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"string"'
>
308 WW8StringValue aVal(get_
</xsl:text>
309 <xsl:value-of select='@name'
/>
311 rHandler.attribute(
</xsl:text>
312 <xsl:value-of select=
"$qname"/>
319 <xsl:template match='UML:Attribute' mode='dumpAttribute'
>
320 <xsl:variable name=
"type">
321 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
322 </xsl:variable><xsl:variable name=
"saltype">
323 <xsl:call-template name='saltype'
>
324 <xsl:with-param name='type'
>
325 <xsl:value-of select='$type'
/>
327 <xsl:with-param name='parenttype'
>
328 <xsl:apply-templates select=
"." mode=
"parentclass"/>
332 <xsl:variable name=
"name" select=
"@name"/>
333 <xsl:for-each select=
".//UML:Stereotype">
335 <xsl:when test='@xmi.idref =
"attributeremainder"'
/>
336 <xsl:when test='@xmi.idref =
"array"'
>
339 sal_uInt32 nCount = get_
</xsl:text>
340 <xsl:value-of select='$name'
/>
343 for (sal_uInt32 n =
0; n
< nCount; ++n)
345 writerfilter::dump(o,
"</xsl:text>
346 <xsl:value-of select='$name'/>
347 <xsl:text>", get_
</xsl:text>
348 <xsl:value-of select=
"$name"/>
353 <xsl:when test='@xmi.idref =
"string"'
>
356 WW8StringValue aVal(get_
</xsl:text>
357 <xsl:value-of select='$name'
/>
360 o.addItem(
"</xsl:text>
361 <xsl:value-of select='$name'/>
362 <xsl:text>" << "=\"" + aVal.toString() + "\
"");
367 writerfilter::dump(o,
"</xsl:text>
368 <xsl:value-of select='$name'/>
369 <xsl:text>", get_
</xsl:text>
370 <xsl:value-of select=
"$name"/>
371 <xsl:text>());
</xsl:text>
377 <xsl:template name=
"resolveOperationAttribute">
378 <xsl:variable name=
"opid">
379 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"opid"]'
>
380 <xsl:value-of select='./UML:TaggedValue.dataValue'
/>
385 WW8Value::Pointer_t pVal = createValue(get_
</xsl:text>
386 <xsl:value-of select=
"@name"/>
388 rHandler.attribute(
</xsl:text>
389 <xsl:call-template name='idtoqname'
>
390 <xsl:with-param name='id'
><xsl:value-of select='$opid'
/></xsl:with-param>
396 <xsl:template name=
"resolveOperationArray">
397 <xsl:variable name=
"elementtype">
398 <xsl:value-of select='.//UML:Parameter.type/@xmi.idref'
/>
400 <xsl:variable name=
"opid">
401 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"opid"]'
>
402 <xsl:value-of select='./UML:TaggedValue.dataValue'
/>
405 <xsl:variable name=
"parentclass">
406 <xsl:for-each select='/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$elementtype]'
>
407 <xsl:value-of select='./UML:Generalization.parent/UML:Class/@xmi.idref'
/>
412 sal_uInt32 nCount = get_
</xsl:text>
413 <xsl:value-of select=
"@name"/>
416 for (sal_uInt32 n =
0; n
< nCount; ++n)
418 WW8Value::Pointer_t pVal = createValue(get_
</xsl:text>
419 <xsl:value-of select=
"@name"/>
421 rHandler.attribute(
</xsl:text>
422 <xsl:call-template name='idtoqname'
>
423 <xsl:with-param name='id'
><xsl:value-of select='$opid'
/></xsl:with-param>
430 <xsl:template name=
"resolveOperationBinary">
433 WW8BinaryObjReference::Pointer_t pRef(get_
</xsl:text>
434 <xsl:value-of select=
"@name"/>
438 rHandler.sprm(aSprm);
442 <xsl:template match='UML:Operation' mode='resolveOperation'
>
444 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"attribute"'
>
445 <xsl:call-template name=
"resolveOperationAttribute"/>
447 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"array"'
>
448 <xsl:call-template name=
"resolveOperationArray"/>
450 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"binary"'
>
451 <xsl:call-template name=
"resolveOperationBinary"/>
456 <xsl:template match=
"UML:Class" mode=
"resolveTable">
457 <xsl:param name=
"classname"/>
458 <xsl:text>void
</xsl:text>
459 <xsl:value-of select=
"$classname"/>
460 <xsl:text>::resolve(Table
& rHandler)
462 sal_uInt32 nCount = getEntryCount();
463 writerfilter::Reference
< Properties
>::Pointer_t pEntry;
464 for (sal_uInt32 n =
0; n
< nCount; ++n)
466 pEntry = getEntry(n);
468 if (pEntry.get() !=
0x0)
472 rHandler.entry(n, pEntry);
474 catch (const ExceptionOutOfBounds
&)
483 <xsl:template match='UML:Model' mode='createsprmprops'
>
484 writerfilter::Reference
< Properties
> ::Pointer_t createSprmProps
485 (WW8PropertyImpl
& rProp)
487 writerfilter::Reference
< Properties
> ::Pointer_t pResult;
489 switch (rProp.getId())
491 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.
idref=
"ww8sprm" and .//UML:Stereotype/@xmi.
idref=
"ww8resource"]'
>
492 case
<xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"sprmcode"]//UML:TaggedValue.dataValue'
/>:
493 pResult = writerfilter::Reference
< Properties
> ::Pointer_t(new WW8
<xsl:value-of select='@name'
/>(rProp,
0, rProp.getCount()));
505 <xsl:template match='UML:Model' mode='createsprmbinary'
>
507 writerfilter::Reference
< BinaryObj
> ::Pointer_t createSprmBinary
508 (WW8PropertyImpl
& rProp)
510 writerfilter::Reference
< BinaryObj
> ::Pointer_t pResult;
512 switch (rProp.getId())
518 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.
idref=
"ww8sprmbinary" and .//UML:Stereotype/@xmi.
idref=
"ww8resource"]'
>
519 case
<xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"sprmcode"]//UML:TaggedValue.dataValue'
/>:
521 WW8
<xsl:value-of select='@name'
/>::Pointer_t p(new WW8
<xsl:value-of select='@name'
/>(rProp,
0, rProp.getCount()));
523 pResult = p-
>getBinary();
538 <!-- returns optname of UML:Class -->
539 <xsl:template name=
"optname">
540 <xsl:for-each select=
"./UML:ModelElement.taggedValue/UML:TaggedValue">
541 <xsl:if test=
".//UML:TagDefinition/@xmi.idref='optname'">
542 <xsl:value-of select=
"./UML:TaggedValue.dataValue"/>
547 <xsl:template name=
"ww8foptenamecase">
550 <xsl:variable name=
"optname">
551 <xsl:call-template name=
"optname"/>
553 <xsl:call-template name=
"idtoqname">
554 <xsl:with-param name=
"id" select=
"$optname"/>
557 result =
"</xsl:text>
558 <xsl:value-of select="$optname
"/>
563 <xsl:template name=
"getdffoptname">
565 OUString getDffOptName(sal_uInt32 nPid)
571 <xsl:for-each select=
"./UML:Class[./UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']">
572 <xsl:call-template name=
"ww8foptenamecase"/>
583 <xsl:template name=
"ww8foptegetvalue">
585 WW8Value::Pointer_t WW8FOPTE::get_value()
587 WW8Value::Pointer_t pResult;
591 <xsl:for-each select=
".//UML:Class[./UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']">
592 <xsl:variable name=
"type">
593 <xsl:for-each select=
"./UML:ModelElement.taggedValue/UML:TaggedValue[./UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='type']">
594 <xsl:value-of select=
"UML:TaggedValue.dataValue"/>
597 <xsl:if test=
"$type != 'unknown'">
598 <xsl:variable name=
"typetype">
599 <xsl:call-template name=
"typetype">
600 <xsl:with-param name=
"type" select=
"$type"/>
603 <xsl:variable name=
"valuetype">
604 <xsl:call-template name=
"valuetype">
605 <xsl:with-param name=
"type" select=
"$type"/>
610 <xsl:for-each select=
"./UML:ModelElement.taggedValue/UML:TaggedValue[./UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='dffid']">
611 <xsl:value-of select=
"UML:TaggedValue.dataValue"/>
613 <xsl:variable name=
"optname">
614 <xsl:for-each select=
"./UML:ModelElement.taggedValue/UML:TaggedValue[./UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='optname']">
615 <xsl:value-of select=
"UML:TaggedValue.dataValue"/>
618 <xsl:call-template name=
"idtoqname">
619 <xsl:with-param name=
"id" select=
"$optname"/>
621 <xsl:text>:
</xsl:text>
623 <xsl:when test=
"./UML:ModelElement.taggedValue/UML:TaggedValue[./UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='isbool']">
625 pResult = createValue(getU32(
0x2)
& 1);
</xsl:text>
627 <xsl:when test=
"$typetype='complex'">
629 pResult = createValue(new
</xsl:text>
630 <xsl:value-of select=
"$valuetype"/>
631 <xsl:text>(getU32(
0x2)));
</xsl:text>
633 <xsl:when test=
"$typetype='string'">
635 pResult = get_stringValue();

</xsl:text>
639 pResult = createValue(getU32(
0x2));
</xsl:text>
648 pResult = createValue(getU32(
0x2));
657 <xsl:template match='UML:Model/UML:Namespace.ownedElement' mode='ww8foptename'
>
659 OUString WW8FOPTE::get_name()
661 return getDffOptName(get_pid());
663 <xsl:call-template name=
"getdffoptname"/>
666 WW8Value::Pointer_t WW8FOPTE::get_stringValue()
668 WW8Value::Pointer_t pResult;
669 DffOPT * pOpt = dynamic_cast
< DffOPT *
>(mpParent);
670 sal_uInt32 nExtraOffset = pOpt-
>get_extraoffset(mnIndex);
671 sal_uInt32 nExtraLength = pOpt-
>get_extraoffset(mnIndex +
1) - nExtraOffset;
672 pResult = createValue(mpParent-
>getString(nExtraOffset, nExtraLength /
2));
677 <xsl:call-template name=
"ww8foptegetvalue"/>
680 <xsl:template match=
"UML:Model" mode=
"createdffrecord">
682 DffRecord * createDffRecord
683 (WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 * pCount)
685 DffRecord * pResult = NULL;
686 DffRecord aTmpRec(pParent, nOffset,
8);
687 sal_uInt32 nSize = aTmpRec.calcSize();
692 switch (aTmpRec.getRecordType())
694 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.
idref=
"dffrecord"]'
>
695 <xsl:text> case
</xsl:text>
696 <xsl:value-of select=
".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref='dffid']//UML:TaggedValue.dataValue"/>
698 pResult = new Dff
</xsl:text>
699 <xsl:value-of select=
"@name"/>
700 <xsl:text>(pParent, nOffset, nSize);
702 break;

</xsl:text>
706 pResult = new DffRecord(pParent, nOffset, nSize);
714 DffRecord * createDffRecord
715 (WW8Stream
& rStream, sal_uInt32 nOffset, sal_uInt32 * pCount)
717 DffRecord * pResult = NULL;
718 DffRecord aTmpRec(rStream, nOffset,
8);
719 sal_uInt32 nSize = aTmpRec.calcSize();
724 switch (aTmpRec.getRecordType())
726 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.
idref=
"dffrecord"]'
>
727 <xsl:text> case
</xsl:text>
728 <xsl:value-of select=
".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref='dffid']//UML:TaggedValue.dataValue"/>
730 pResult = new Dff
</xsl:text>
731 <xsl:value-of select=
"@name"/>
732 <xsl:text>(rStream, nOffset, nSize);
734 break;

</xsl:text>
738 pResult = new DffRecord(rStream, nOffset, nSize);
748 <xsl:template match=
"UML:Attribute" mode=
"initmembers">
749 <xsl:variable name=
"stereotype"><xsl:value-of select=
".//UML:Stereotype/@xmi.idref"/></xsl:variable>
750 <xsl:variable name=
"offset_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"offset"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
751 <xsl:variable name=
"offset">
752 <xsl:if test='$offset_ !=
"" and not(starts-with($offset_,
"0x"))'
>0x
</xsl:if>
753 <xsl:value-of select='$offset_'
/>
755 <xsl:variable name=
"shift"><xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"shift"]/UML:TaggedValue.dataValue'
/></xsl:variable>
756 <xsl:variable name=
"mask_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"mask"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
757 <xsl:variable name=
"mask">
758 <xsl:if test='$mask_ !=
"" and not(starts-with($mask_,
"0x"))'
>0x
</xsl:if>
759 <xsl:value-of select='$mask_'
/>
761 <xsl:variable name=
"type"><xsl:value-of select='.//UML:DataType/@xmi.idref'
/></xsl:variable><xsl:variable name=
"saltype">
762 <xsl:call-template name='saltype'
>
763 <xsl:with-param name='type'
>
764 <xsl:value-of select='$type'
/>
770 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"comment"]/UML:TaggedValue.dataValue'
/>
772 Name:
<xsl:value-of select='@name'
/>(
<xsl:value-of select='$stereotype'
/>)
773 Offset:
<xsl:value-of select='$offset'
/>
774 Mask:
<xsl:value-of select='$mask'
/>
775 Shift:
<xsl:value-of select='$shift'
/>
779 <xsl:when test='$stereotype =
"attribute"'
>
780 m
<xsl:value-of select='@name'
/> = (get
<xsl:value-of select=
"$type"/>(
<xsl:value-of select=
"$offset"/>)
<xsl:if test=
"string-length($mask)>0"> & <xsl:value-of select=
"$mask"/></xsl:if>)
<xsl:if test=
"$shift>0"> >> <xsl:value-of select=
"$shift"/></xsl:if>;
782 <xsl:when test='$stereotype =
"array"'
>
785 sal_uInt32 nCount =
</xsl:text>
786 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref =
"arraycount"]/UML:TaggedValue.dataValue'
/>
789 <xsl:value-of select='@name'
/>
790 <xsl:text> = new
</xsl:text><xsl:value-of select='$saltype'
/><xsl:text>[nCount];
792 for (sal_uInt32 n =
0; n
< nCount; ++n)
793 m
</xsl:text><xsl:value-of select='@name'
/><xsl:text>[n] = get
</xsl:text>
794 <xsl:value-of select='$type'
/>
795 <xsl:text>(
</xsl:text>
796 <xsl:value-of select='$offset'
/>
797 <xsl:text> + nIndex * sizeof(
</xsl:text>
798 <xsl:value-of select='$saltype'
/>
803 <xsl:when test='$stereotype =
"string"'
>
804 m
<xsl:value-of select='@name'
/> = getString(
<xsl:value-of select='$offset'
/>)
809 <xsl:template match=
"UML:Model" mode=
"isbooleandffopt">
811 bool isBooleanDffOpt(sal_uInt32 nId)
813 bool bResult = false;
817 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.
idref=
"dffopt"]'
>
818 <xsl:if test=
".//UML:TagDefinition[@xmi.idref='isbool']">
819 <xsl:text> case
</xsl:text>
820 <xsl:variable name=
"optname">
821 <xsl:value-of select=
".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref='optname']//UML:TaggedValue.dataValue"/>
823 <xsl:call-template name=
"idtoqname">
824 <xsl:with-param name=
"id" select=
"$optname"/>
826 <xsl:text>:

</xsl:text>