summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-06 17:45:55 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-06 18:53:38 +0200
commit2046fcd907fe8c0217c5cd43be8420859a0ad435 (patch)
tree2a8f509656219b8741a370cd1bee0a47e9c7066b
parent63cb2c865371cafaab763be656695e9cc75b8a15 (diff)
unused writerfilter::ooxml::OOXMLFastTokenHandler
This makes libwriterfilterlo.so smaller by 500KB in a stripped dbgutil build. Change-Id: I0046251a0fe83ceee6f585f17707e4ecf53996b6
-rw-r--r--writerfilter/CustomTarget_source.mk8
-rw-r--r--writerfilter/Library_writerfilter.mk1
-rw-r--r--writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx113
-rw-r--r--writerfilter/source/ooxml/OOXMLFastTokenHandler.hxx60
-rw-r--r--writerfilter/source/ooxml/gperffasttokenhandler.py54
5 files changed, 0 insertions, 236 deletions
diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk
index 922e5a1f0bb0..6e01355bab29 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -48,7 +48,6 @@ writerfilter_ALL = \
$(writerfilter_GEN_ooxml_Factory_cxx) \
$(writerfilter_GEN_ooxml_Factory_hxx) \
$(writerfilter_GEN_ooxml_FactoryValues_hxx) \
- $(writerfilter_GEN_ooxml_GperfFastToken_hxx) \
$(writerfilter_GEN_ooxml_NamespaceIds_hxx) \
$(writerfilter_GEN_ooxml_QNameToStr_cxx) \
$(writerfilter_GEN_ooxml_ResourceIds_hxx) \
@@ -60,13 +59,11 @@ writerfilter_DEP_ooxml_Namespaces_txt=$(call gb_CustomTarget_get_workdir,oox/gen
writerfilter_GEN_ooxml_FactoryValues_hxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_values.hxx
writerfilter_GEN_ooxml_Factory_cxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_generated.cxx
writerfilter_GEN_ooxml_Factory_hxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_generated.hxx
-writerfilter_GEN_ooxml_GperfFastToken_hxx=$(writerfilter_WORK)/ooxml/gperffasttoken.hxx
writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/ooxml/model_preprocessed.xml
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx
writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/ooxml/token.xml
-writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py
writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py
@@ -80,11 +77,6 @@ $(writerfilter_GEN_ooxml_Factory_hxx) : $(writerfilter_SRC)/ooxml/factoryinc.py
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed)) > $@
-$(writerfilter_GEN_ooxml_GperfFastToken_hxx) : $(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) $(writerfilter_GEN_ooxml_Token_xml)
- $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,GPF,1)
- $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) $(writerfilter_GEN_ooxml_Token_xml)) \
- | tr -d '\r' | $(GPERF) -c -E -G -I -LC++ -S1 -t > $@
-
$(writerfilter_GEN_ooxml_Model_processed) : $(writerfilter_SRC_ooxml_Preprocess_py) $(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model) | $(writerfilter_WORK)/ooxml/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $(writerfilter_SRC_ooxml_Preprocess_py) $(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model)) > $@
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index 0cc5dddd7eb1..4a7e3fb71ea2 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -117,7 +117,6 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\
writerfilter/source/ooxml/OOXMLFactory \
writerfilter/source/ooxml/OOXMLFastContextHandler \
writerfilter/source/ooxml/OOXMLFastDocumentHandler \
- writerfilter/source/ooxml/OOXMLFastTokenHandler \
writerfilter/source/ooxml/OOXMLParserState \
writerfilter/source/ooxml/OOXMLPropertySetImpl \
writerfilter/source/ooxml/OOXMLStreamImpl \
diff --git a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx
deleted file mode 100644
index 12957165a85f..000000000000
--- a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx
+++ /dev/null
@@ -1,113 +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 <iostream>
-#include <string.h>
-#include <ooxml/resourceids.hxx>
-#include "OOXMLFastTokenHandler.hxx"
-
-#if defined __clang__
-#if __has_warning("-Wdeprecated-register")
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-register"
-#endif
-#endif
-#include "ooxml/gperffasttoken.hxx"
-#if defined __clang__
-#if __has_warning("-Wdeprecated-register")
-#pragma GCC diagnostic pop
-#endif
-#endif
-
-namespace writerfilter {
-namespace ooxml
-{
-
-using namespace ::std;
-
-OOXMLFastTokenHandler::OOXMLFastTokenHandler()
-{
-}
-
-// ::com::sun::star::xml::sax::XFastTokenHandler:
-::sal_Int32 SAL_CALL OOXMLFastTokenHandler::getToken(const OUString & Identifier)
- throw (css::uno::RuntimeException, std::exception)
-{
- ::sal_Int32 nResult = oox::XML_TOKEN_COUNT;
-
- struct tokenmap::token * pToken =
- tokenmap::Perfect_Hash::in_word_set
- (OUStringToOString(Identifier, RTL_TEXTENCODING_ASCII_US).getStr(),
- Identifier.getLength());
-
- if (pToken != NULL)
- nResult = pToken->nToken;
-
-#ifdef DEBUG_TOKEN
- clog << "getToken: "
- << OUStringToOString(Identifier, RTL_TEXTENCODING_ASCII_US).getStr()
- << ", " << nResult
- << endl;
-#endif
-
- return nResult;
-}
-
-OUString SAL_CALL OOXMLFastTokenHandler::getIdentifier(::sal_Int32)
- throw (css::uno::RuntimeException, std::exception)
-{
- // we use a Boost tokenmap, but tokenmaps cannot be indexed by an integer
- for (;;) { std::abort(); } // avoid "must return a value" warnings
-}
-
-css::uno::Sequence< ::sal_Int8 > SAL_CALL OOXMLFastTokenHandler::getUTF8Identifier(::sal_Int32)
- throw (css::uno::RuntimeException, std::exception)
-{
- // we use a Boost tokenmap, but tokenmaps cannot be indexed by an integer
- for (;;) { std::abort(); } // avoid "must return a value" warnings
-}
-
-sal_Int32 OOXMLFastTokenHandler::getTokenDirect( const char *pStr, sal_Int32 nLength ) const
-{
- struct tokenmap::token * pToken =
- tokenmap::Perfect_Hash::in_word_set( pStr, nLength );
-
- sal_Int32 nResult = pToken != NULL ? pToken->nToken : oox::XML_TOKEN_COUNT;
-
-#ifdef DEBUG_TOKEN
- clog << "getTokenFromUTF8: "
- << string(pStr, nLength)
- << ", " << nResult
- << (pToken == NULL ? ", failed" : "") << endl;
-#endif
-
- return nResult;
-}
-
-::sal_Int32 SAL_CALL OOXMLFastTokenHandler::getTokenFromUTF8
-(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException, std::exception)
-{
- return getTokenDirect(reinterpret_cast<const char *>
- (Identifier.getConstArray()),
- Identifier.getLength());
-}
-
-}}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/ooxml/OOXMLFastTokenHandler.hxx b/writerfilter/source/ooxml/OOXMLFastTokenHandler.hxx
deleted file mode 100644
index 9a79749b80cb..000000000000
--- a/writerfilter/source/ooxml/OOXMLFastTokenHandler.hxx
+++ /dev/null
@@ -1,60 +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_WRITERFILTER_SOURCE_OOXML_OOXMLFASTTOKENHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFASTTOKENHANDLER_HXX
-
-#include "sal/config.h"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/implbase1.hxx"
-#include "com/sun/star/xml/sax/XFastTokenHandler.hpp"
-#include "sax/fastattribs.hxx"
-
-namespace writerfilter {
-namespace ooxml
-{
-
-class OOXMLFastTokenHandler:
- public ::cppu::WeakImplHelper1<
- css::xml::sax::XFastTokenHandler>,
- public sax_fastparser::FastTokenHandlerBase
-{
-public:
- explicit OOXMLFastTokenHandler();
-
- // ::com::sun::star::xml::sax::XFastTokenHandler:
- virtual ::sal_Int32 SAL_CALL getToken(const OUString & Identifier) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier(::sal_Int32 Token) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- // Much faster direct C++ shortcut to the method that matters
- virtual sal_Int32 getTokenDirect( const char *pToken, sal_Int32 nLength ) const SAL_OVERRIDE;
-
-private:
- OOXMLFastTokenHandler(OOXMLFastTokenHandler &); // not defined
- void operator =(OOXMLFastTokenHandler &); // not defined
-
- virtual ~OOXMLFastTokenHandler() {}
-};
-
-}}
-#endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFASTTOKENHANDLER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/ooxml/gperffasttokenhandler.py b/writerfilter/source/ooxml/gperffasttokenhandler.py
deleted file mode 100644
index 4da3418f701e..000000000000
--- a/writerfilter/source/ooxml/gperffasttokenhandler.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-#
-# 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/.
-#
-
-from __future__ import print_function
-import xml.sax
-import sys
-
-
-class ContentHandler(xml.sax.handler.ContentHandler):
- def __init__(self):
- self.inFasttoken = False
- self.chars = []
-
- def startElement(self, name, attrs):
- if name == "fasttoken":
- self.inFasttoken = True
-
- def endElement(self, name):
- if name == "fasttoken":
- chars = "".join(self.chars)
- token = chars.replace('-', '_')
- print("%s, oox::XML_%s" % (token, token))
- self.chars = []
- self.inFasttoken = False
-
- def characters(self, characters):
- if self.inFasttoken:
- self.chars.append(characters)
-
-print("""
-%{
-#include "oox/token/tokens.hxx"
-
-namespace writerfilter { namespace ooxml { namespace tokenmap {
-%}
-struct token { const char * name; Token_t nToken; };
-%%""")
-
-parser = xml.sax.make_parser()
-parser.setContentHandler(ContentHandler())
-parser.parse(sys.argv[1])
-
-print("""FAST_TOKENS_END, oox::XML_TOKEN_COUNT
-%%
-
-}}}""")
-
-# vim:set shiftwidth=4 softtabstop=4 expandtab: