writerfilter/CustomTarget_source.mk | 7 writerfilter/Library_writerfilter.mk | 2 writerfilter/inc/doctok/WW8Document.hxx | 101 ------ writerfilter/source/doctok/WW8CpAndFc.cxx | 84 ----- writerfilter/source/doctok/WW8CpAndFc.hxx | 245 --------------- writerfilter/source/doctok/WW8FKP.hxx | 122 ------- writerfilter/source/doctok/resourcesimpl.xsl | 414 --------------------------- writerfilter/source/filter/ImportFilter.cxx | 1 8 files changed, 976 deletions(-)
New commits: commit 148e7763f3b3b5eb881026228f8c40b1e179d79d Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Dec 13 22:10:26 2013 +0100 writerfilter: remove unused WW8Stream Change-Id: I375b4768bc4474f78f6857176c8b77856609aeaa diff --git a/writerfilter/inc/doctok/WW8Document.hxx b/writerfilter/inc/doctok/WW8Document.hxx deleted file mode 100644 index 0f017ac..0000000 --- a/writerfilter/inc/doctok/WW8Document.hxx +++ /dev/null @@ -1,101 +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_DOCUMENT_HXX -#define INCLUDED_WW8_DOCUMENT_HXX - -#include <boost/shared_ptr.hpp> -#include <sal/types.h> -#include <com/sun/star/uno/Reference.hxx> -#include <resourcemodel/SubSequence.hxx> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> - -#include <resourcemodel/WW8ResourceModel.hxx> -#include <resourcemodel/OutputWithDepth.hxx> - -#include <WriterFilterDllApi.hxx> - -namespace writerfilter { -namespace doctok { - -using namespace ::com::sun::star; - -/** - A stream containing a WW8 document. - - The content of the stream is a sequence of unsigned bytes. The - stream consists of substreams that are identified by string - identifiers. -*/ -class WW8Stream -{ -public: - /** - Pointer to a WW8Stream. - */ - typedef boost::shared_ptr<WW8Stream> Pointer_t; - - /** - Type for the content of the stream - */ - typedef SubSequence<sal_uInt8> Sequence; - - virtual ~WW8Stream(); - - /** - Returns pointer to a substream. - - @param rSid identifier of substream to return - - @return the substream - */ - virtual Pointer_t getSubStream(const OUString & rSid) = 0; - - /** - Return a continious part of the stream. - - @param nOffset offset in the stream where the part starts - @param nCount length of the part (number of bytes) - - @return sequence of unsigned bytes - */ - virtual Sequence get(sal_uInt32 nOffset, sal_uInt32 nCount) - const = 0; - - // Returns the names of substreams contained in the stream - virtual string getSubStreamNames() const = 0; - - virtual uno::Sequence<OUString> getSubStreamUNames() const = 0; - - /** - Dumps content of stream to output. - - @param o the target output - */ - virtual void dump(OutputWithDepth<string> & o) const = 0; - - //virtual bool put(sal_uInt32 nOffset, const Sequence & rSeq) = 0; -}; - -}} - -#endif // INCLUDED_WW8_DOCUMENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 843e37a..90c4c98 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -28,7 +28,6 @@ #include <oox/core/filterdetect.hxx> #include <dmapper/DomainMapper.hxx> #include <WriterFilter.hxx> -#include <doctok/WW8Document.hxx> #include <ooxml/OOXMLDocument.hxx> #ifdef DEBUG_IMPORT #include <iostream> commit 641dac98cddc63304e374a43c299d62b9dff52c9 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Dec 13 22:05:57 2013 +0100 writerfilter: remove unused WW8CpAndFc Change-Id: I3e56a41c6fe5fab3e16d8e09a5404d83f5477738 diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk index 0a56e9c..796c37a 100644 --- a/writerfilter/Library_writerfilter.mk +++ b/writerfilter/Library_writerfilter.mk @@ -122,7 +122,6 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\ writerfilter/source/dmapper/TblStylePrHandler \ writerfilter/source/dmapper/ThemeTable \ writerfilter/source/dmapper/WrapPolygonHandler \ - writerfilter/source/doctok/WW8CpAndFc \ writerfilter/source/filter/ImportFilter \ writerfilter/source/filter/RtfFilter \ writerfilter/source/filter/WriterFilter \ diff --git a/writerfilter/source/doctok/WW8CpAndFc.cxx b/writerfilter/source/doctok/WW8CpAndFc.cxx deleted file mode 100644 index 7b1bfde..0000000 --- a/writerfilter/source/doctok/WW8CpAndFc.cxx +++ /dev/null @@ -1,84 +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 <WW8CpAndFc.hxx> - -#include <iterator> -#include <algorithm> -#include <string> -#include <map> - -namespace writerfilter { -namespace doctok -{ -using namespace ::std; - -bool operator < (const Cp & rA, const Cp & rB) -{ - return rA.nCp < rB.nCp; -} - -bool operator == (const Cp & rA, const Cp & rB) -{ - return rA.nCp == rB.nCp; -} - -string Cp::toString() const -{ - char sBuffer[256]; - - snprintf(sBuffer, 255, "%" SAL_PRIxUINT32 "", get()); - - return string(sBuffer); -} - -ostream & operator << (ostream & o, const Cp & rCp) -{ - return o << rCp.toString(); -} - -bool operator < (const Fc & rA, const Fc & rB) -{ - return rA.mnFc < rB.mnFc; -} - -bool operator == (const Fc & rA, const Fc & rB) -{ - return rA.mnFc == rB.mnFc; -} - -string Fc::toString() const -{ - char sBuffer[256]; - - snprintf(sBuffer, 255, "(%" SAL_PRIxUINT32 ", %s)", static_cast<sal_uInt32>(get()), - isComplex() ? "true" : "false"); - - return string(sBuffer); -} - -ostream & operator << (ostream & o, const Fc & rFc) -{ - - return o << rFc.toString(); -} - -}} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/doctok/WW8CpAndFc.hxx b/writerfilter/source/doctok/WW8CpAndFc.hxx deleted file mode 100644 index 1eed11e..0000000 --- a/writerfilter/source/doctok/WW8CpAndFc.hxx +++ /dev/null @@ -1,245 +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_CP_AND_FC_HXX -#define INCLUDED_WW8_CP_AND_FC_HXX - -#include <sal/types.h> -#include <doctok/WW8Document.hxx> -#include <set> -#include <boost/unordered_map.hpp> -#include <iostream> - -namespace writerfilter { -namespace doctok -{ -using namespace ::std; - -template <class T> -bool operator <= (const T & rA, const T & rB) -{ - return ! ( rB < rA ); -} - -/** - A character position. - - This is a wrapper to make the type for WW8 character position (CP) - distinct from WW8 file character positions (FC). -*/ -struct Cp -{ - sal_uInt32 nCp; // the WW8 character position - - Cp() : nCp(0) {} - - Cp(sal_uInt32 nCp_) : nCp(nCp_) {} - - /** - Returns the WW8 character position. - - @return the WW8 character position - */ - sal_uInt32 get() const { return nCp; } - - /** - Sets the WW8 character position. - - @param nCp_ the WW8 character position to set - */ - void set(sal_uInt32 nCp_) { nCp = nCp_; } - - /** - Calculate CP moved backward. - - None of the involved CPs is changed. - - @param n amount of movement - - @return CP moved @n steps backward - */ - sal_uInt32 operator - (const Cp & rCp) const - { return nCp - rCp.nCp; } - - /** - Calculate CP moved forward. - - None of the involved CPs is changed. - - @param n amount of movement - - @return CP moved @n steps forward - */ - Cp operator + (sal_uInt32 n) const - { return Cp(nCp + n); } - - /** - Advance CP forward. - - @attention The CP is altered. - - @param n amount of movement - - @return CP moved @n steps forward - */ - Cp & operator += (sal_uInt32 n) - { - nCp += n; - - return *this; - } - - /** - Return string representation of CP. - */ - string toString() const; - - friend bool operator < (const Cp & rA, const Cp & rB); - friend bool operator == (const Cp & rA, const Cp & rB); - friend ostream & operator << (ostream & o, const Cp & rCp); -}; - -/** - A file character position. - - This is a wrapper to make the type for WW8 character position (CP) - distinct from WW8 file character positions (FC). - - \see{Cp} -*/ -struct Fc -{ - sal_uInt32 mnFc; // the WW8 character position - bool mbComplex; - - Fc() : mnFc(0), mbComplex(false) {} - - Fc(sal_uInt32 nFc, bool bComplex = true) - : mnFc(nFc), mbComplex(bComplex) - {} - - sal_uInt32 complexFactor() const { return mbComplex ? 1 : 2; } - - /** - Returns the WW8 character position. - - @return the WW8 character position - */ - sal_uInt32 get() const { return mnFc; } - - /** - Sets the WW8 file character position. - - @param nFc the WW8 file character position to set - */ - void set(sal_uInt32 nFc) { mnFc = nFc; } - - /** - Set if the FC is complex. - - @param bComplex true if FC is set to be complex - */ - void setComplex(bool bComplex) { mbComplex = bComplex; } - - /** - Return if FC is complex. - - @retval true FC is complex - @retval false else - */ - bool isComplex() const { return mbComplex; } - - /** - Distance of FCs. - - None of the involved FCs is changed. - - @param rFc FC to calculate distance to - - @return Distance from @a rFc to this FC - */ - sal_uInt32 operator - (const Fc & rFc) const - { return (mnFc - rFc.mnFc) / complexFactor(); } - - /** - Calculate FC moved backward. - - None of the involved FCs is changed. - - @param n amount of movement - - @return FC moved @n steps backward - */ - Fc operator - (sal_uInt32 n) const - { return Fc(mnFc - n * complexFactor(), mbComplex); } - - /** - Calculate FC moved forward. - - None of the involved FCs is changed. - - @param n amount of movement - - @return FC moved @n steps Forward - */ - Fc operator + (sal_uInt32 n) const - { return Fc(mnFc + n * complexFactor(), mbComplex); } - - /** - Return string representation of FC. - */ - string toString() const; - - friend bool operator < (const Fc & rA, const Fc & rB); - friend bool operator == (const Fc & rA, const Fc & rB); - friend ostream & operator << (ostream & o, const Fc & rFc); -}; - -struct CpHash -{ - size_t operator()(const Cp & rCp) const - { - return rCp.get(); - } -}; - -struct FcHash -{ - size_t operator()(const Fc & rFc) const - { - return rFc.get(); - } -}; - -struct CpEq -{ - bool operator() (const Cp & rA, const Cp &rB) const - { - return rA == rB; - } -}; - -typedef boost::unordered_map<Cp, Fc, CpHash, CpEq> Cp2FcHashMap_t; - -} // namespace doctok -} // namespace writerfilter - -#endif // INCLUDED_WW8_CP_AND_FC_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 3e570f948f7321ff5a1b5780936d91c3c760859e Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Dec 13 22:04:53 2013 +0100 writerfilter: remove unused WW8FKP Change-Id: I3ba91a01b7d2acc23ae0d67ba776eb79b0280414 diff --git a/writerfilter/source/doctok/WW8FKP.hxx b/writerfilter/source/doctok/WW8FKP.hxx deleted file mode 100644 index 43c13fe..0000000 --- a/writerfilter/source/doctok/WW8FKP.hxx +++ /dev/null @@ -1,122 +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_FKP_HXX -#define INCLUDED_WW8_FKP_HXX - -#include <WW8CpAndFc.hxx> - -namespace writerfilter { -namespace doctok -{ - -/** - A formated diskpage (FKP). - - Formatted diskpages are used by Word to store runs of SPRMs (single - property modifier). A FKP contains a list of file character - positions (FC). For each FC there is an entry containing the run of - SPRMs stored for that FC. - */ -class WW8FKP : public WW8StructBase -{ -public: - /** - Shared pointer to an FKP. - */ - typedef boost::shared_ptr<WW8FKP> Pointer_t; - - /** - Create FKP from stream. - - @param rStream stream to create FKP from - @param nOffset offset in stream where the FKP starts. - */ - WW8FKP(WW8Stream & rStream, sal_uInt32 nOffset) - : WW8StructBase(rStream, nOffset, 512) - { - } - - /** - Return count of entries. - */ - virtual sal_uInt32 getEntryCount() const = 0; - - /** - Return an FC. - - @param nIndex index of the FC to return - */ - virtual Fc getFc(sal_uInt32 nIndex) const = 0; - - /** - Returns the first FC of the FKP. - */ - virtual Fc getFirstFc() const = 0; - - /** - Returns the last FC of the FKP. - */ - virtual Fc getLastFc() const = 0; - - /** - Check if an FKP contains an FC. - - @param rFc FC to look for - - @retval true FKP contains FC - @retval false else - */ - virtual bool contains(const Fc & rFc) const = 0; - - /** - Return properties stored in an FKP for a FC. - - @param rFc FC to look for - */ - virtual writerfilter::Reference<Properties>::Pointer_t - getProperties(const Fc & rFc) - const = 0; -}; - -/** - Cache providing FKPs. - */ -class WW8FKPCache -{ -public: - /** - Shared pointer to cache. - */ - typedef boost::shared_ptr<WW8FKPCache> Pointer_t; - - virtual ~WW8FKPCache(); - - /** - Return FKP. - - @param nPageNumber number of page to return - */ - virtual WW8FKP::Pointer_t get(sal_uInt32 nPageNumber, bool bComplex) = 0; -}; -}} - -#endif // INCLUDED_WW8_FKP_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit f7dba89b95e4acaea6c4996ee0628d0f596ab665 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Dec 13 22:02:44 2013 +0100 writerfilter: remove unused resourcesimpl Change-Id: I7120333562d926f9d535d265d2caf8c5a95cc558 diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index 57b2b57..2b4a7e7 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -43,7 +43,6 @@ writerfilter_OOXMLNAMESPACES= \ writerfilter_ALL = \ $(writerfilter_GEN_doctok_ResourceIds_hxx) \ - $(writerfilter_GEN_doctok_Resources_cxx) \ $(writerfilter_GEN_doctok_QNameToStr_cxx) \ $(writerfilter_GEN_doctok_SprmIds_hxx) \ $(writerfilter_GEN_model_SprmCodeToStr_cxx) \ @@ -63,7 +62,6 @@ writerfilter_ALL = \ writerfilter_DEP_ooxml_Namespaces_txt=$(call gb_CustomTarget_get_workdir,oox/generated)/misc/namespaces.txt writerfilter_GEN_doctok_ResourceIds_hxx=$(writerfilter_WORK)/doctok/resourceids.hxx -writerfilter_GEN_doctok_Resources_cxx=$(writerfilter_WORK)/resources.cxx writerfilter_GEN_doctok_QNameToStr_cxx=$(writerfilter_WORK)/doctok/qnametostr.cxx writerfilter_GEN_doctok_SprmIds_hxx=$(writerfilter_WORK)/doctok/sprmids.hxx writerfilter_GEN_model_SprmCodeToStr_cxx=$(writerfilter_WORK)/sprmcodetostr.cxx @@ -87,7 +85,6 @@ writerfilter_SRC_doctok_Model=$(writerfilter_SRC)/doctok/resources.xmi writerfilter_SRC_doctok_QNameToStr_xsl=$(writerfilter_SRC)/doctok/qnametostr.xsl writerfilter_SRC_doctok_ResourceIds_xsl=$(writerfilter_SRC)/doctok/resourceids.xsl writerfilter_SRC_doctok_ResourceTools_xsl=$(writerfilter_SRC)/doctok/resourcetools.xsl -writerfilter_SRC_doctok_ResourcesImpl_xsl=$(writerfilter_SRC)/doctok/resourcesimpl.xsl writerfilter_SRC_doctok_SprmCodeToStr_xsl=$(writerfilter_SRC)/doctok/sprmcodetostr.xsl writerfilter_SRC_doctok_SprmIds_xsl=$(writerfilter_SRC)/doctok/sprmids.xsl writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/namespace_preprocess.pl @@ -111,10 +108,6 @@ $(writerfilter_GEN_doctok_ResourceIds_hxx) : $(writerfilter_SRC_doctok_Model) $( $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_doctok_ResourceIds_xsl) $(writerfilter_SRC_doctok_Model)) > $@ -$(writerfilter_GEN_doctok_Resources_cxx) : $(writerfilter_SRC_doctok_Model) $(writerfilter_SRC_doctok_ResourcesImpl_xsl) $(writerfilter_SRC_doctok_ResourceTools_xsl) | $(writerfilter_WORK)/doctok/.dir - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_doctok_ResourcesImpl_xsl) $(writerfilter_SRC_doctok_Model)) > $@ - $(writerfilter_GEN_doctok_SprmIds_hxx) : $(writerfilter_SRC_doctok_Model) $(writerfilter_SRC_doctok_SprmIds_xsl) | $(writerfilter_WORK)/doctok/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_doctok_SprmIds_xsl) $(writerfilter_SRC_doctok_Model)) > $@ diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk index 22a382f..0a56e9c 100644 --- a/writerfilter/Library_writerfilter.mk +++ b/writerfilter/Library_writerfilter.mk @@ -149,7 +149,6 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\ )) $(eval $(call gb_Library_add_generated_exception_objects,writerfilter,\ - CustomTarget/writerfilter/source/resources \ $(patsubst %,CustomTarget/writerfilter/source/OOXMLFactory_%,$(writerfilter_OOXMLNAMESPACES)) \ CustomTarget/writerfilter/source/OOXMLFactory_generated \ CustomTarget/writerfilter/source/OOXMLFactory_values \ diff --git a/writerfilter/source/doctok/resourcesimpl.xsl b/writerfilter/source/doctok/resourcesimpl.xsl deleted file mode 100644 index 86ce01c..0000000 --- a/writerfilter/source/doctok/resourcesimpl.xsl +++ /dev/null @@ -1,414 +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" /> - - <xsl:include href="resourcetools.xsl"/> - -<xsl:template match="/"> - <xsl:call-template name="licenseheader"/> - <xsl:text> -#include <resourcemodel/WW8ResourceModel.hxx> - -#ifndef INCLUDED_SPRMIDS_HXX -#include <doctok/sprmids.hxx> -#endif - -namespace writerfilter { -namespace doctok { - -using namespace ::std; -</xsl:text> - <xsl:apply-templates select='/XMI/XMI.content/UML:Model' mode="sprmkind"/> - <xsl:apply-templates select='.//UML:Class' mode='class'/> - <xsl:apply-templates select='//UML:Model' mode='createsprmprops'/> - <xsl:apply-templates select='/XMI/XMI.content/UML:Model' - mode='createsprmbinary'/> - <xsl:apply-templates select='/XMI/XMI.content/UML:Model' - mode='createdffrecord'/> - <xsl:apply-templates select='/XMI/XMI.content/UML:Model' mode='ww8foptename'/> - <xsl:apply-templates select='/XMI/XMI.content/UML:Model' - mode='isbooleandffopt'/> - <xsl:text> -}} -</xsl:text> -</xsl:template> - - <xsl:template match="UML:Class" mode="class"> - </xsl:template> - - <xsl:template match="UML:Class" mode="resolveProperties"> - <xsl:param name="classname"/> - <xsl:variable name="rHandler"> - <xsl:choose> - <xsl:when test='.//UML:Attribute[@name!="reserved"]'> - <xsl:if test='.//UML:Stereotype[@xmi.idref != "noresolve"]'> - <xsl:text>rHandler</xsl:text> - </xsl:if> - </xsl:when> - <xsl:when test='.//UML:Operation[@name!="reserved"]'> - <xsl:if test='.//UML:Stereotype[@xmi.idref != "noresolve"]'> - <xsl:text>rHandler</xsl:text> - </xsl:if> - </xsl:when> - <xsl:when test='.//UML:Stereotype[@xmi.idref = "resolvenoauto"]'> - <xsl:text>rHandler</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - </xsl:template> - - <xsl:template match='UML:Attribute' mode='resolveAttribute'> - <xsl:variable name="attrid"> - <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'> - <xsl:value-of select='UML:TaggedValue.dataValue'/> - </xsl:for-each> - </xsl:variable> - <xsl:variable name="qname"> - <xsl:call-template name='idtoqname'> - <xsl:with-param name='id'> - <xsl:value-of select='$attrid'/> - </xsl:with-param> - </xsl:call-template> - </xsl:variable> - <xsl:choose> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "attribute"'> - <xsl:text> - { - WW8Value::Pointer_t pVal = createValue(get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>()); - rHandler.attribute(</xsl:text> - <xsl:value-of select="$qname"/> - <xsl:text>, *pVal); - }</xsl:text> - </xsl:when> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "array"'> - <xsl:variable name="elementtype"> - <xsl:value-of select='.//UML:DataType/@xmi.idref'/> - </xsl:variable> - <xsl:variable name="parentclass"> - <xsl:call-template name='parenttype'> - <xsl:with-param name='type'> - <xsl:value-of select='$elementtype'/> - </xsl:with-param> - </xsl:call-template> - </xsl:variable> - <xsl:text> - { - sal_uInt32 nCount = get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>_count(); - for (sal_uInt32 n = 0; n < nCount; ++n) - { - WW8Value::Pointer_t pVal = createValue(get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>(n)); - rHandler.attribute(</xsl:text> - <xsl:value-of select="$qname"/> - <xsl:text>, *pVal); - } - }</xsl:text> - </xsl:when> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "string"'> - <xsl:text> - { - WW8StringValue aVal(get_</xsl:text> - <xsl:value-of select='@name'/> - <xsl:text>()); - rHandler.attribute(</xsl:text> - <xsl:value-of select="$qname"/> - <xsl:text>, aVal); - }</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:template> - - <xsl:template match='UML:Attribute' mode='dumpAttribute'> - <xsl:variable name="type"> - <xsl:value-of select='.//UML:DataType/@xmi.idref'/> - </xsl:variable><xsl:variable name="saltype"> - <xsl:call-template name='saltype'> - <xsl:with-param name='type'> - <xsl:value-of select='$type'/> - </xsl:with-param> - <xsl:with-param name='parenttype'> - <xsl:apply-templates select="." mode="parentclass"/> - </xsl:with-param> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="name" select="@name"/> - <xsl:for-each select=".//UML:Stereotype"> - <xsl:choose> - <xsl:when test='@xmi.idref = "attributeremainder"'/> - <xsl:when test='@xmi.idref = "array"'> - <xsl:text> - { - sal_uInt32 nCount = get_</xsl:text> - <xsl:value-of select='$name'/> - <xsl:text>_count(); - - for (sal_uInt32 n = 0; n < nCount; ++n) - { - writerfilter::dump(o, "</xsl:text> - <xsl:value-of select='$name'/> - <xsl:text>", get_</xsl:text> - <xsl:value-of select="$name"/> - <xsl:text>(n)); - } - }</xsl:text> - </xsl:when> - <xsl:when test='@xmi.idref = "string"'> - <xsl:text> - { - WW8StringValue aVal(get_</xsl:text> - <xsl:value-of select='$name'/> - <xsl:text>()); - - o.addItem("</xsl:text> - <xsl:value-of select='$name'/> - <xsl:text>" << "=\"" + aVal.toString() + "\""); - }</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:text> - writerfilter::dump(o, "</xsl:text> - <xsl:value-of select='$name'/> - <xsl:text>", get_</xsl:text> - <xsl:value-of select="$name"/> - <xsl:text>());</xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> - </xsl:template> - - <xsl:template name="resolveOperationAttribute"> - <xsl:variable name="opid"> - <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'> - <xsl:value-of select='./UML:TaggedValue.dataValue'/> - </xsl:for-each> - </xsl:variable> - <xsl:text> - { - WW8Value::Pointer_t pVal = createValue(get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>()); - rHandler.attribute(</xsl:text> - <xsl:call-template name='idtoqname'> - <xsl:with-param name='id'><xsl:value-of select='$opid'/></xsl:with-param> - </xsl:call-template> - <xsl:text>, *pVal); - }
</xsl:text> - </xsl:template> - - <xsl:template name="resolveOperationArray"> - <xsl:variable name="elementtype"> - <xsl:value-of select='.//UML:Parameter.type/@xmi.idref'/> - </xsl:variable> - <xsl:variable name="opid"> - <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'> - <xsl:value-of select='./UML:TaggedValue.dataValue'/> - </xsl:for-each> - </xsl:variable> - <xsl:variable name="parentclass"> - <xsl:for-each select='/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$elementtype]'> - <xsl:value-of select='./UML:Generalization.parent/UML:Class/@xmi.idref'/> - </xsl:for-each> - </xsl:variable> - <xsl:text> - { - sal_uInt32 nCount = get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>_count(); - - for (sal_uInt32 n = 0; n < nCount; ++n) - { - WW8Value::Pointer_t pVal = createValue(get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>(n)); - rHandler.attribute(</xsl:text> - <xsl:call-template name='idtoqname'> - <xsl:with-param name='id'><xsl:value-of select='$opid'/></xsl:with-param> - </xsl:call-template> - <xsl:text>, *pVal); - } - }
</xsl:text> - </xsl:template> - - <xsl:template name="resolveOperationBinary"> - <xsl:text> - { - WW8BinaryObjReference::Pointer_t pRef(get_</xsl:text> - <xsl:value-of select="@name"/> - <xsl:text>()); - WW8Sprm aSprm(pRef); - - rHandler.sprm(aSprm); - }
</xsl:text> - </xsl:template> - - <xsl:template match='UML:Operation' mode='resolveOperation'> - <xsl:choose> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "attribute"'> - <xsl:call-template name="resolveOperationAttribute"/> - </xsl:when> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "array"'> - <xsl:call-template name="resolveOperationArray"/> - </xsl:when> - <xsl:when test='.//UML:Stereotype/@xmi.idref = "binary"'> - <xsl:call-template name="resolveOperationBinary"/> - </xsl:when> - </xsl:choose> - </xsl:template> - - <xsl:template match="UML:Class" mode="resolveTable"> - <xsl:param name="classname"/> - <xsl:text>void </xsl:text> - <xsl:value-of select="$classname"/> - <xsl:text>::resolve(Table &) - { - } - </xsl:text> - </xsl:template> - -<xsl:template match='UML:Model' mode='createsprmprops'> -</xsl:template> - -<xsl:template match='UML:Model' mode='createsprmbinary'> -</xsl:template> - -<!-- returns optname of UML:Class --> -<xsl:template name="optname"> - <xsl:for-each select="./UML:ModelElement.taggedValue/UML:TaggedValue"> - <xsl:if test=".//UML:TagDefinition/@xmi.idref='optname'"> - <xsl:value-of select="./UML:TaggedValue.dataValue"/> - </xsl:if> - </xsl:for-each> -</xsl:template> - -<xsl:template name="ww8foptenamecase"> - <xsl:text> - case </xsl:text> - <xsl:variable name="optname"> - <xsl:call-template name="optname"/> - </xsl:variable> - <xsl:call-template name="idtoqname"> - <xsl:with-param name="id" select="$optname"/> - </xsl:call-template> - <xsl:text>: - result = "</xsl:text> - <xsl:value-of select="$optname"/> - <xsl:text>"; - break;</xsl:text> -</xsl:template> - -<xsl:template name="getdffoptname"> - <xsl:text> -OUString getDffOptName(sal_uInt32) -{ - OUString result; - return result; -}</xsl:text> -</xsl:template> - -<xsl:template name="ww8foptegetvalue"> - <xsl:text> -</xsl:text> -</xsl:template> - -<xsl:template match='UML:Model/UML:Namespace.ownedElement' mode='ww8foptename'> - <xsl:text> -</xsl:text> -<xsl:call-template name="getdffoptname"/> -<xsl:text> -</xsl:text> -<xsl:call-template name="ww8foptegetvalue"/> -</xsl:template> - -<xsl:template match="UML:Model" mode="createdffrecord"> -<xsl:text> - </xsl:text> -</xsl:template> - -<xsl:template match="UML:Attribute" mode="initmembers"> - <xsl:variable name="stereotype"><xsl:value-of select=".//UML:Stereotype/@xmi.idref"/></xsl:variable> - <xsl:variable name="offset_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="offset"]/UML:TaggedValue.dataValue, "ABCDEFX", "abcdefx")'/></xsl:variable> - <xsl:variable name="offset"> - <xsl:if test='$offset_ != "" and not(starts-with($offset_, "0x"))'>0x</xsl:if> - <xsl:value-of select='$offset_'/> - </xsl:variable> - <xsl:variable name="shift"><xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="shift"]/UML:TaggedValue.dataValue'/></xsl:variable> - <xsl:variable name="mask_"><xsl:value-of select='translate(.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="mask"]/UML:TaggedValue.dataValue, "ABCDEFX", "abcdefx")'/></xsl:variable> - <xsl:variable name="mask"> - <xsl:if test='$mask_ != "" and not(starts-with($mask_, "0x"))'>0x</xsl:if> - <xsl:value-of select='$mask_'/> - </xsl:variable> - <xsl:variable name="type"><xsl:value-of select='.//UML:DataType/@xmi.idref'/></xsl:variable><xsl:variable name="saltype"> - <xsl:call-template name='saltype'> - <xsl:with-param name='type'> - <xsl:value-of select='$type'/> - </xsl:with-param> - </xsl:call-template> -</xsl:variable> - -/* -<xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="comment"]/UML:TaggedValue.dataValue'/> - -Name: <xsl:value-of select='@name'/>(<xsl:value-of select='$stereotype'/>) -Offset: <xsl:value-of select='$offset'/> -Mask: <xsl:value-of select='$mask'/> -Shift: <xsl:value-of select='$shift'/> -*/ - -<xsl:choose> - <xsl:when test='$stereotype = "attribute"'> - 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>; - </xsl:when> - <xsl:when test='$stereotype = "array"'> - <xsl:text> - { - sal_uInt32 nCount = </xsl:text> - <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref = "arraycount"]/UML:TaggedValue.dataValue'/> - <xsl:text>; - m</xsl:text> - <xsl:value-of select='@name'/> - <xsl:text> = new </xsl:text><xsl:value-of select='$saltype'/><xsl:text>[nCount]; - - for (sal_uInt32 n = 0; n < nCount; ++n) - m</xsl:text><xsl:value-of select='@name'/><xsl:text>[n] = get</xsl:text> - <xsl:value-of select='$type'/> - <xsl:text>(</xsl:text> - <xsl:value-of select='$offset'/> - <xsl:text> + nIndex * sizeof(</xsl:text> - <xsl:value-of select='$saltype'/> - <xsl:text>)); - } - </xsl:text> - </xsl:when> - <xsl:when test='$stereotype = "string"'> - m<xsl:value-of select='@name'/> = getString(<xsl:value-of select='$offset'/>) - </xsl:when> -</xsl:choose> -</xsl:template> - -<xsl:template match="UML:Model" mode="isbooleandffopt"> -</xsl:template> - -</xsl:stylesheet> - _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits