2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2008 by Sun Microsystems, Inc.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * $RCSfile: resources.xsl,v $
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 ************************************************************************/
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 <xsl:template match=
"/">
39 <out xml:
space=
"preserve">
41 /*************************************************************************
43 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45 * Copyright
2008 by Sun Microsystems, Inc.
47 * OpenOffice.org - a multi-platform office productivity suite
49 * $RCSfile: resources.xsl,v $
53 * This file is part of OpenOffice.org.
55 * OpenOffice.org is free software: you can redistribute it and/or modify
56 * it under the terms of the GNU Lesser General Public License version
3
57 * only, as published by the Free Software Foundation.
59 * OpenOffice.org is distributed in the hope that it will be useful,
60 * but WITHOUT ANY WARRANTY; without even the implied warranty of
61 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 * GNU Lesser General Public License version
3 for more details
63 * (a copy is included in the LICENSE file that accompanied this code).
65 * You should have received a copy of the GNU Lesser General Public License
66 * version
3 along with OpenOffice.org. If not, see
67 * http://www.openoffice.org/license.html
68 * for a copy of the LGPLv3 License.
70 ************************************************************************/
73 THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
76 #ifndef INCLUDED_RESOURCES_HXX
77 #define INCLUDED_RESOURCES_HXX
79 #include
<vector
>
80 #include
<boost/shared_ptr.hpp
>
82 #ifndef INCLUDED_OUTPUT_WITH_DEPTH_HXX
83 #include
<resourcemodel/OutputWithDepth.hxx
>
86 #ifndef INCLUDED_RESOURCESIDS_HXX
87 #include
<doctok/resourceids.hxx
>
90 #ifndef INCLUDED_WW8_STRUCT_BASE_HXX
91 #include
<WW8StructBase.hxx
>
94 #ifndef INCLUDED_WW8_RESOURCE_MODEL_IMPL_HXX
95 #include
<WW8ResourceModelImpl.hxx
>
98 #ifndef INCLUDED_WW8_PROPERTY_SET_IMPL_HXX
99 #include
<WW8PropertySetImpl.hxx
>
102 #ifndef INCLUDED_DFF_HXX
103 #include
<Dff.hxx
>
106 namespace writerfilter {
109 class WW8DocumentImpl;
110 typedef const WW8DocumentImpl * WW8DocumentImplPointer;
112 using namespace ::std;

</xsl:text>
113 <xsl:apply-templates select=
"//UML:Class" mode=
"class"/>
115 rtl::OUString getDffOptName(sal_uInt32 nPid);
116 bool isBooleanDffOpt(sal_uInt32 nId);
118 #endif // INCLUDED_RESOURCES_HXX

</xsl:text></out>
121 <xsl:template match=
"UML:Class" mode=
"class">
123 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8resource"]'
>
124 <xsl:apply-templates select=
"." mode=
"ww8resource"/>
126 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"dffrecord"]'
>
127 <xsl:apply-templates select=
"." mode=
"dffrecord"/>
129 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"dffopt"]'
>
130 <xsl:apply-templates select=
"." mode=
"dffopt"/>
135 <xsl:template match=
"UML:Class" mode=
"ww8resource">
136 <xsl:variable name=
"parentresource">
137 <xsl:call-template name='parenttype'
>
138 <xsl:with-param name='type'
><xsl:value-of select='@xmi.id'
/></xsl:with-param>
141 <xsl:variable name='size_'
><xsl:value-of select='./*/UML:TaggedValue[./*/UML:TagDefinition/@xmi.
idref=
"size"]/UML:TaggedValue.dataValue'
/></xsl:variable>
142 <xsl:variable name='size'
>
144 <xsl:when test='$size_ !=
""'
><xsl:value-of select='$size_'
/></xsl:when>
145 <xsl:otherwise>0</xsl:otherwise>
148 <xsl:variable name=
"classname">WW8
<xsl:value-of select=
"@name"/></xsl:variable>
149 <xsl:variable name=
"superclass">
151 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
152 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
155 <xsl:variable name=
"surroundclass">
157 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>WW8PropertyImpl
</xsl:when>
158 <xsl:otherwise>WW8StructBase
</xsl:otherwise>
163 Automatically generated class:
</xsl:text><xsl:value-of select=
"@name"/><xsl:text>
165 <xsl:for-each select='./UML:ModelElement.stereotype/UML:Stereotype'
>
167 Stereotype
</xsl:text>
168 <xsl:value-of select='@xmi.idref'
/>
169 <xsl:text>
</xsl:text>
172 Parent Resource:
</xsl:text>
173 <xsl:value-of select=
"$parentresource"/>
175 Size:
</xsl:text><xsl:value-of select='$size'
/>
179 <xsl:value-of select=
"$classname"/>
180 <xsl:text>: public
</xsl:text>
181 <xsl:value-of select='$superclass'
/>
182 <xsl:if test='$parentresource !=
""'
>
183 <xsl:text>, public writerfilter::Reference
< </xsl:text>
184 <xsl:value-of select='$parentresource'
/>
185 <xsl:text>></xsl:text>
189 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
190 <xsl:text> sal_uInt32 mnIndex;
</xsl:text>
192 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withmembers"]'
>
193 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
194 <xsl:apply-templates select='.' mode='declmembers'
/>
197 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"needsdocument"]'
>
198 <xsl:text> WW8DocumentImplPointer mpDoc;

