From b7c41f1d1fcabc8f4abc670d5a18546a117b540a Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 18 Sep 2012 18:06:36 +0200 Subject: unusedcode: FastSaxSerializer is not used through UNO Change-Id: I07d7b78be200f5f4a0674361237ef45b2bd1e3e1 Reviewed-on: https://gerrit.libreoffice.org/651 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- offapi/UnoApi_offapi.mk | 1 - offapi/com/sun/star/xml/sax/XFastSerializer.idl | 165 ------------------------ sax/source/tools/fastserializer.cxx | 97 -------------- sax/source/tools/fastserializer.hxx | 93 ++++++++----- unusedcode.easy | 1 - 5 files changed, 61 insertions(+), 296 deletions(-) delete mode 100644 offapi/com/sun/star/xml/sax/XFastSerializer.idl diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index e5606da48aa5..b053b9bd346e 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -4241,7 +4241,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/xml/sax,\ XFastDocumentHandler \ XFastParser \ XFastSAXSerializable \ - XFastSerializer \ XFastShapeContextHandler \ XFastTokenHandler \ XLocator \ diff --git a/offapi/com/sun/star/xml/sax/XFastSerializer.idl b/offapi/com/sun/star/xml/sax/XFastSerializer.idl deleted file mode 100644 index 6601a00cfbf1..000000000000 --- a/offapi/com/sun/star/xml/sax/XFastSerializer.idl +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __com_sun_star_xml_sax_XFastSerializer_idl__ -#define __com_sun_star_xml_sax_XFastSerializer_idl__ - -#include -#include -#include -#include -#include - - -module com { module sun { module star { module xml { module sax { - - -/** receives notification of sax document events to write into an XOutputStream. - */ -interface XFastSerializer: com::sun::star::uno::XInterface -{ - - /** called by the parser when parsing of an XML stream is started. - */ - void startDocument() - raises( com::sun::star::xml::sax::SAXException ); - - - /** called by the parser after the last XML element of a stream is processed. - */ - void endDocument() - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the beginning of an element . - - @param Element - contains the integer token from the XFastTokenHandler - registered at the XFastParser.
- - If the element has a namespace that was registered with the - XFastParser, Element contains the integer - token of the elements local name from the XFastTokenHandler - and the integer token of the namespace combined with an arithmetic - or operation. - - @param Attribs - Contains a XFastAttrbitueList to access the attributes - from the element. - - */ - void startFastElement( [in] long Element, [in] XFastAttributeList Attribs ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the beginning of an unknown element . - - @param Namespace - contains the namespace url (not the prefix!) of this element. - @param Name - contains the elements local name. - @param Attribs - Contains a XFastAttrbitueList to access the attributes - from the element. - */ - void startUnknownElement( [in] string Namespace, [in] string Name, [in] XFastAttributeList Attribs ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the end of an known element. - @see startFastElement - */ - void endFastElement( [in] long Element ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the end of an known element. - @see startUnknownElement - */ - void endUnknownElement( [in] string Namespace, [in] string Name ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the beginning of a single element . - - @param Element - contains the integer token from the XFastTokenHandler - registered at the XFastParser.
- - If the element has a namespace that was registered with the - XFastParser, Element contains the integer - token of the elements local name from the XFastTokenHandler - and the integer token of the namespace combined with an arithmetic - or operation. - - @param Attribs - Contains a XFastAttrbitueList to access the attributes - from the element. - - */ - void singleFastElement( [in] long Element, [in] XFastAttributeList Attribs ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of the beginning of a single unknown element . - - @param Namespace - contains the namespace url (not the prefix!) of this element. - @param Name - contains the elements local name. - @param Attribs - Contains a XFastAttrbitueList to access the attributes - from the element. - */ - void singleUnknownElement( [in] string Namespace, [in] string Name, [in] XFastAttributeList Attribs ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** receives notification of character data. - */ - void characters( [in] string aChars ) - raises( com::sun::star::xml::sax::SAXException ); - - - /** - */ - void setOutputStream ( [in] com::sun::star::io::XOutputStream xOutputStream ) - /* raises( com::sun::star::xml::sax::SAXException ) */; - - - /** - */ - void setFastTokenHandler ( [in] com::sun::star::xml::sax::XFastTokenHandler xFastTokenHandler ) - /* raises( com::sun::star::xml::sax::SAXException ) */; - }; - - -}; }; }; }; }; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index bd84747cb527..d12e7711acc1 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -45,8 +45,6 @@ using ::com::sun::star::xml::FastAttribute; using ::com::sun::star::xml::Attribute; using ::com::sun::star::xml::sax::SAXException; using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastTokenHandler; -using ::com::sun::star::xml::sax::XFastSerializer; using ::com::sun::star::io::XOutputStream; using ::com::sun::star::io::NotConnectedException; using ::com::sun::star::io::IOException; @@ -145,27 +143,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maClosingBracket)); } - void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracket)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeFastAttributeList(Attribs); - - writeBytes(toUnoSequence(maClosingBracket)); - } - void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element ) throw (SAXException, RuntimeException) { @@ -179,25 +156,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maClosingBracket)); } - void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracketAndSlash)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeBytes(toUnoSequence(maClosingBracket)); - } - void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs ) throw (SAXException, RuntimeException) { @@ -215,27 +173,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maSlashAndClosingBracket)); } - void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracket)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeFastAttributeList(Attribs); - - writeBytes(toUnoSequence(maSlashAndClosingBracket)); - } - void SAL_CALL FastSaxSerializer::characters( const OUString& aChars ) throw (SAXException, RuntimeException) { @@ -289,40 +226,6 @@ namespace sax_fastparser { } } - // XServiceInfo - OUString FastSaxSerializer::getImplementationName() throw (RuntimeException) - { - return OUString( SERIALIZER_IMPLEMENTATION_NAME ); - } - - // XServiceInfo - sal_Bool FastSaxSerializer::supportsService(const OUString& ServiceName) throw (RuntimeException) - { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; - } - - // XServiceInfo - Sequence< OUString > FastSaxSerializer::getSupportedServiceNames(void) throw (RuntimeException) - { - Sequence seq(1); - seq.getArray()[0] = OUString( SERIALIZER_SERVICE_NAME ); - return seq; - } - - Sequence< OUString > FastSaxSerializer::getSupportedServiceNames_Static(void) - { - Sequence aRet(1); - aRet.getArray()[0] = OUString( SERIALIZER_SERVICE_NAME ); - return aRet; - } - void FastSaxSerializer::mark( Int32Sequence aOrder ) { if ( aOrder.hasElements() ) diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index 13e047e5a373..b80f1ccaecc2 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -20,11 +20,8 @@ #ifndef SAX_FASTSERIALIZER_HXX #define SAX_FASTSERIALIZER_HXX -#include #include -#include #include -#include #include #include @@ -34,54 +31,86 @@ #include "sax/fshelper.hxx" -#define SERIALIZER_IMPLEMENTATION_NAME "com.sun.star.comp.extensions.xml.sax.FastSerializer" -#define SERIALIZER_SERVICE_NAME "com.sun.star.xml.sax.FastSerializer" - namespace sax_fastparser { -class FastSaxSerializer : public ::cppu::WeakImplHelper2< ::com::sun::star::xml::sax::XFastSerializer, ::com::sun::star::lang::XServiceInfo > +/// Receives notification of sax document events to write into an XOutputStream. +class FastSaxSerializer { typedef ::com::sun::star::uno::Sequence< ::sal_Int8 > Int8Sequence; typedef ::com::sun::star::uno::Sequence< ::sal_Int32 > Int32Sequence; public: - explicit FastSaxSerializer( ); - virtual ~FastSaxSerializer(); + explicit FastSaxSerializer(); + ~FastSaxSerializer(); ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > getOutputStream() {return mxOutputStream;} - // The implementation details - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void); + /** called by the parser when parsing of an XML stream is started. + */ + void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - // XFastSerializer - virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name ) + /** called by the parser after the last XML element of a stream is processed. + */ + void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); + + /** receives notification of the beginning of an element. + + @param Element + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + If the element has a namespace that was registered with the + XFastParser, Element contains the integer + token of the elements local name from the XFastTokenHandler + and the integer token of the namespace combined with an arithmetic + or operation. + + @param Attribs + Contains a XFastAttrbitueList to access the attributes + from the element. + + */ + void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL singleFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) + + /** receives notification of the end of an known element. + @see startFastElement + */ + void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL singleUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) + + /** receives notification of the beginning of a single element. + + @param Element + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + If the element has a namespace that was registered with the + XFastParser, Element contains the integer + token of the elements local name from the XFastTokenHandler + and the integer token of the namespace combined with an arithmetic + or operation. + + @param Attribs + Contains a XFastAttrbitueList to access the attributes + from the element. + + */ + void SAL_CALL singleFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) + + /// receives notification of character data. + void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setFastTokenHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xFastTokenHandler ) + + void SAL_CALL setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream ) throw (::com::sun::star::uno::RuntimeException); - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw ( ::com::sun::star::uno::RuntimeException ); + void SAL_CALL setFastTokenHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xFastTokenHandler ) + throw (::com::sun::star::uno::RuntimeException); // C++ helpers - virtual void SAL_CALL writeId( ::sal_Int32 Element ); + void SAL_CALL writeId( ::sal_Int32 Element ); static ::rtl::OUString escapeXml( const ::rtl::OUString& s ); diff --git a/unusedcode.easy b/unusedcode.easy index cdb8a53273e4..54dca39057e3 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -97,7 +97,6 @@ ooo::vba::excel::GetDocShellFromRanges(com::sun::star::uno::Reference const&) oox::drawingml::TextParagraphProperties::dump() const oox::xls::BiffDrawingObjectBase::BiffDrawingObjectBase(oox::xls::WorksheetHelper const&) -sax_fastparser::FastSaxSerializer::getSupportedServiceNames_Static() sd::ClientBox::GetMinOutputSizePixel() const sd::ClientBox::RemoveUnlocked() sd::ClientBox::SetScrollHdl(Link const&) -- cgit v1.2.3