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:template match=
"/">
23 <out xml:
space=
"preserve">
26 * This file is part of the LibreOffice project.
28 * This Source Code Form is subject to the terms of the Mozilla Public
29 * License, v.
2.0. If a copy of the MPL was not distributed with this
30 * file, You can obtain one at http://mozilla.org/MPL/
2.0/.
32 * This file incorporates work covered by the following license notice:
34 * Licensed to the Apache Software Foundation (ASF) under one or more
35 * contributor license agreements. See the NOTICE file distributed
36 * with this work for additional information regarding copyright
37 * ownership. The ASF licenses this file to you under the Apache
38 * License, Version
2.0 (the
"License"); you may not use this file
39 * except in compliance with the License. You may obtain a copy of
40 * the License at http://www.apache.org/licenses/LICENSE-
2.0 .
43 THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
45 #ifndef INCLUDED_RESOURCES_HXX
46 #define INCLUDED_RESOURCES_HXX
48 #include
<vector
>
49 #include
<boost/shared_ptr.hpp
>
51 #include
<resourcemodel/OutputWithDepth.hxx
>
53 #include
<doctok/resourceids.hxx
>
54 #include
<doctok/WW8StructBase.hxx
>
55 #include
<doctok/WW8ResourceModelImpl.hxx
>
56 #include
<doctok/WW8PropertySetImpl.hxx
>
57 #include
<doctok/Dff.hxx
>
59 namespace writerfilter {
62 class WW8DocumentImpl;
63 typedef const WW8DocumentImpl * WW8DocumentImplPointer;
65 using namespace ::std;

</xsl:text>
66 <xsl:apply-templates select=
"//UML:Class" mode=
"class"/>
68 OUString getDffOptName(sal_uInt32 nPid);
69 bool isBooleanDffOpt(sal_uInt32 nId);
71 #endif // INCLUDED_RESOURCES_HXX

</xsl:text></out>
74 <xsl:template match=
"UML:Class" mode=
"class">
76 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8resource"]'
>
77 <xsl:apply-templates select=
"." mode=
"ww8resource"/>
79 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"dffrecord"]'
>
80 <xsl:apply-templates select=
"." mode=
"dffrecord"/>
82 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"dffopt"]'
>
83 <xsl:apply-templates select=
"." mode=
"dffopt"/>
88 <xsl:template match=
"UML:Class" mode=
"ww8resource">
89 <xsl:variable name=
"parentresource">
90 <xsl:call-template name='parenttype'
>
91 <xsl:with-param name='type'
><xsl:value-of select='@xmi.id'
/></xsl:with-param>
94 <xsl:variable name='size_'
><xsl:value-of select='./*/UML:TaggedValue[./*/UML:TagDefinition/@xmi.
idref=
"size"]/UML:TaggedValue.dataValue'
/></xsl:variable>
95 <xsl:variable name='size'
>
97 <xsl:when test='$size_ !=
""'
><xsl:value-of select='$size_'
/></xsl:when>
98 <xsl:otherwise>0</xsl:otherwise>
101 <xsl:variable name=
"classname">WW8
<xsl:value-of select=
"@name"/></xsl:variable>
102 <xsl:variable name=
"superclass">
104 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
105 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
108 <xsl:variable name=
"surroundclass">
110 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
111 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
116 Automatically generated class:
</xsl:text><xsl:value-of select=
"@name"/><xsl:text>
118 <xsl:for-each select='./UML:ModelElement.stereotype/UML:Stereotype'
>
120 Stereotype
</xsl:text>
121 <xsl:value-of select='@xmi.idref'
/>
122 <xsl:text>
</xsl:text>
125 Parent Resource:
</xsl:text>
126 <xsl:value-of select=
"$parentresource"/>
128 Size:
</xsl:text><xsl:value-of select='$size'
/>
132 <xsl:value-of select=
"$classname"/>
133 <xsl:text>: public
</xsl:text>
134 <xsl:value-of select='$superclass'
/>
135 <xsl:if test='$parentresource !=
""'
>
136 <xsl:text>, public writerfilter::Reference
< </xsl:text>
137 <xsl:value-of select='$parentresource'
/>
138 <xsl:text>></xsl:text>
142 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
143 <xsl:text> sal_uInt32 mnIndex;
</xsl:text>
145 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withmembers"]'
>
146 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
147 <xsl:apply-templates select='.' mode='declmembers'
/>
150 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"needsdocument"]'
>
151 <xsl:text> WW8DocumentImplPointer mpDoc;

