[Libreoffice-commits] core.git: 4 commits - writerfilter/inc writerfilter/Library_writerfilter.mk writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Dec 9 12:49:42 PST 2013
writerfilter/Library_writerfilter.mk | 1
writerfilter/inc/doctok/WW8Document.hxx | 191 ---------
writerfilter/source/doctok/WW8ResourceModelImpl.cxx | 401 --------------------
writerfilter/source/doctok/WW8ResourceModelImpl.hxx | 308 ---------------
writerfilter/source/doctok/resourceidmapper.xsl | 116 -----
writerfilter/source/doctok/resourceidmapperback.xsl | 115 -----
writerfilter/source/doctok/resources.xsl | 1
writerfilter/source/doctok/xmistat.xsl | 28 -
8 files changed, 1161 deletions(-)
New commits:
commit 22115840c28508819f16532d8db7fa569dd7891c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 9 21:45:35 2013 +0100
writerfilter: remove unused resourceidmapper
Change-Id: I70299737ce00a43202aafc5451e6b275feda1caf
diff --git a/writerfilter/source/doctok/resourceidmapper.xsl b/writerfilter/source/doctok/resourceidmapper.xsl
deleted file mode 100644
index c860bfb..0000000
--- a/writerfilter/source/doctok/resourceidmapper.xsl
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-<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="u
rn: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#"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
- <xsl:output method="text" />
-
- <!-- Key all attributes with the same name and same value -->
- <xsl:key name="same-valued-tagged-data"
- match="UML:TaggedValue.dataValue" use="." />
-
- <xsl:template match="/">
- <out>
- <xsl:text>
-/*
-
- THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
-
-*/
-
-package analyze;
-
-import java.util.LinkedHashMap;
-
-/**
- *
- * @author hb137859
- */
-public class ResourceIdMap extends LinkedHashMap <String, Integer > {
-
- static ResourceIdMap mInstance = new ResourceIdMap();
-
- /** Creates a new instance of ResourceIdMap */
- protected ResourceIdMap() {
-/* Attributes */
</xsl:text>
- <xsl:for-each select='.//UML:Attribute[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
- <xsl:choose>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <!-- <xsl:when test='.//UML:TaggedValue.dataValue = preceding::*//UML:TaggedValue.dataValue'/>-->
- <xsl:otherwise>
- <xsl:text>put("</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>", </xsl:text>
- <xsl:value-of select='10000 + position()'/>
- <xsl:text>);
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
-
-/* Operations */
</xsl:text>
- <xsl:for-each select='.//UML:Operation[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
- <xsl:choose>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <xsl:otherwise>
- <xsl:text>put("</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>", </xsl:text>
- <xsl:value-of select='20000 + position()'/>
- <xsl:text>); 
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
-
-/* Classes */
</xsl:text>
- <xsl:for-each select='.//UML:Class[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref="noqname"]'/>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <xsl:otherwise>
- <xsl:text>put("</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>", </xsl:text>
- <xsl:value-of select='30000 + position()'/>
- <xsl:text>); 
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
- }
-
- static ResourceIdMap instance() {
- return mInstance;
- }
-};
-</xsl:text>
-</out>
-</xsl:template>
-
- <xsl:template name='idtoqname'>
- <xsl:param name='id'/>rtf:<xsl:value-of select='substring-after($id, ":")'/>
- </xsl:template>
-
-</xsl:stylesheet>
commit 62ff0ee17457662214a8b208ff2aee321d6442e1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 9 21:44:55 2013 +0100
writerfilter: remove unused xmistat
Change-Id: I9ac4cbea66123a58007dfce639964f546847a36f
diff --git a/writerfilter/source/doctok/xmistat.xsl b/writerfilter/source/doctok/xmistat.xsl
deleted file mode 100644
index 33cd7d2..0000000
--- a/writerfilter/source/doctok/xmistat.xsl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
-<xsl:output indent="yes"/>
-<xsl:template match="/">
- <xsl:for-each select="//UML:Class[@xmi.id]">
- <xsl:value-of select="@xmi.id"/>
- <xsl:text>
</xsl:text>
- </xsl:for-each>
- <xsl:value-of select="count(//UML:Class)"/>
-</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
commit d5f7801c7b45541c983df7e226d17fd24ddfdaf1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 9 21:44:11 2013 +0100
writerfilter: remove unused resourceidmapperback
Change-Id: I53d899e7d1122e773ad50c6a49213b76a68e5454
diff --git a/writerfilter/source/doctok/resourceidmapperback.xsl b/writerfilter/source/doctok/resourceidmapperback.xsl
deleted file mode 100644
index ad9ce34..0000000
--- a/writerfilter/source/doctok/resourceidmapperback.xsl
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-<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="u
rn: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#"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
- <xsl:output method="text" />
-
- <!-- Key all attributes with the same name and same value -->
- <xsl:key name="same-valued-tagged-data"
- match="UML:TaggedValue.dataValue" use="." />
-
- <xsl:template match="/">
- <out>
- <xsl:text>
-/*
-
- THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
-
-*/
-
-package analyze;
-
-import java.util.LinkedHashMap;
-
-/**
- *
- * @author hb137859
- */
-public class ResourceIdMapBackwards extends LinkedHashMap <Integer, String > {
-
- static ResourceIdMapBackwards mInstance = new ResourceIdMapBackwards();
-
- /** Creates a new instance of ResourceIdMapBackwards */
- protected ResourceIdMapBackwards() {
-/* Attributes */
</xsl:text>
- <xsl:for-each select='.//UML:Attribute[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
- <xsl:choose>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <!-- <xsl:when test='.//UML:TaggedValue.dataValue = preceding::*//UML:TaggedValue.dataValue'/>-->
- <xsl:otherwise>
- <xsl:text>put(</xsl:text>
- <xsl:value-of select='10000 + position()'/>
- <xsl:text>, "</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>");
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
-
-/* Operations */
</xsl:text>
- <xsl:for-each select='.//UML:Operation[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
- <xsl:choose>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <xsl:otherwise>
- <xsl:text>put(</xsl:text>
- <xsl:value-of select='20000 + position()'/>
- <xsl:text>, "</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>"); 
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
-
-/* Classes */
</xsl:text>
- <xsl:for-each select='.//UML:Class[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref="noqname"]'/>
- <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
- <xsl:otherwise>
- <xsl:text>put(</xsl:text>
- <xsl:value-of select='30000 + position()'/>
- <xsl:text>, "</xsl:text>
- <xsl:call-template name='idtoqname'>
- <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
- </xsl:call-template>
- <xsl:text>"); 
</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text>
- }
-
- static ResourceIdMapBackwards instance() {
- return mInstance;
- }
-};
-</xsl:text>
-</out>
-</xsl:template>
-
- <xsl:template name='idtoqname'>
- <xsl:param name='id'/>rtf:<xsl:value-of select='substring-after($id, ":")'/>
- </xsl:template>
-
-</xsl:stylesheet>
commit 387207073a0b56aa4275814f219644915aa842f6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 9 21:43:33 2013 +0100
writerfilter: remove unused WW8ResourceModelImpl
Change-Id: Ib95e4d543b8ee78127847ea0ed2409cb343b1463
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index d9556aa..a1c0a85 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -123,7 +123,6 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\
writerfilter/source/dmapper/ThemeTable \
writerfilter/source/dmapper/WrapPolygonHandler \
writerfilter/source/doctok/WW8CpAndFc \
- writerfilter/source/doctok/WW8ResourceModelImpl \
writerfilter/source/doctok/WW8StructBase \
writerfilter/source/filter/ImportFilter \
writerfilter/source/filter/RtfFilter \
diff --git a/writerfilter/inc/doctok/WW8Document.hxx b/writerfilter/inc/doctok/WW8Document.hxx
index 8b42129..b0f9109 100644
--- a/writerfilter/inc/doctok/WW8Document.hxx
+++ b/writerfilter/inc/doctok/WW8Document.hxx
@@ -225,197 +225,6 @@ public:
virtual void insert(const WW8PropertySet::Pointer_t pSet) = 0;
};
-enum PropertyType {
- /** Auxiliary type for character positions defined in piece table */
- PROP_DOC,
-
- /** properties are section properies */
- PROP_SEC,
-
- /** properties are paragraph properties */
- PROP_PAP,
-
- /** properties are character properties */
- PROP_CHP,
-
- /** a footnote reference */
- PROP_FOOTNOTE,
-
- /** an endnote reference */
- PROP_ENDNOTE,
-
- /** an annotaion reference */
- PROP_ANNOTATION,
-
- /** the start of a bookmark */
- PROP_BOOKMARKSTART,
-
- /** the end of a bookmark */
- PROP_BOOKMARKEND,
-
- /** a field character (start, separator or end) */
- PROP_FLD,
-
- /** a shape character */
- PROP_SHP,
-
- /** a break character */
- PROP_BRK
-};
-
-/**
- An iterator for traversal of the character positions of a Word
- document.
-
- The use of the iterator is analogous to WW8PropertySetIterator.
-*/
-class WW8DocumentIterator
-{
-public:
- typedef boost::shared_ptr<WW8DocumentIterator> Pointer_t;
-
- virtual ~WW8DocumentIterator();
-
- /**
- Advance iterator to next character position of the document.
- */
- virtual WW8DocumentIterator & operator++() = 0;
-
- /**
- Recedes iterator to previous character postion of the document.
- */
- virtual WW8DocumentIterator & operator--() = 0;
-
- /**
- Returns properties set at the character position the iterator
- points to.
-
- @return pointer to set of properties
- */
- virtual writerfilter::Reference<Properties>::Pointer_t getProperties()
- const = 0;
-
- virtual writerfilter::Reference<Stream>::Pointer_t getSubDocument()
- const = 0;
-
- /**
- Returns text run at the character position the iterator points
- to.
- */
- virtual WW8Stream::Sequence getText() = 0;
-
- /**
- Return pointer to the shape at character position the iterator
- is pointing to.
- */
- virtual writerfilter::Reference<Properties>::Pointer_t getShape() const = 0;
-
- /**
- Checks if the characters of the entity the iterator points to
- are complex.
-
- Complex characters in a Word document are byte size
- characters. Non-complex characters are word size characters.
-
- @retval true The characters are complex.
- @retval false The characters are non-complex.
- */
- virtual bool isComplex() const = 0;
-
- /**
- Returns the property type of the entity the iterator points to.
- */
- virtual PropertyType getPropertyType() const = 0;
-
- /**
- Checks is the iterator is equal to another one.
-
- @param rIt iterator to check against
-
- @retval true the iterators are equal
- @retval false else
- */
- virtual bool equal(const WW8DocumentIterator & rIt) const = 0;
-
- /**
- Returns string representation of the iterator.
- */
- virtual string toString() const = 0;
-
- /**
- Dumps the iterator to an output stream.
-
- @param o the output stream to dump the iterator to
- */
- virtual void dump(ostream & o) const = 0;
-};
-
-/**
- Checks if two document iterators are equal.
-
- @param rA first iterator
- @param rB second iterator
-
- @retval true the document iterators are equal
- @retval false else
- */
-bool operator == (const WW8DocumentIterator & rA,
- const WW8DocumentIterator & rB);
-
-class SubDocumentId
-{
-public:
- enum eType { FOOTNOTES, HEADERS, FOOTERS };
-
-private:
- eType mnType;
- sal_uInt8 mnIndex;
-
-public:
- SubDocumentId(eType nType, sal_uInt8 nIndex)
- : mnType(nType), mnIndex(nIndex)
- {
- }
-
- eType getType() const { return mnType; }
- sal_uInt8 getIndex() const { return mnIndex; }
-};
-
-/**
- A Word 8 document.
-*/
-class WW8Document :
- public writerfilter::Reference<Stream>
-{
-public:
- typedef boost::shared_ptr<WW8Document> Pointer_t;
-
- virtual ~WW8Document();
-
- /**
- Get a subdocument.
-
- A subdocument can be
-
- - a header
- - a footer
- - a footnode
-
- @param nId identifier of the subdocumen
- */
- virtual Pointer_t getSubDocument(SubDocumentId nId) = 0;
-
- /**
- Returns iterator to beginning of document.
- */
- virtual WW8DocumentIterator::Pointer_t begin() = 0;
-
- /**
- Returns iterator to end of document.
- */
- virtual WW8DocumentIterator::Pointer_t end() = 0;
-};
-
}}
#endif // INCLUDED_WW8_DOCUMENT_HXX
diff --git a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx b/writerfilter/source/doctok/WW8ResourceModelImpl.cxx
deleted file mode 100644
index e16b1e8..0000000
--- a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx
+++ /dev/null
@@ -1,401 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "WW8ResourceModelImpl.hxx"
-#include <doctok/resources.hxx>
-#include <resourcemodel/TableManager.hxx>
-#include <rtl/string.hxx>
-#include <resourcemodel/QNameToString.hxx>
-
-namespace writerfilter {
-
-namespace doctok
-{
-using namespace ::std;
-
-
-// ------- WW8TableDataHandler ---------
-
-typedef WW8PropertySet::Pointer_t TablePropsPointer_t;
-
-class WW8TableDataHandler : public TableDataHandler<string,
- TablePropsPointer_t>
-{
-public:
- virtual ~WW8TableDataHandler() {}
-
- typedef boost::shared_ptr<WW8TableDataHandler> Pointer_t;
- virtual void startTable(unsigned int nRows, unsigned int nDepth,
- TablePropsPointer_t pProps);
- virtual void endTable(unsigned int nestedTableLevel);
- virtual void startRow(unsigned int nCols,
- TablePropsPointer_t pProps);
- virtual void endRow();
- virtual void startCell(const string & start, TablePropsPointer_t pProps);
- virtual void endCell(const string & end);
-};
-
-void WW8TableDataHandler::startTable(unsigned int /*nRows*/, unsigned int /*nDepth*/,
- TablePropsPointer_t /*pProps*/)
-{
-}
-
-void WW8TableDataHandler::endTable(unsigned int /*nestedTableLevel*/)
-{
-}
-
-void WW8TableDataHandler::startRow
-(unsigned int /*nCols*/, TablePropsPointer_t /*pProps*/)
-{
-}
-
-void WW8TableDataHandler::endRow()
-{
-}
-
-void WW8TableDataHandler::startCell(const string & /*start*/,
- TablePropsPointer_t /*pProps*/)
-{
-}
-
-void WW8TableDataHandler::endCell(const string & /*end*/)
-{
-}
-
-//-------- WW8TableReference -----------------------------------
-
-void WW8TableReference::resolve(Table & /*rHandler*/)
-{
-}
-
-string WW8TableReference::getType() const
-{
- return "WW8TableReference";
-}
-
-void WW8PropertiesReference::resolve(Properties & rHandler)
-{
- if (mpPropSet != 0)
- {
- if (mpPropSet->isPap())
- {
- WW8IntValue aValue(mpPropSet->get_istd());
-
- rHandler.attribute(NS_rtf::LN_ISTD, aValue);
- }
-
- WW8PropertySetIterator::Pointer_t pIt = mpPropSet->begin();
- WW8PropertySetIterator::Pointer_t pItEnd = mpPropSet->end();
-
- try
- {
- while (! pIt->equal(*pItEnd))
- {
- WW8Sprm aSprm(pIt->get());
- rHandler.sprm(aSprm);
-
- ++(*pIt);
- }
- }
- catch (ExceptionOutOfBounds)
- {
- }
- }
-}
-
-string WW8PropertiesReference::getType() const
-{
- return "WW8PropertiesReference";
-}
-
-WW8BinaryObjReference::WW8BinaryObjReference
-(WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 nCount)
-: WW8StructBase(pParent, nOffset, nCount)
-{
-}
-
-WW8BinaryObjReference::WW8BinaryObjReference
-(WW8StructBase * pParent)
-: WW8StructBase(pParent, 0x0, pParent->getCount())
-{
-}
-
-writerfilter::Reference<BinaryObj>::Pointer_t
-WW8BinaryObjReference::getBinary()
-{
- return writerfilter::Reference<BinaryObj>::Pointer_t
- (new WW8BinaryObjReference(*this));
-}
-
-void WW8BinaryObjReference::resolve(BinaryObj & rHandler)
-{
- writerfilter::Reference<Properties>::Pointer_t pRef =
- writerfilter::Reference<Properties>::Pointer_t();
-
- if (getCount() > 0)
- rHandler.data(get(0), getCount(), pRef);
-}
-
-string WW8BinaryObjReference::getType() const
-{
- return "WW8BinaryObjReference";
-}
-
-sal_uInt32 WW8Sprm::getId() const
-{
- sal_uInt32 nResult = 0;
-
- if (mpProperty.get() != NULL)
- nResult = mpProperty->getId();
- else if (mpBinary.get() != NULL)
- nResult = NS_rtf::LN_blob;
-
- return nResult;
-}
-
-string WW8Sprm::toString() const
-{
- string sResult = "";
-
- if (mpProperty.get() != NULL)
- sResult = mpProperty->toString();
-
- return sResult;
-}
-
-Value::Pointer_t WW8Sprm::getValue()
-{
- Value::Pointer_t pResult;
-
- if (mpProperty.get() != NULL)
- pResult = Value::Pointer_t(createValue(mpProperty->getParam()));
-
- return pResult;
-}
-
-writerfilter::Reference<BinaryObj>::Pointer_t WW8Sprm::getBinary()
-{
- writerfilter::Reference<BinaryObj>::Pointer_t pResult;
-
- return pResult;
-}
-
-writerfilter::Reference<Stream>::Pointer_t WW8Sprm::getStream()
-{
- return writerfilter::Reference<Stream>::Pointer_t();
-}
-
-writerfilter::Reference<Properties>::Pointer_t WW8Sprm::getProps()
-{
- writerfilter::Reference<Properties>::Pointer_t pResult;
-
- return pResult;
-}
-
-Sprm::Kind WW8Sprm::getKind()
-{
- return SprmKind(getId());
-}
-
-string WW8Sprm::getName() const
-{
- return (*SprmIdToString::Instance())(getId());
-}
-
-int WW8Value::getInt() const
-{
- return 0;
-}
-
-uno::Any WW8Value::getAny() const
-{
- return uno::Any();
-}
-
-OUString WW8Value::getString() const
-{
- return OUString();
-}
-
-string WW8Value::toString() const
-{
- return string();
-}
-
-writerfilter::Reference<Properties>::Pointer_t WW8Value::getProperties()
-{
- return writerfilter::Reference<Properties>::Pointer_t();
-}
-
-writerfilter::Reference<Stream>::Pointer_t WW8Value::getStream()
-{
- return writerfilter::Reference<Stream>::Pointer_t();
-}
-
-writerfilter::Reference<BinaryObj>::Pointer_t WW8Value::getBinary()
-{
- return writerfilter::Reference<BinaryObj>::Pointer_t();
-}
-
-int WW8IntValue::getInt() const
-{
- return mValue;
-}
-
-OUString WW8IntValue::getString() const
-{
- return OUString::number(mValue);
-}
-
-uno::Any WW8IntValue::getAny() const
-{
- uno::Any aResult;
-
- aResult <<= static_cast<sal_uInt32>(mValue);
-
- return aResult;
-}
-
-string WW8IntValue::toString() const
-{
- char sBuffer[255];
-
- snprintf(sBuffer, sizeof(sBuffer), "%x", mValue);
-
- return string(sBuffer);
-}
-
-WW8Value::Pointer_t createValue(int value)
-{
- return WW8Value::Pointer_t(new WW8IntValue(value));
-}
-
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-WW8Value::Pointer_t createValue(WW8Value::Pointer_t value)
-{
- return value;
-}
-SAL_WNODEPRECATED_DECLARATIONS_POP
-
-int WW8StringValue::getInt() const
-{
- return 0;
-}
-
-OUString WW8StringValue::getString() const
-{
- return mString;
-}
-
-uno::Any WW8StringValue::getAny() const
-{
- uno::Any aResult;
-
- aResult <<= mString;
-
- return aResult;
-}
-
-string WW8StringValue::toString() const
-{
- string result;
-
- sal_uInt32 nCount = mString.getLength();
- for (sal_uInt32 n = 0; n < nCount; ++n)
- {
- if (mString[n] <= 0xff && isprint(mString[n]))
- {
- sal_Unicode nC = mString[n];
-
- if (nC < 256)
- result += sal::static_int_cast<char>(nC);
- else
- result += ".";
- }
- else
- {
- char sBuffer[64];
-
- snprintf(sBuffer, sizeof(sBuffer), "\\u%04x", mString[n]);
- result += sBuffer;
- }
- }
-
- return result;
-}
-
-WW8Value::Pointer_t createValue(const OUString & rStr)
-{
- return WW8Value::Pointer_t(new WW8StringValue(rStr));
-}
-
-writerfilter::Reference<Properties>::Pointer_t
-WW8PropertiesValue::getProperties()
-{
- return mRef;
-}
-
-string WW8PropertiesValue::toString() const
-{
- return "properties";
-}
-
-writerfilter::Reference<Stream>::Pointer_t WW8StreamValue::getStream()
-{
- return mRef;
-}
-
-string WW8StreamValue::toString() const
-{
- return "stream";
-}
-
-writerfilter::Reference<BinaryObj>::Pointer_t WW8BinaryObjValue::getBinary()
-{
- return mRef;
-}
-
-string WW8BinaryObjValue::toString() const
-{
- return "binaryObj";
-}
-
-WW8Value::Pointer_t createValue
-(writerfilter::Reference<Properties>::Pointer_t rRef)
-{
- return WW8Value::Pointer_t(new WW8PropertiesValue(rRef));
-}
-
-WW8Value::Pointer_t createValue(writerfilter::Reference<Stream>::Pointer_t rRef)
-{
- return WW8Value::Pointer_t(new WW8StreamValue(rRef));
-}
-
-WW8Value::Pointer_t createValue
-(writerfilter::Reference<BinaryObj>::Pointer_t rRef)
-{
- return WW8Value::Pointer_t(new WW8BinaryObjValue(rRef));
-}
-
-
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/doctok/WW8ResourceModelImpl.hxx b/writerfilter/source/doctok/WW8ResourceModelImpl.hxx
deleted file mode 100644
index a1b0fad..0000000
--- a/writerfilter/source/doctok/WW8ResourceModelImpl.hxx
+++ /dev/null
@@ -1,308 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_WW8_RESOURCE_MODEL_IMPL_HXX
-#define INCLUDED_WW8_RESOURCE_MODEL_IMPL_HXX
-
-#include <doctok/WW8Document.hxx>
-
-#include <resourcemodel/WW8ResourceModel.hxx>
-#include "WW8StructBase.hxx"
-
-#include <resourcemodel/OutputWithDepth.hxx>
-
-#include <map>
-
-namespace writerfilter {
-namespace doctok
-{
-using namespace ::std;
-
-class WW8PropertiesReference : public writerfilter::Reference<Properties>
-{
- WW8PropertySet::Pointer_t mpPropSet;
-
-public:
-
- WW8PropertiesReference(WW8PropertySet::Pointer_t pPropSet)
- : mpPropSet(pPropSet)
- {
- }
-
- virtual ~WW8PropertiesReference()
- {
- }
-
- virtual void resolve(Properties & rHandler);
-
- virtual string getType() const;
-};
-
-class WW8TableReference : public writerfilter::Reference<Table>
-{
-public:
- WW8TableReference()
- {
- }
-
- virtual ~WW8TableReference()
- {
- }
-
- virtual void resolve(Table & rHandler);
-
- virtual string getType() const;
-};
-
-class WW8BinaryObjReference : public writerfilter::Reference<BinaryObj>,
- public WW8StructBase
-{
-public:
- typedef boost::shared_ptr<WW8BinaryObjReference> Pointer_t;
- WW8BinaryObjReference(WW8Stream & rStream, sal_uInt32 nOffset,
- sal_uInt32 nCount);
- WW8BinaryObjReference(WW8StructBase & rParent, sal_uInt32 nOffset,
- sal_uInt32 nCount);
- WW8BinaryObjReference(WW8StructBase * pParent, sal_uInt32 nOffset,
- sal_uInt32 nCount);
- WW8BinaryObjReference(WW8StructBase * pParent);
-
- WW8BinaryObjReference()
- : WW8StructBase(WW8StructBase::Sequence())
- {
- }
-
- ~WW8BinaryObjReference()
- {
- }
-
- virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary();
-
- virtual void resolve(BinaryObj & rHandler);
-
- virtual string getType() const;
-
- virtual WW8BinaryObjReference * clone() { return new WW8BinaryObjReference(*this); }
-};
-
-class WW8Sprm : public Sprm
-{
- WW8Property::Pointer_t mpProperty;
- WW8BinaryObjReference::Pointer_t mpBinary;
-
-public:
- WW8Sprm(WW8Property::Pointer_t pProperty)
- : mpProperty(pProperty)
- {
- }
-
- WW8Sprm(WW8BinaryObjReference::Pointer_t pBinary)
- : mpBinary(pBinary)
- {
- }
-
- WW8Sprm()
- {
- }
-
- WW8Sprm(const WW8Sprm & rSprm)
- : Sprm(rSprm), mpProperty(rSprm.mpProperty), mpBinary(rSprm.mpBinary)
- {
- }
-
- virtual ~WW8Sprm()
- {
- }
-
- virtual Value::Pointer_t getValue();
- virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary();
- virtual writerfilter::Reference<Stream>::Pointer_t getStream();
- virtual writerfilter::Reference<Properties>::Pointer_t getProps();
- virtual Kind getKind();
-
- virtual sal_uInt32 getId() const;
- virtual string toString() const;
- virtual string getName() const;
-
- virtual WW8Sprm * clone() const { return new WW8Sprm(*this); }
-};
-
-class WW8Value : public Value
-{
-public:
- WW8Value() {}
- virtual ~WW8Value() {}
-
- virtual string toString() const;
- virtual int getInt() const;
- virtual OUString getString() const;
- virtual uno::Any getAny() const;
- virtual writerfilter::Reference<Properties>::Pointer_t getProperties();
- virtual writerfilter::Reference<Stream>::Pointer_t getStream();
- virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary();
- virtual WW8Value * clone() const = 0;
-};
-
-class WW8IntValue : public WW8Value
-{
- int mValue;
-public:
- WW8IntValue(int value) : mValue(value) {}
- virtual ~WW8IntValue() {}
-
- virtual int getInt() const;
- virtual OUString getString() const;
- virtual uno::Any getAny() const;
-
- virtual string toString() const;
-
- virtual WW8Value * clone() const { return new WW8IntValue(*this); }
-};
-
-/**
- Creates value from an integer.
-
- @param value integer to create value from.
-*/
-WW8Value::Pointer_t createValue(int value);
-
-ostream & operator << (ostream & o, const WW8Value & rValue);
-
-class WW8StringValue : public WW8Value
-{
- OUString mString;
-
-public:
- WW8StringValue(OUString string_) : mString(string_) {}
- virtual ~WW8StringValue() {}
-
- virtual int getInt() const;
- virtual OUString getString() const;
- virtual uno::Any getAny() const;
-
- virtual string toString() const;
-
- virtual WW8Value * clone() const { return new WW8StringValue(*this); }
-};
-
-/**
- Creates value from a string.
-
- @param rStr string to create value from.
-*/
-WW8Value::Pointer_t createValue(const OUString & rStr);
-
-class WW8PropertiesValue : public WW8Value
-{
- mutable writerfilter::Reference<Properties>::Pointer_t mRef;
-
-public:
- WW8PropertiesValue(writerfilter::Reference<Properties>::Pointer_t rRef)
- : mRef(rRef)
- {
- }
-
- virtual ~WW8PropertiesValue()
- {
- }
-
- virtual writerfilter::Reference<Properties>::Pointer_t getProperties();
-
- virtual string toString() const;
-
- virtual WW8Value * clone() const { return new WW8PropertiesValue(mRef); }
-};
-
-class WW8StreamValue : public WW8Value
-{
- mutable writerfilter::Reference<Stream>::Pointer_t mRef;
-
-public:
- WW8StreamValue(writerfilter::Reference<Stream>::Pointer_t rRef)
- : mRef(rRef)
- {
- }
-
- virtual ~WW8StreamValue()
- {
- }
-
- virtual writerfilter::Reference<Stream>::Pointer_t getStream();
-
- virtual string toString() const;
-
- virtual WW8Value * clone() const { return new WW8StreamValue(mRef); }
-};
-
-/**
- Creates value from a properties reference.
-
- @param rRef reference to create value from.
-*/
-WW8Value::Pointer_t createValue(writerfilter::Reference<Properties>::Pointer_t rRef);
-
-/**
- Creates value from another value.
-
- @param value the value to copy
-*/
-WW8Value::Pointer_t createValue(WW8Value::Pointer_t value);
-
-/**
- Creates value from a stream reference.
-
- @param rRef reference to the stream
- */
-WW8Value::Pointer_t createValue(writerfilter::Reference<Stream>::Pointer_t rRef);
-
-class WW8BinaryObjValue : public WW8Value
-{
- mutable writerfilter::Reference<BinaryObj>::Pointer_t mRef;
-
-public:
- WW8BinaryObjValue(writerfilter::Reference<BinaryObj>::Pointer_t rRef)
- : mRef(rRef)
- {
- }
-
- virtual ~WW8BinaryObjValue()
- {
- }
-
- virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary();
-
- virtual string toString() const;
-
- virtual WW8Value * clone() const { return new WW8BinaryObjValue(mRef); }
-};
-
-/**
- Creates value from a binary object reference.
-
- @param rRef reference to the stream
- */
-WW8Value::Pointer_t createValue(writerfilter::Reference<BinaryObj>::Pointer_t rRef);
-
-Sprm::Kind SprmKind(sal_uInt32 sprmCode);
-
-}}
-
-#endif // INCLUDED_WW8_RESOURCE_MODEL_IMPL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/doctok/resources.xsl b/writerfilter/source/doctok/resources.xsl
index 5903e5c..ebfe57c 100644
--- a/writerfilter/source/doctok/resources.xsl
+++ b/writerfilter/source/doctok/resources.xsl
@@ -52,7 +52,6 @@
#include <doctok/resourceids.hxx>
#include <doctok/WW8StructBase.hxx>
-#include <doctok/WW8ResourceModelImpl.hxx>
namespace writerfilter {
namespace doctok {
More information about the Libreoffice-commits
mailing list