</xsl:text>
200 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
202 sal_uInt32 mnPlcfPayloadOffset;
203 vector
<sal_uInt32
> entryOffsets;
204 vector
<sal_uInt32
> payloadOffsets;
205 vector
<sal_uInt32
> payloadIndices;
210 typedef boost::shared_ptr
<</xsl:text>
211 <xsl:value-of select='$classname'
/>
212 <xsl:text>> Pointer_t;
215 <xsl:value-of select=
"$classname"/>
217 WW8Stream
& rStream,
218 sal_uInt32 nOffset =
0,
219 sal_uInt32 nCount =
</xsl:text>
220 <xsl:value-of select='$size'
/>
222 :
</xsl:text><xsl:value-of select='$superclass'
/>
223 <xsl:text>(rStream, nOffset, nCount)
</xsl:text>
224 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
225 <xsl:text>, mnIndex(
0)
</xsl:text>
232 <xsl:value-of select=
"$classname"/>
234 WW8StructBase * pParent,
235 sal_uInt32 nOffset =
0,
236 sal_uInt32 nCount =
</xsl:text>
237 <xsl:value-of select='$size'
/>
240 <xsl:value-of select='$superclass'
/>
241 <xsl:text>(pParent, nOffset, nCount)
</xsl:text>
242 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
243 <xsl:text>, mnIndex(
0)
</xsl:text>
249 <xsl:value-of select=
"$classname"/>
250 <xsl:text>( const
</xsl:text>
251 <xsl:value-of select='$surroundclass'
/>
252 <xsl:text>& rSurround,
253 sal_uInt32 nOffset =
0, sal_uInt32 nCount =
</xsl:text>
254 <xsl:value-of select='$size'
/>)
257 <xsl:value-of select='$superclass'
/>
258 <xsl:text>(rSurround, nOffset, nCount)
</xsl:text>
259 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
260 <xsl:text>, mnIndex(
0)
</xsl:text>
267 <xsl:value-of select=
"$classname"/>
270 rSequence, sal_uInt32 nOffset =
0,
271 sal_uInt32 nCount =
</xsl:text>
272 <xsl:value-of select='$size'
/>
275 <xsl:value-of select='$superclass'
/>
276 <xsl:text>(rSequence, nOffset, nCount)
</xsl:text>
277 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
278 <xsl:text>, mnIndex(
0)
</xsl:text>
286 <xsl:value-of select=
"$classname"/>
287 <xsl:text>();

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