</xsl:text>
153 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
155 sal_uInt32 mnPlcfPayloadOffset;
156 vector
<sal_uInt32
> entryOffsets;
157 vector
<sal_uInt32
> payloadOffsets;
158 vector
<sal_uInt32
> payloadIndices;
163 typedef boost::shared_ptr
<</xsl:text>
164 <xsl:value-of select='$classname'
/>
165 <xsl:text>> Pointer_t;
168 <xsl:value-of select=
"$classname"/>
170 WW8Stream
& rStream,
171 sal_uInt32 nOffset =
0,
172 sal_uInt32 nCount =
</xsl:text>
173 <xsl:value-of select='$size'
/>
175 :
</xsl:text><xsl:value-of select='$superclass'
/>
176 <xsl:text>(rStream, nOffset, nCount)
</xsl:text>
177 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
178 <xsl:text>, mnIndex(
0)
</xsl:text>
185 <xsl:value-of select=
"$classname"/>
187 WW8StructBase * pParent,
188 sal_uInt32 nOffset =
0,
189 sal_uInt32 nCount =
</xsl:text>
190 <xsl:value-of select='$size'
/>
193 <xsl:value-of select='$superclass'
/>
194 <xsl:text>(pParent, nOffset, nCount)
</xsl:text>
195 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
196 <xsl:text>, mnIndex(
0)
</xsl:text>
202 <xsl:value-of select=
"$classname"/>
203 <xsl:text>( const
</xsl:text>
204 <xsl:value-of select='$surroundclass'
/>
205 <xsl:text>& rSurround,
206 sal_uInt32 nOffset =
0, sal_uInt32 nCount =
</xsl:text>
207 <xsl:value-of select='$size'
/>)
210 <xsl:value-of select='$superclass'
/>
211 <xsl:text>(rSurround, nOffset, nCount)
</xsl:text>
212 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
213 <xsl:text>, mnIndex(
0)
</xsl:text>
220 <xsl:value-of select=
"$classname"/>
223 rSequence, sal_uInt32 nOffset =
0,
224 sal_uInt32 nCount =
</xsl:text>
225 <xsl:value-of select='$size'
/>
228 <xsl:value-of select='$superclass'
/>
229 <xsl:text>(rSequence, nOffset, nCount)
</xsl:text>
230 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
231 <xsl:text>, mnIndex(
0)
</xsl:text>
239 <xsl:value-of select=
"$classname"/>
240 <xsl:text>();

</xsl:text>
241 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"initimpl"]'
>
242 <xsl:text> void initImpl();

