diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-23 09:42:39 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-12-01 08:29:37 +0000 |
commit | 81026d7e1a27c12f376796890daef01b0e0af615 (patch) | |
tree | 80c07820a7f2f773c82df3c082ac8a77596381a4 /writerfilter/source | |
parent | b14f981e055bde9243c82d3ca5bbd3e469a7eb40 (diff) |
split qnametostr up to try and make .o's small enough for ppc64
i.e. relocation truncated to fix: R_PPC64_TOC16_DS
while I'm at it merge the standalone header/footer files into the .xslt and
simplify the makefile.
(cherry picked from commit 4ee0ee4971119b0460fc3e7819a23acd34202dc4)
Conflicts:
writerfilter/CustomTarget_source.mk
writerfilter/source/resourcemodel/qnametostrfooter
Change-Id: Iee0e9b5dd96868f49f1bed22fb5dc6d28c8cef81
Reviewed-on: https://gerrit.libreoffice.org/1201
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/doctok/qnametostr.xsl | 6 | ||||
-rw-r--r-- | writerfilter/source/ooxml/qnametostr.xsl | 8 | ||||
-rw-r--r-- | writerfilter/source/resourcemodel/qnametostrcore.cxx | 76 | ||||
-rw-r--r-- | writerfilter/source/resourcemodel/qnametostrfooter | 24 | ||||
-rw-r--r-- | writerfilter/source/resourcemodel/qnametostrheader | 57 |
5 files changed, 89 insertions, 82 deletions
diff --git a/writerfilter/source/doctok/qnametostr.xsl b/writerfilter/source/doctok/qnametostr.xsl index 44fca1e5dde5..f7e71fc5eb0b 100644 --- a/writerfilter/source/doctok/qnametostr.xsl +++ b/writerfilter/source/doctok/qnametostr.xsl @@ -34,8 +34,14 @@ <xsl:include href="resourcetools.xsl"/> <xsl:template match="/"> +#include "doctok/resourceids.hxx" +#include "resourcemodel/QNameToString.hxx" + +namespace writerfilter +{ <xsl:apply-templates select=".//UML:Model" mode="qnametostr"/> <xsl:apply-templates select='.//UML:Model' mode='sprmidstoxml'/> <xsl:apply-templates select='.//UML:Model' mode='analyzerdoctokids'/> +} </xsl:template> </xsl:stylesheet> diff --git a/writerfilter/source/ooxml/qnametostr.xsl b/writerfilter/source/ooxml/qnametostr.xsl index 1c0a706df56d..4968ba1e2299 100644 --- a/writerfilter/source/ooxml/qnametostr.xsl +++ b/writerfilter/source/ooxml/qnametostr.xsl @@ -125,8 +125,14 @@ void ooxmlidsToXML(::std::ostream & out) </xsl:template> <xsl:template match="/"> +#include "ooxml/resourceids.hxx" +#include "resourcemodel/QNameToString.hxx" + +namespace writerfilter +{ <xsl:call-template name="qnametostr"/> <xsl:call-template name="ooxmlidstoxml"/> +} </xsl:template> -</xsl:stylesheet>
\ No newline at end of file +</xsl:stylesheet> diff --git a/writerfilter/source/resourcemodel/qnametostrcore.cxx b/writerfilter/source/resourcemodel/qnametostrcore.cxx new file mode 100644 index 000000000000..f36beba0bdc4 --- /dev/null +++ b/writerfilter/source/resourcemodel/qnametostrcore.cxx @@ -0,0 +1,76 @@ +/* + * 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 <resourcemodel/QNameToString.hxx> +#include <doctok/WW8Document.hxx> +#include <ooxml/OOXMLDocument.hxx> + +namespace writerfilter +{ + +QNameToString::Pointer_t QNameToString::pInstance; + +QNameToString::Pointer_t WRITERFILTER_RESOURCEMODEL_DLLPUBLIC QNameToString::Instance() +{ + if (pInstance.get() == NULL) + pInstance = QNameToString::Pointer_t(new QNameToString()); + + return pInstance; +} + +string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC QNameToString::operator()(Id qName) +{ + string sResult; + + Map::const_iterator aIt = mMap.find(qName); + + if (aIt != mMap.end()) + sResult = aIt->second; + + return mMap[qName]; +} + +QNameToString::QNameToString() +{ + init_doctok(); + init_ooxml(); +} + +extern void ooxmlsprmidsToXML(::std::ostream &out); +extern void sprmidsToXML(::std::ostream &out); +extern void doctokidsToXML(::std::ostream &out); +extern void ooxmlidsToXML(::std::ostream &out); + +void WRITERFILTER_RESOURCEMODEL_DLLPUBLIC analyzerIds() +{ + cout << "<ids type=\"sprm\">" << endl; + + sprmidsToXML(cout); + ooxmlsprmidsToXML(cout); + + cout << "</ids>" << endl; + + cout << "<ids type=\"attribute\">" << endl; + + doctokidsToXML(cout); + ooxmlidsToXML(cout); + + cout << "</ids>" << endl; +} + +} diff --git a/writerfilter/source/resourcemodel/qnametostrfooter b/writerfilter/source/resourcemodel/qnametostrfooter deleted file mode 100644 index 4cba68b6f852..000000000000 --- a/writerfilter/source/resourcemodel/qnametostrfooter +++ /dev/null @@ -1,24 +0,0 @@ -QNameToString::QNameToString() -{ - init_doctok(); - init_ooxml(); -} - -void WRITERFILTER_RESOURCEMODEL_DLLPUBLIC analyzerIds() -{ - cout << "<ids type=\"sprm\">" << endl; - - sprmidsToXML(cout); - ooxmlsprmidsToXML(cout); - - cout << "</ids>" << endl; - - cout << "<ids type=\"attribute\">" << endl; - - doctokidsToXML(cout); - ooxmlidsToXML(cout); - - cout << "</ids>" << endl; -} - -} diff --git a/writerfilter/source/resourcemodel/qnametostrheader b/writerfilter/source/resourcemodel/qnametostrheader deleted file mode 100644 index 2705bb30cc73..000000000000 --- a/writerfilter/source/resourcemodel/qnametostrheader +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <doctok/resourceids.hxx> -#include <ooxml/resourceids.hxx> -#include <resourcemodel/QNameToString.hxx> -#include <stdio.h> - -namespace writerfilter -{ - -QNameToString::Pointer_t QNameToString::pInstance; - -QNameToString::Pointer_t WRITERFILTER_RESOURCEMODEL_DLLPUBLIC QNameToString::Instance() -{ - if (pInstance.get() == NULL) - pInstance = QNameToString::Pointer_t(new QNameToString()); - - return pInstance; -} - -string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC QNameToString::operator()(Id qName) -{ - string sResult; - - Map::const_iterator aIt = mMap.find(qName); - - if (aIt != mMap.end()) - sResult = aIt->second; - - return mMap[qName]; -} - |