</xsl:text>
291 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
292 <xsl:text> void initPayload();
</xsl:text>
298 Return type of resource.
300 virtual string getType() const
303 <xsl:value-of select="@name
"/>
310 static sal_uInt32 getSize() { return
</xsl:text>
311 <xsl:value-of select='$size'
/>
315 Calculate actual size.
317 sal_uInt32 calcSize();
320 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"plcf"]'
>
323 Return offset for entry of PLCF.
325 @param nIndex index of entry
327 sal_uInt32 getEntryOffset(sal_uInt32 nIndex)
329 return entryOffsets[nIndex];
333 Calculate offset for payload.
335 sal_uInt32 calcPayloadOffset();
338 Set offset for payloads.
340 @param nOffset the offset to set
342 void setPayloadOffset(sal_uInt32 nOffset)
344 mnPlcfPayloadOffset = nOffset;
348 Return offset for payload of PLCF.
350 @param nIndex index of entry
352 sal_uInt32 getPayloadOffset(sal_uInt32 nIndex)
354 return payloadOffsets[nIndex];
358 Return size of payload.
360 sal_uInt32 getPayloadSize(sal_uInt32 nIndex) const
362 return payloadOffsets[nIndex +
1] - payloadOffsets[nIndex];
367 Return payload index of an entry.
370 sal_uInt32 getPayloadIndex(sal_uInt32 nIndex)
372 return payloadIndices[nIndex];
376 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"withindex"]'
>
381 @param nIndex the index
383 void setIndex(sal_uInt32 nIndex) { mnIndex = nIndex; }
386 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"ww8sprm"]'
>
387 <xsl:variable name='propsreftype'
>writerfilter::Reference
< Properties
>::Pointer_t
</xsl:variable>
389 Return reference to properties of Sprm.
392 <xsl:value-of select='$propsreftype'
/>
393 <xsl:text> getProps()
396 <xsl:value-of select='$propsreftype'
/>
397 <xsl:text> (new
</xsl:text>
398 <xsl:value-of select='$classname'
/>
404 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"ww8sprmbinary"]'
>
406 virtual writerfilter::Reference
< BinaryObj
> ::Pointer_t getBinary();
410 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"needsdocument"]'
>
412 void setDoc(WW8DocumentImplPointer pDoc)
418 <xsl:apply-templates select=
"." mode=
"declsProperties"/>
419 <xsl:if test='$
parentresource=
"Table"'
>
420 <xsl:apply-templates select=
"." mode=
"declsTable"/>
423 <xsl:when test='$
parentresource=
"Properties"'
>
424 <xsl:apply-templates select=
"." mode=
"resolveProperties"/>
426 <xsl:when test='$
parentresource=
"Table"'
>
427 <xsl:apply-templates select=
"." mode=
"resolveTable"/>
435 <xsl:template match='UML:Class' mode='declsProperties'
>
437 <xsl:when test='.//UML:Stereotype[@xmi.idref =
"withmembers"]'
>
438 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
439 <xsl:apply-templates select='.' mode='accessmembers'
/>
443 <xsl:variable name=
"debug">
445 <xsl:when test='.//UML:Stereotype[@xmi.
idref=
"debug"]'
>
446 <xsl:text>true
</xsl:text>
449 <xsl:text>false
</xsl:text>
453 <xsl:for-each select='.//UML:Attribute[@name!=
"reserved"]'
>
454 <xsl:apply-templates select='.' mode='access'
>
455 <xsl:with-param name=
"debug">
456 <xsl:value-of select=
"$debug"/>
458 </xsl:apply-templates>
462 <xsl:for-each select='.//UML:Operation[@name!=
"reserved"]'
>
463 <xsl:apply-templates select='.' mode='declsOperations'
/>
467 <xsl:template match=
"UML:Class" mode=
"resolveProperties">
468 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
469 void resolveNoAuto(Properties
& rHandler);
472 void dump(OutputWithDepth
< string
> & o) const;
474 void resolve(Properties
& rHandler);
477 <xsl:template match=
"UML:Class" mode=
"declsTable">
478 sal_uInt32 getEntryCount();
479 writerfilter::Reference
< Properties
>::Pointer_t getEntry(sal_uInt32 nIndex);
482 <xsl:template match=
"UML:Class" mode=
"resolveTable">
483 void resolve(Table
& rHandler);
486 <xsl:template match=
"UML:Attribute" mode=
"access">
487 <xsl:param name=
"debug"/>
488 <xsl:variable name=
"stereotype"><xsl:value-of select=
".//UML:Stereotype[1]/@xmi.idref"/></xsl:variable>
489 <xsl:variable name=
"offset_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"offset"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
490 <xsl:variable name=
"offset">
491 <xsl:if test='$offset_ !=
"" and not(starts-with($offset_,
"0x"))'
>0x
</xsl:if>
492 <xsl:value-of select='$offset_'
/>
494 <xsl:variable name=
"shift"><xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"shift"]/UML:TaggedValue.dataValue'
/></xsl:variable>
495 <xsl:variable name=
"mask_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"mask"]/UML:TaggedValue.dataValue,
"ABCDEFX",
"abcdefx")'
/></xsl:variable>
496 <xsl:variable name=
"mask">
497 <xsl:if test='$mask_ !=
"" and not(starts-with($mask_,
"0x"))'
>0x
</xsl:if>
498 <xsl:value-of select='$mask_'
/>
500 <xsl:variable name='type'
>
501 <xsl:value-of select=
"UML:StructuralFeature.type/UML:DataType/@xmi.idref"/>
503 <xsl:variable name=
"completetype">
504 <xsl:text>WW8
</xsl:text>
505 <xsl:value-of select=
"$type"/>
507 <xsl:variable name=
"saltype">
508 <xsl:apply-templates select=
"." mode=
"returntype"/>
510 <xsl:variable name='typetype'
>
511 <xsl:call-template name='typetype'
>
512 <xsl:with-param name='type'
><xsl:value-of select=
"$type"/></xsl:with-param>
517 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.
idref=
"comment"]/UML:TaggedValue.dataValue'
/>
525 <xsl:value-of select='@name'
/>(
<xsl:value-of select='$stereotype'
/>)
533 <xsl:value-of select='$offset'
/>
541 <xsl:value-of select='$mask'
/>
549 <xsl:value-of select='$shift'
/>
556 <xsl:when test='$stereotype =
"attribute"'
>
557 <xsl:if test='././/UML:Stereotype[@xmi.
idref=
"virtual"]'
>
558 <xsl:text>virtual
</xsl:text>
560 <xsl:value-of select='$saltype'
/> get_
<xsl:value-of select='@name'
/>() const
562 <xsl:if test='$
debug=
"true"'
>
564 clog
<< "<called></xsl:text>
565 <xsl:value-of select="@name
"/>
566 <xsl:text></called>"
571 <xsl:when test='././/UML:Stereotype[@xmi.
idref=
"attributeremainder"]'
>
572 <xsl:text>return writerfilter::Reference
< BinaryObj
>::Pointer_t(new WW8BinaryObjReference(getRemainder(
</xsl:text>
573 <xsl:value-of select=
"$offset"/>
574 <xsl:text>)));