</xsl:text>
244 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
245 <xsl:text> void initPayload();
</xsl:text>
251 Return type of resource.
253 virtual string getType() const
256 <xsl:value-of select="@name
"/>
263 static sal_uInt32 getSize() { return
</xsl:text>
264 <xsl:value-of select='$size'
/>
265 <xsl:text>; }
</xsl:text>
266 <xsl:if test=
"not(.//UML:Stereotype[@xmi.ref='ww8nocalcsize'])">
269 Calculate actual size.
271 sal_uInt32 calcSize();
274 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
277 Return offset for entry of PLCF.
279 @param nIndex index of entry
281 sal_uInt32 getEntryOffset(sal_uInt32 nIndex)
283 return entryOffsets[nIndex];
285 <xsl:if test=
"not(.//UML:Stereotype[@xmi.idref='ww8nopayloadoffset'])">
288 Calculate offset for payload.
290 sal_uInt32 calcPayloadOffset();
</xsl:text>
294 Set offset for payloads.
296 @param nOffset the offset to set
298 void setPayloadOffset(sal_uInt32 nOffset)
300 mnPlcfPayloadOffset = nOffset;
304 Return offset for payload of PLCF.
306 @param nIndex index of entry
308 sal_uInt32 getPayloadOffset(sal_uInt32 nIndex)
310 return payloadOffsets[nIndex];
314 Return size of payload.
316 sal_uInt32 getPayloadSize(sal_uInt32 nIndex) const
318 return payloadOffsets[nIndex +
1] - payloadOffsets[nIndex];
323 Return payload index of an entry.
326 sal_uInt32 getPayloadIndex(sal_uInt32 nIndex)
328 return payloadIndices[nIndex];
332 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
337 @param nIndex the index
339 void setIndex(sal_uInt32 nIndex) { mnIndex = nIndex; }
342 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>
343 <xsl:variable name='propsreftype'
>writerfilter::Reference
< Properties
>::Pointer_t
</xsl:variable>
345 Return reference to properties of Sprm.
348 <xsl:value-of select='$propsreftype'
/>
349 <xsl:text> getProps()
352 <xsl:value-of select='$propsreftype'
/>
353 <xsl:text> (new
</xsl:text>
354 <xsl:value-of select='$classname'
/>
360 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"ww8sprmbinary"]'
>
362 virtual writerfilter::Reference
< BinaryObj
> ::Pointer_t getBinary();
366 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"needsdocument"]'
>
368 void setDoc(WW8DocumentImplPointer pDoc)
374 <xsl:apply-templates select=
"." mode=
"declsProperties"/>
375 <xsl:if test='$
parentresource=
"Table"'
>
376 <xsl:apply-templates select=
"." mode=
"declsTable"/>
379 <xsl:when test='$
parentresource=
"Properties"'
>
380 <xsl:apply-templates select=
"." mode=
"resolveProperties"/>
382 <xsl:when test='$
parentresource=
"Table"'
>
383 <xsl:apply-templates select=
"." mode=
"resolveTable"/>
391 <xsl:template match='UML:Class' mode='declsProperties'
>
393 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"withmembers"]'
>
394 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
395 <xsl:apply-templates select='.' mode='accessmembers'
/>
399 <xsl:variable name=
"debug">
401 <xsl:when test='.//UML:Stereotype[@xmi.
idref=
"debug"]'
>
402 <xsl:text>true
</xsl:text>
405 <xsl:text>false
</xsl:text>
409 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
410 <xsl:apply-templates select='.' mode='access'
>
411 <xsl:with-param name=
"debug">
412 <xsl:value-of select=
"$debug"/>
414 </xsl:apply-templates>
418 <xsl:for-each select='.//UML:Operation[@name!=
"reserved"]'
>
419 <xsl:apply-templates select='.' mode='declsOperations'
/>
423 <xsl:template match=
"UML:Class" mode=
"resolveProperties">
424 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
425 void resolveNoAuto(Properties
& rHandler);
428 void dump(OutputWithDepth
< string
> & o) const;
430 void resolve(Properties
& rHandler);
433 <xsl:template match=
"UML:Class" mode=
"declsTable">
434 sal_uInt32 getEntryCount();
435 writerfilter::Reference
< Properties
>::Pointer_t getEntry(sal_uInt32 nIndex);
438 <xsl:template match=
"UML:Class" mode=
"resolveTable">
439 void resolve(Table
& rHandler);
442 <xsl:template match=
"UML:Attribute" mode=
"access">
443 <xsl:param name=
"debug"/>
444 <xsl:variable name=
"stereotype"><xsl:value-of select=
".//UML:Stereotype[1]/@xmi.idref"/></xsl:variable>
445 <xsl:variable name=
"offset_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"offset"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
446 <xsl:variable name=
"offset">
447 <xsl:value-of select='$offset_'
/>
449 <xsl:variable name=
"shift"><xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"shift"]/UML:TaggedValue.dataValue'
/></xsl:variable>
450 <xsl:variable name=
"mask_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"mask"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
451 <xsl:variable name=
"mask">
452 <xsl:if test='$mask_ !=
"" and not(starts-with($mask_,
"0x"))'
>0x
</xsl:if>
453 <xsl:value-of select='$mask_'
/>
455 <xsl:variable name='type'
>
456 <xsl:value-of select=
"UML:StructuralFeature.type/UML:DataType/@xmi.idref"/>
458 <xsl:variable name=
"completetype">
459 <xsl:text>WW8
</xsl:text>
460 <xsl:value-of select=
"$type"/>
462 <xsl:variable name=
"saltype">
463 <xsl:apply-templates select=
"." mode=
"returntype"/>
465 <xsl:variable name='typetype'
>
466 <xsl:call-template name='typetype'
>
467 <xsl:with-param name='type'
><xsl:value-of select=
"$type"/></xsl:with-param>
472 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"comment"]/UML:TaggedValue.dataValue'
/>
480 <xsl:value-of select='@name'
/>(
<xsl:value-of select='$stereotype'
/>)
488 <xsl:value-of select='$offset'
/>
496 <xsl:value-of select='$mask'
/>
504 <xsl:value-of select='$shift'
/>
511 <xsl:when test='$stereotype =
"attribute"'
>
512 <xsl:if test='././/UML:Stereotype[@xmi.
idref=
"virtual"]'
>
513 <xsl:text>virtual
</xsl:text>
515 <xsl:value-of select='$saltype'
/> get_
<xsl:value-of select='@name'
/>() const
517 <xsl:if test='$
debug=
"true"'
>
519 clog
<< "<called></xsl:text>
520 <xsl:value-of select="@name
"/>
521 <xsl:text></called>"
526 <xsl:when test='././/UML:Stereotype[@xmi.
idref=
"attributeremainder"]'
>
527 <xsl:text>return writerfilter::Reference
< BinaryObj
>::Pointer_t(new WW8BinaryObjReference(getRemainder(
</xsl:text>
528 <xsl:value-of select=
"$offset"/>
529 <xsl:text>)));

