[Libreoffice-commits] .: Branch 'libreoffice-3-6' - writerfilter/CustomTarget_source.mk writerfilter/Library_writerfilter.mk writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Dec 1 00:29:57 PST 2012
writerfilter/CustomTarget_source.mk | 15 +--
writerfilter/Library_writerfilter.mk | 21 -----
writerfilter/source/doctok/qnametostr.xsl | 6 +
writerfilter/source/ooxml/qnametostr.xsl | 7 +
writerfilter/source/resourcemodel/qnametostrcore.cxx | 76 +++++++++++++++++++
writerfilter/source/resourcemodel/qnametostrfooter | 24 ------
writerfilter/source/resourcemodel/qnametostrheader | 57 --------------
7 files changed, 97 insertions(+), 109 deletions(-)
New commits:
commit 81026d7e1a27c12f376796890daef01b0e0af615
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 23 09:42:39 2012 +0000
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 at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk
index 0edbc27..0a7fd19 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -157,8 +157,8 @@ wf_GEN_rtftok_scanner_cxx=$(writerfilter_WORK)/RTFScanner.cxx
# resourcemodel
-wf_GEN_model_QNameToStr_cxx=$(writerfilter_WORK)/qnametostr.cxx
-wf_GEN_ooxml_QNameToStr_tmp=$(writerfilter_WORK)/OOXMLqnameToStr.tmp
+wf_GEN_doctok_QNameToStr_cxx=$(writerfilter_WORK)/doctok/qnametostr.cxx
+wf_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
wf_GEN_model_SprmCodeToStr_cxx=$(writerfilter_WORK)/sprmcodetostr.cxx
wf_GEN_model_SprmCodeToStr_tmp=$(writerfilter_WORK)/sprmcodetostr.tmp
wf_GEN_doctok_QnameToStr_tmp=$(writerfilter_WORK)/DOCTOKqnameToStr.tmp
@@ -170,18 +170,14 @@ wf_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/namespacesmap.xsl
wf_DEP_ooxml_namespaces_txt=$(OUTDIR)/inc/oox/namespaces.txt
wf_GEN_ooxml_preprocess_xsl=$(writerfilter_WORK)/modelpreprocess.xsl
-$(wf_GEN_ooxml_QNameToStr_tmp): $(wf_SRC_ooxml_QNameToStr_xsl) $(wf_GEN_ooxml_Model_processed)
+$(wf_GEN_ooxml_QNameToStr_cxx): $(wf_SRC_ooxml_QNameToStr_xsl) $(wf_GEN_ooxml_Model_processed) $(wf_SRC_ooxml_FactoryTools_xsl)
$(call gb_Output_announce,$@,build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(gb_XSLTPROC) $(wf_SRC_ooxml_QNameToStr_xsl) $(wf_GEN_ooxml_Model_processed)) > $@
-$(wf_GEN_doctok_QnameToStr_tmp): $(wf_SRC_doctok_QNameToStr_xsl) $(wf_SRC_doctok_Model) | $(writerfilter_WORK)/.dir
+$(wf_GEN_doctok_QNameToStr_cxx): $(wf_SRC_doctok_QNameToStr_xsl) $(wf_SRC_doctok_Model) $(wf_SRC_doctok_ResourceTools_xsl) | $(writerfilter_WORK)/.dir
$(call gb_Output_announce,$@,build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(gb_XSLTPROC) $(wf_SRC_doctok_QNameToStr_xsl) $(wf_SRC_doctok_Model)) > $@
-$(wf_GEN_model_QNameToStr_cxx): $(wf_GEN_ooxml_QNameToStr_tmp) $(wf_GEN_doctok_QnameToStr_tmp) $(writerfilter_SRC)/resourcemodel/qnametostrheader $(writerfilter_SRC)/resourcemodel/qnametostrfooter $(wf_SRC_ooxml_FactoryTools_xsl) $(wf_SRC_doctok_ResourceTools_xsl)
- $(call gb_Output_announce,$@,build,CAT,1)
- cat $(writerfilter_SRC)/resourcemodel/qnametostrheader $(wf_GEN_ooxml_QNameToStr_tmp) $(wf_GEN_doctok_QnameToStr_tmp) $(writerfilter_SRC)/resourcemodel/qnametostrfooter > $@
-
$(wf_GEN_model_SprmCodeToStr_tmp) : $(wf_SRC_doctok_SprmCodeToStr_xsl) $(wf_SRC_doctok_Model) | $(writerfilter_WORK)/.dir
$(call gb_Output_announce,$@,build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(gb_XSLTPROC) $(wf_SRC_doctok_SprmCodeToStr_xsl) $(wf_SRC_doctok_Model)) > $@
@@ -218,7 +214,8 @@ wf_all := \
$(wf_GEN_ooxml_FastTokens_hxx) \
$(wf_GEN_ooxml_GperfFastToken_hxx) \
$(wf_GEN_ooxml_NamespaceIds_hxx) \
- $(wf_GEN_model_QNameToStr_cxx) \
+ $(wf_GEN_doctok_QNameToStr_cxx) \
+ $(wf_GEN_ooxml_QNameToStr_cxx) \
$(wf_GEN_model_SprmCodeToStr_cxx) \
$(patsubst %,$(writerfilter_WORK)/OOXMLFactory_%.hxx,$(WRITERFILTER_OOXMLNAMESPACES)) \
$(patsubst %,$(writerfilter_WORK)/OOXMLFactory_%.cxx,$(WRITERFILTER_OOXMLNAMESPACES)) \
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index f157ae1..c1201e6 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -162,6 +162,7 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\
writerfilter/source/resourcemodel/TagLogger \
writerfilter/source/resourcemodel/WW8Analyzer \
writerfilter/source/resourcemodel/XPathLogger \
+ writerfilter/source/resourcemodel/qnametostrcore \
writerfilter/source/resourcemodel/resourcemodel \
writerfilter/source/resourcemodel/util \
))
@@ -172,24 +173,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,writerfilter,\
CustomTarget/writerfilter/source/OOXMLFactory_generated \
CustomTarget/writerfilter/source/OOXMLFactory_values \
CustomTarget/writerfilter/source/sprmcodetostr \
+ CustomTarget/writerfilter/source/doctok/qnametostr \
+ CustomTarget/writerfilter/source/ooxml/qnametostr \
))
-ifneq ($(COM)-$(OS)-$(CPUNAME),GCC-LINUX-POWERPC64)
-#Apparently some compilers, according to the original .mk this was converted
-#from, require this to be noopt or they fail to compile it, probably good to
-#revisit that and narrow this down to where it's necessary
-$(eval $(call gb_Library_add_generated_cxxobjects,writerfilter,\
- CustomTarget/writerfilter/source/qnametostr \
- , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
-))
-else
-#Ironically, on RHEL-6 PPC64 with no-opt the output is too large for the
-#toolchain, "Error: operand out of range", but it build fine with
-#normal flags
-$(eval $(call gb_Library_add_generated_cxxobjects,writerfilter,\
- CustomTarget/writerfilter/source/qnametostr \
- , $(gb_LinkTarget_EXCEPTIONFLAGS) \
-))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/writerfilter/source/doctok/qnametostr.xsl b/writerfilter/source/doctok/qnametostr.xsl
index 44fca1e..f7e71fc 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 1c0a706..4968ba1 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 0000000..f36beba
--- /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 4cba68b..0000000
--- 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 2705bb3..0000000
--- 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];
-}
-
More information about the Libreoffice-commits
mailing list