</xsl:text>
578 <xsl:when test='$typetype =
"complex"'
>
579 <xsl:text> return
</xsl:text>
580 <xsl:value-of select=
"$saltype"/>
581 <xsl:text>(new
</xsl:text>
582 <xsl:value-of select=
"$completetype"/>
583 <xsl:text>(*this,
</xsl:text>
584 <xsl:value-of select=
"$offset"/>
585 <xsl:text>));

</xsl:text>
588 <xsl:text> return (get
</xsl:text>
589 <xsl:value-of select=
"$type"/>
590 <xsl:text>(
</xsl:text>
591 <xsl:value-of select=
"$offset"/>
592 <xsl:text>)
</xsl:text>
593 <xsl:if test=
"string-length($mask)>0">
594 <xsl:text>& </xsl:text>
595 <xsl:value-of select=
"$mask"/>
597 <xsl:text>)
</xsl:text>
598 <xsl:if test=
"$shift>0">
599 <xsl:text>>> </xsl:text>
600 <xsl:value-of select=
"$shift"/>
602 <xsl:text>;
</xsl:text>
609 <xsl:when test='$stereotype =
"array"'
>
610 <xsl:text>sal_uInt32 get_
</xsl:text>
611 <xsl:value-of select='@name'
/>
612 <xsl:text>_count() const
</xsl:text>
614 <xsl:when test='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref =
"arraycount"]'
>
615 <xsl:text>{ return
</xsl:text>
616 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref =
"arraycount"]/UML:TaggedValue.dataValue'
/>
617 <xsl:text>; }

</xsl:text>
620 <xsl:text>;

</xsl:text>
623 <xsl:value-of select='$saltype'
/>
624 <xsl:text> get_
</xsl:text>
625 <xsl:value-of select='@name'
/>
626 <xsl:text>(sal_uInt32 nIndex) const {
</xsl:text>
628 <xsl:when test=
"$typetype='complex'">
629 <xsl:text> return
</xsl:text>
630 <xsl:value-of select=
"$saltype"/>
631 <xsl:text>( new
</xsl:text>
632 <xsl:value-of select=
"$completetype"/>
633 <xsl:text>(static_cast
<const WW8StructBase
>(*this),
</xsl:text>
634 <xsl:value-of select=
"$offset"/>
635 <xsl:text> + nIndex *
</xsl:text>
636 <xsl:value-of select=
"$completetype"/>
637 <xsl:text>::getSize()));
</xsl:text>
640 <xsl:text> return get
</xsl:text>
641 <xsl:value-of select='$type'
/>
642 <xsl:text>(
</xsl:text><xsl:value-of select='$offset'
/>
643 <xsl:text> + nIndex * sizeof(
</xsl:text>
644 <xsl:value-of select='$saltype'
/>
645 <xsl:text>))
</xsl:text>
648 <xsl:text>; }