</xsl:text>
533 <xsl:when test='$typetype =
"complex"'
>
534 <xsl:text> return
</xsl:text>
535 <xsl:value-of select=
"$saltype"/>
536 <xsl:text>(new
</xsl:text>
537 <xsl:value-of select=
"$completetype"/>
538 <xsl:text>(*this,
</xsl:text>
539 <xsl:value-of select=
"$offset"/>
540 <xsl:text>));

</xsl:text>
543 <xsl:text> return (get
</xsl:text>
544 <xsl:value-of select=
"$type"/>
545 <xsl:text>(
</xsl:text>
546 <xsl:value-of select=
"$offset"/>
547 <xsl:text>)
</xsl:text>
548 <xsl:if test=
"string-length($mask)>0">
549 <xsl:text>& </xsl:text>
550 <xsl:value-of select=
"$mask"/>
552 <xsl:text>)
</xsl:text>
553 <xsl:if test=
"$shift>0">
554 <xsl:text>>> </xsl:text>
555 <xsl:value-of select=
"$shift"/>
557 <xsl:text>;
</xsl:text>
564 <xsl:when test='$stereotype =
"array"'
>
565 <xsl:text>sal_uInt32 get_
</xsl:text>
566 <xsl:value-of select='@name'
/>
567 <xsl:text>_count() const
</xsl:text>
569 <xsl:when test='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref =
"arraycount"]'
>
570 <xsl:text>{ return
</xsl:text>
571 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref =
"arraycount"]/UML:TaggedValue.dataValue'
/>
572 <xsl:text>; }

</xsl:text>
575 <xsl:text>;

</xsl:text>
578 <xsl:value-of select='$saltype'
/>
579 <xsl:text> get_
</xsl:text>
580 <xsl:value-of select='@name'
/>
581 <xsl:text>(sal_uInt32 nIndex) const {
</xsl:text>
583 <xsl:when test=
"$typetype='complex'">
584 <xsl:text> return
</xsl:text>
585 <xsl:value-of select=
"$saltype"/>
586 <xsl:text>( new
</xsl:text>
587 <xsl:value-of select=
"$completetype"/>
588 <xsl:text>(static_cast
<const WW8StructBase
>(*this),
</xsl:text>
589 <xsl:value-of select=
"$offset"/>
590 <xsl:text> + nIndex *
</xsl:text>
591 <xsl:value-of select=
"$completetype"/>
592 <xsl:text>::getSize()));
</xsl:text>
595 <xsl:text> return get
</xsl:text>
596 <xsl:value-of select='$type'
/>
597 <xsl:text>(
</xsl:text><xsl:value-of select='$offset'
/>
598 <xsl:text> + nIndex * sizeof(
</xsl:text>
599 <xsl:value-of select='$saltype'
/>
600 <xsl:text>))
</xsl:text>
603 <xsl:text>; }