</xsl:text>
650 <xsl:when test='$stereotype =
"string"'
>
651 rtl::OUString get_
<xsl:value-of select='@name'
/>() const { return getString(
<xsl:value-of select='$offset'
/>); }
656 <xsl:template match='UML:Attribute' mode='accessmembers'
>
657 <xsl:text> </xsl:text>
658 <xsl:call-template name='saltype'
>
659 <xsl:with-param name='type'
>
660 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
663 <xsl:text> get_
</xsl:text>
664 <xsl:value-of select='@name'
/>
665 <xsl:text>() const { return m
</xsl:text>
666 <xsl:value-of select='@name'
/>
672 <xsl:template match=
"UML:Operation" mode=
"declsOperations">
674 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"array"'
>
675 <xsl:variable name=
"elementtype">
676 <xsl:value-of select='.//UML:Parameter.type/UML:Class/@xmi.idref'
/>
678 <xsl:variable name=
"parentclass">
679 <xsl:call-template name='parenttype'
>
680 <xsl:with-param name='type'
>
681 <xsl:value-of select='$elementtype'
/>
685 <xsl:variable name='saltype'
>
686 <xsl:call-template name='saltype'
>
687 <xsl:with-param name='type'
>
688 <xsl:value-of select='$elementtype'
/>
690 <xsl:with-param name='parenttype'
>
691 <xsl:value-of select='$parentclass'
/>
696 Array:
<xsl:value-of select=
"@name"/>
697 ElementType:
<xsl:value-of select=
"$elementtype"/>(
<xsl:value-of select=
"$parentclass"/>)
700 sal_uInt32 get_
<xsl:value-of select=
"@name"/>_count();
702 <xsl:text> </xsl:text><xsl:value-of select='$saltype'
/> get_
<xsl:value-of select=
"@name"/>(sal_uInt32 pos);
704 <xsl:when test='.//UML:Stereotype/@xmi.idref =
"attribute" or .//UML:Stereotype/@xmi.idref =
"binary"'
>
705 <xsl:variable name=
"returntype_">
706 <xsl:value-of select='.//UML:Parameter.type/UML:Class/@xmi.idref'
/>
708 <xsl:variable name=
"returntype">
709 <xsl:call-template name='saltype'
>
710 <xsl:with-param name='type'
>
711 <xsl:value-of select='$returntype_'
/>
713 <xsl:with-param name='parenttype'
>
714 <xsl:call-template name='parenttype'
>
715 <xsl:with-param name='type'
>
716 <xsl:value-of select='$returntype_'
/>
723 Operation:
<xsl:value-of select=
"@name"/>
726 <xsl:text> </xsl:text>
727 <xsl:value-of select='$returntype'
/>
728 <xsl:text> get_
</xsl:text>
729 <xsl:value-of select='@name'
/>
730 <xsl:text>();

</xsl:text>
735 <xsl:template match=
"UML:Attribute" mode='declmembers'
>
736 <xsl:text> </xsl:text>
737 <xsl:call-template name='saltype'
>
738 <xsl:with-param name='type'
>
739 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
742 <xsl:text> m
</xsl:text>
743 <xsl:value-of select=
"@name"/>
748 <xsl:template name='idtoqname'
>
749 <xsl:param name='id'
/>NS_
<xsl:value-of select='substring-before($id,
":")'
/>::LN_
<xsl:value-of select='substring-after($id,
":")'
/>
752 <xsl:template name='saltype'
>
753 <xsl:param name='type'
/>
754 <xsl:param name='parenttype'
/>
756 <xsl:when test=
"$type='U8'">sal_uInt8
</xsl:when>
757 <xsl:when test=
"$type='S8'">sal_Int8
</xsl:when>
758 <xsl:when test=
"$type='U16'">sal_uInt16
</xsl:when>
759 <xsl:when test=
"$type='S16'">sal_Int16
</xsl:when>
760 <xsl:when test=
"$type='U32'">sal_uInt32
</xsl:when>
761 <xsl:when test=
"$type='S32'">sal_Int32
</xsl:when>
762 <xsl:when test=
"$type='String'">rtl::OUString
</xsl:when>
763 <xsl:when test=
"$type='Value'">WW8Value::Pointer_t
</xsl:when>
764 <xsl:when test=
"$type='Binary'">WW8BinaryObjReference::Pointer_t
</xsl:when>
765 <xsl:when test=
"$parenttype=''">
766 <xsl:value-of select=
"$type"/>
769 <xsl:text>writerfilter::Reference
< </xsl:text>
770 <xsl:value-of select='$parenttype'
/>
771 <xsl:text> >::Pointer_t
</xsl:text>
776 <xsl:template name='typetype'
>
777 <xsl:param name='type'
/><xsl:choose>
778 <xsl:when test=
"$type='U8'">simple
</xsl:when>
779 <xsl:when test=
"$type='S8'">simple
</xsl:when>
780 <xsl:when test=
"$type='U16'">simple
</xsl:when>
781 <xsl:when test=
"$type='S16'">simple
</xsl:when>
782 <xsl:when test=
"$type='U32'">simple
</xsl:when>
783 <xsl:when test=
"$type='S32'">simple
</xsl:when>
784 <xsl:when test=
"$type='String'">string
</xsl:when>
785 <xsl:when test=
"$type='Value'">value
</xsl:when>
786 <xsl:otherwise>complex
</xsl:otherwise>
790 <xsl:template match=
"UML:Attribute" mode=
"valuetype">
791 <xsl:variable name='type'
>
792 <xsl:value-of select='.//UML:DataType/@xmi.idref'
/>
795 <xsl:when test='$
type=
"U8"'
>WW8IntValue
</xsl:when>
796 <xsl:when test='$
type=
"S8"'
>WW8IntValue
</xsl:when>
797 <xsl:when test='$
type=
"U16"'
>WW8IntValue
</xsl:when>
798 <xsl:when test='$
type=
"S16"'
>WW8IntValue
</xsl:when>
799 <xsl:when test='$
type=
"U32"'
>WW8IntValue
</xsl:when>
800 <xsl:when test='$
type=
"S32"'
>WW8IntValue
</xsl:when>
801 <xsl:otherwise>WW8PropertiesValue
</xsl:otherwise>
805 <xsl:template match=
"UML:Class" mode=
"dffrecord">
806 <xsl:variable name=
"classname">
807 <xsl:text>Dff
</xsl:text><xsl:value-of select=
"@name"/>
811 Automaticallay generated class:
813 <xsl:value-of select=
"$classname"/>
817 <xsl:value-of select=
"$classname"/>
818 <xsl:text> : public DffRecord
821 typedef boost::shared_ptr
< </xsl:text>
822 <xsl:value-of select=
"$classname"/>
823 <xsl:text> > Pointer_t;


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


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


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


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


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


835 : DffRecord(rRecord) {}
837 <xsl:value-of select=
"$classname"/>
840 virtual void resolveLocal(Properties
& props);
</xsl:text>
841 <xsl:if test='.//UML:Stereotype[@xmi.idref =
"resolvenoauto"]'
>
842 void resolveNoAuto(Properties
& rHandler);
845 virtual void dump(OutputWithDepth
< string
> & o) const;
847 virtual DffRecord * clone() const { return new
</xsl:text>
848 <xsl:value-of select=
"$classname"/>
849 <xsl:text>(*this); }


850 virtual string getType() const
853 <xsl:value-of select="$classname
"/>
857 virtual string getName() const { return
""; }
859 <xsl:apply-templates select=
"." mode=
"declsProperties"/>
866 <xsl:template match=
"UML:Class" mode=
"dffopt">
868 <xsl:variable name="classname">
869 <xsl:text>DffOpt</xsl:text><xsl:value-of select="@name"/>
873 Automaticallay generated class:
875 <xsl:value-of select="$classname"/>
879 <xsl:value-of select="$classname"/>
880 <xsl:text> : public WW8FOPTE
883 <xsl:value-of select="$classname"/>
884 <xsl:text>(WW8FOPTE & rOpt) : WW8FOPTE(rOpt) {}
886 virtual string getName() const
889 <xsl:value-of select="@name"/>
899 <xsl:template name=
"parenttype">
900 <xsl:param name='type'
/>
901 <xsl:for-each select='/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$type]'
>
902 <xsl:value-of select='./UML:Generalization.parent/UML:Class/@xmi.idref'
/>
906 <xsl:template match=
"UML:Attribute" mode=
"returntype">
907 <xsl:variable name='type'
>
908 <xsl:value-of select=
"UML:StructuralFeature.type/UML:DataType/@xmi.idref"/>
910 <xsl:call-template name='saltype'
>
911 <xsl:with-param name='type'
>
912 <xsl:value-of select=
"$type"/>
914 <xsl:with-param name='parenttype'
>
915 <xsl:call-template name='parenttype'
>
916 <xsl:with-param name='type'
><xsl:value-of select='$type'
/></xsl:with-param>