</xsl:text>
605 <xsl:when test='$stereotype =
"string"'
>
606 OUString get_
<xsl:value-of select='@name'
/>() const { return getString(
<xsl:value-of select='$offset'
/>); }
611 <xsl:template match='UML:Attribute' mode='accessmembers'
>
612 <xsl:text> </xsl:text>
613 <xsl:call-template name='saltype'
>
614 <xsl:with-param name='type'
>
615 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
618 <xsl:text> get_
</xsl:text>
619 <xsl:value-of select='@name'
/>
620 <xsl:text>() const { return m
</xsl:text>
621 <xsl:value-of select='@name'
/>
627 <xsl:template match=
"UML:Operation" mode=
"declsOperations">
629 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"array"'
>
630 <xsl:variable name=
"elementtype">
631 <xsl:value-of select='.//UML:Parameter.type/UML:Class/@xmi.idref'
/>
633 <xsl:variable name=
"parentclass">
634 <xsl:call-template name='parenttype'
>
635 <xsl:with-param name='type'
>
636 <xsl:value-of select='$elementtype'
/>
640 <xsl:variable name='saltype'
>
641 <xsl:call-template name='saltype'
>
642 <xsl:with-param name='type'
>
643 <xsl:value-of select='$elementtype'
/>
645 <xsl:with-param name='parenttype'
>
646 <xsl:value-of select='$parentclass'
/>
651 Array:
<xsl:value-of select=
"@name"/>
652 ElementType:
<xsl:value-of select=
"$elementtype"/>(
<xsl:value-of select=
"$parentclass"/>)
655 sal_uInt32 get_
<xsl:value-of select=
"@name"/>_count();
657 <xsl:text> </xsl:text><xsl:value-of select='$saltype'
/> get_
<xsl:value-of select=
"@name"/>(sal_uInt32 pos);
659 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"attribute" or .//UML:Stereotype/@xmi.idref =
"binary"'
>
660 <xsl:variable name=
"returntype_">
661 <xsl:value-of select='.//UML:Parameter.type/UML:Class/@xmi.idref'
/>
663 <xsl:variable name=
"returntype">
664 <xsl:call-template name='saltype'
>
665 <xsl:with-param name='type'
>
666 <xsl:value-of select='$returntype_'
/>
668 <xsl:with-param name='parenttype'
>
669 <xsl:call-template name='parenttype'
>
670 <xsl:with-param name='type'
>
671 <xsl:value-of select='$returntype_'
/>
678 Operation:
<xsl:value-of select=
"@name"/>
681 <xsl:text> </xsl:text>
682 <xsl:value-of select='$returntype'
/>
683 <xsl:text> get_
</xsl:text>
684 <xsl:value-of select='@name'
/>
685 <xsl:text>();

</xsl:text>
690 <xsl:template match=
"UML:Attribute" mode='declmembers'
>
691 <xsl:text> </xsl:text>
692 <xsl:call-template name='saltype'
>
693 <xsl:with-param name='type'
>
694 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
697 <xsl:text> m
</xsl:text>
698 <xsl:value-of select=
"@name"/>
703 <xsl:template name='idtoqname'
>
704 <xsl:param name='id'
/>NS_
<xsl:value-of select='substring-before($id,
":")'
/>::LN_
<xsl:value-of select='substring-after($id,
":")'
/>
707 <xsl:template name='saltype'
>
708 <xsl:param name='type'
/>
709 <xsl:param name='parenttype'
/>
711 <xsl:when test=
"$type='U8'">sal_uInt8
</xsl:when>
712 <xsl:when test=
"$type='S8'">sal_Int8
</xsl:when>
713 <xsl:when test=
"$type='U16'">sal_uInt16
</xsl:when>
714 <xsl:when test=
"$type='S16'">sal_Int16
</xsl:when>
715 <xsl:when test=
"$type='U32'">sal_uInt32
</xsl:when>
716 <xsl:when test=
"$type='S32'">sal_Int32
</xsl:when>
717 <xsl:when test=
"$type='String'">OUString
</xsl:when>
718 <xsl:when test=
"$type='Value'">WW8Value::Pointer_t
</xsl:when>
719 <xsl:when test=
"$type='Binary'">WW8BinaryObjReference::Pointer_t
</xsl:when>
720 <xsl:when test=
"$parenttype=''">
721 <xsl:value-of select=
"$type"/>
724 <xsl:text>writerfilter::Reference
< </xsl:text>
725 <xsl:value-of select='$parenttype'
/>
726 <xsl:text> >::Pointer_t
</xsl:text>
731 <xsl:template name='typetype'
>
732 <xsl:param name='type'
/><xsl:choose>
733 <xsl:when test=
"$type='U8'">simple
</xsl:when>
734 <xsl:when test=
"$type='S8'">simple
</xsl:when>
735 <xsl:when test=
"$type='U16'">simple
</xsl:when>
736 <xsl:when test=
"$type='S16'">simple
</xsl:when>
737 <xsl:when test=
"$type='U32'">simple
</xsl:when>
738 <xsl:when test=
"$type='S32'">simple
</xsl:when>
739 <xsl:when test=
"$type='String'">string
</xsl:when>
740 <xsl:when test=
"$type='Value'">value
</xsl:when>
741 <xsl:otherwise>complex
</xsl:otherwise>
745 <xsl:template match=
"UML:Attribute" mode=
"valuetype">
746 <xsl:variable name='type'
>
747 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
750 <xsl:when test='$
type=
"U8"'
>WW8IntValue
</xsl:when>
751 <xsl:when test='$
type=
"S8"'
>WW8IntValue
</xsl:when>
752 <xsl:when test='$
type=
"U16"'
>WW8IntValue
</xsl:when>
753 <xsl:when test='$
type=
"S16"'
>WW8IntValue
</xsl:when>
754 <xsl:when test='$
type=
"U32"'
>WW8IntValue
</xsl:when>
755 <xsl:when test='$
type=
"S32"'
>WW8IntValue
</xsl:when>
756 <xsl:otherwise>WW8PropertiesValue
</xsl:otherwise>
760 <xsl:template match=
"UML:Class" mode=
"dffrecord">
761 <xsl:variable name=
"classname">
762 <xsl:text>Dff
</xsl:text><xsl:value-of select=
"@name"/>
766 Automaticallay generated class:
768 <xsl:value-of select=
"$classname"/>
772 <xsl:value-of select=
"$classname"/>
773 <xsl:text> : public DffRecord
776 typedef boost::shared_ptr
< </xsl:text>
777 <xsl:value-of select=
"$classname"/>
778 <xsl:text> > Pointer_t;


780 <xsl:value-of select=
"$classname"/>
781 <xsl:text>(WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 nCount)


782 : DffRecord(pParent, nOffset, nCount) {}


784 <xsl:value-of select=
"$classname"/>
785 <xsl:text>(WW8Stream
& rStream, sal_uInt32 nOffset, sal_uInt32 nCount)


786 : DffRecord(rStream, nOffset, nCount) {}


788 <xsl:value-of select=
"$classname"/>
789 <xsl:text>(DffRecord
& rRecord)


790 : DffRecord(rRecord) {}
792 <xsl:value-of select=
"$classname"/>
795 virtual void resolveLocal(Properties
& props);
</xsl:text>
796 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
797 void resolveNoAuto(Properties
& rHandler);
800 virtual void dump(OutputWithDepth
< string
> & o) const;
802 virtual DffRecord * clone() const { return new
</xsl:text>
803 <xsl:value-of select=
"$classname"/>
804 <xsl:text>(*this); }


805 virtual string getType() const
808 <xsl:value-of select="$classname
"/>
812 virtual string getName() const { return
""; }
814 <xsl:apply-templates select=
"." mode=
"declsProperties"/>
821 <xsl:template match=
"UML:Class" mode=
"dffopt">
823 <xsl:variable name="classname">
824 <xsl:text>DffOpt</xsl:text><xsl:value-of select="@name"/>
828 Automaticallay generated class:
830 <xsl:value-of select="$classname"/>
834 <xsl:value-of select="$classname"/>
835 <xsl:text> : public WW8FOPTE
838 <xsl:value-of select="$classname"/>
839 <xsl:text>(WW8FOPTE & rOpt) : WW8FOPTE(rOpt) {}
841 virtual string getName() const
844 <xsl:value-of select="@name"/>
854 <xsl:template name=
"parenttype">
855 <xsl:param name='type'
/>
856 <xsl:for-each select='/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$type]'
>
857 <xsl:value-of select='./UML:Generalization.parent/UML:Class/@xmi.idref'
/>
861 <xsl:template match=
"UML:Attribute" mode=
"returntype">
862 <xsl:variable name='type'
>
863 <xsl:value-of select=
"UML:StructuralFeature.type/UML:DataType/@xmi.idref"/>
865 <xsl:call-template name='saltype'
>
866 <xsl:with-param name='type'
>
867 <xsl:value-of select=
"$type"/>
869 <xsl:with-param name='parenttype'
>
870 <xsl:call-template name='parenttype'
>
871 <xsl:with-param name='type'
><xsl:value-of select='$type'
/></xsl:with-param>