diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-19 10:43:16 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-19 10:01:23 +0000 |
commit | e9af29ba8328cad918c5146e3cb1be0a72ebd791 (patch) | |
tree | bd90d8abd4bdcb3593410d845e0058745318a03f /xmlhelp | |
parent | First cut at adding sax2/ unit tests. (diff) | |
download | core-e9af29ba8328cad918c5146e3cb1be0a72ebd791.tar.gz core-e9af29ba8328cad918c5146e3cb1be0a72ebd791.zip |
loplugin:unusedmethods in writerfilter to xmloff
Change-Id: If95890eff0f785111e8b511ac1d5481c6910f099
Reviewed-on: https://gerrit.libreoffice.org/25148
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/Library_ucpchelp1.mk | 1 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx | 205 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx | 107 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2 |
4 files changed, 0 insertions, 315 deletions
diff --git a/xmlhelp/Library_ucpchelp1.mk b/xmlhelp/Library_ucpchelp1.mk index 0eb7d859f45d..e12aabf96326 100644 --- a/xmlhelp/Library_ucpchelp1.mk +++ b/xmlhelp/Library_ucpchelp1.mk @@ -43,7 +43,6 @@ $(eval $(call gb_Library_use_libraries,ucpchelp1,\ )) $(eval $(call gb_Library_add_exception_objects,ucpchelp1,\ - xmlhelp/source/cxxhelp/provider/bufferedinputstream \ xmlhelp/source/cxxhelp/provider/content \ xmlhelp/source/cxxhelp/provider/contentcaps \ xmlhelp/source/cxxhelp/provider/databases \ diff --git a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx deleted file mode 100644 index 79856b4c4bc9..000000000000 --- a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx +++ /dev/null @@ -1,205 +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 "bufferedinputstream.hxx" - -#include <cppuhelper/queryinterface.hxx> - -#include <string.h> - -using namespace cppu; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::io; -using namespace chelp; - - -BufferedInputStream::BufferedInputStream(const Reference<XInputStream>& xInputStream) - : m_nBufferLocation(0), - m_nBufferSize(0), - m_pBuffer(new sal_Int8[1]) // Initialize with one to avoid gcc compiler warnings -{ - try - { - sal_Int32 num; - sal_Int8 *tmp; - Sequence< sal_Int8 > aData(4096); - do{ - num = xInputStream->readBytes(aData,4096); - if( num > 0 ) - { - tmp = m_pBuffer; - m_pBuffer = new sal_Int8[m_nBufferSize+num]; - memcpy(static_cast<void *>(m_pBuffer), - static_cast<void *>(tmp), - sal_uInt32(m_nBufferSize)); - memcpy(static_cast<void *>(m_pBuffer+m_nBufferSize), - static_cast<void *>(aData.getArray()), - sal_uInt32(num)); - m_nBufferSize += num; - delete[] tmp; - } - } while( num == 4096 ); - } - catch( const NotConnectedException&) - { - } - catch( const BufferSizeExceededException&) - { - } - catch( const IOException&) - { - } - catch( const RuntimeException&) - { - } - xInputStream->closeInput(); -} - - -BufferedInputStream::~BufferedInputStream() -{ - delete[] m_pBuffer; -} - - -Any SAL_CALL BufferedInputStream::queryInterface( const Type& rType ) throw( RuntimeException, std::exception ) -{ - Any aRet = ::cppu::queryInterface( rType, - (static_cast< XInputStream* >(this)), - (static_cast< XSeekable* >(this)) ); - - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - - -void SAL_CALL BufferedInputStream::acquire() throw() -{ - OWeakObject::acquire(); -} - - -void SAL_CALL BufferedInputStream::release() throw() -{ - OWeakObject::release(); -} - - -sal_Int32 SAL_CALL BufferedInputStream::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException, std::exception) -{ - osl::MutexGuard aGuard( m_aMutex ); - - if( 0 > nBytesToRead ) - throw BufferSizeExceededException(); - - if( m_nBufferLocation + nBytesToRead > m_nBufferSize ) - nBytesToRead = m_nBufferSize - m_nBufferLocation; - - if( aData.getLength() < nBytesToRead ) - aData.realloc(nBytesToRead); - - memcpy(static_cast<void*>(aData.getArray()), - static_cast<void*>(m_pBuffer+m_nBufferLocation), - nBytesToRead); - - return nBytesToRead; -} - - -sal_Int32 SAL_CALL BufferedInputStream::readSomeBytes( - Sequence< sal_Int8 >& aData,sal_Int32 nMaxBytesToRead ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException, std::exception) -{ - return readBytes(aData,nMaxBytesToRead); -} - - -void SAL_CALL BufferedInputStream::skipBytes( sal_Int32 nBytesToSkip ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException, std::exception ) -{ - try - { - seek(m_nBufferLocation+nBytesToSkip); - } - catch( const IllegalArgumentException& ) - { - throw BufferSizeExceededException(); - } -} - - -sal_Int32 SAL_CALL BufferedInputStream::available() - throw( NotConnectedException, - IOException, - RuntimeException, std::exception ) -{ - osl::MutexGuard aGuard( m_aMutex ); - return m_nBufferSize-m_nBufferLocation; -} - - -void SAL_CALL BufferedInputStream::closeInput() - throw( NotConnectedException, - IOException, - RuntimeException, std::exception ) -{ -} - - -void SAL_CALL BufferedInputStream::seek( sal_Int64 location ) - throw( IllegalArgumentException, - IOException, - RuntimeException, std::exception ) -{ - if( 0 <= location && location < m_nBufferSize ) - { - osl::MutexGuard aGuard( m_aMutex ); - m_nBufferLocation = sal::static_int_cast<sal_Int32>( location ); - } - else - throw IllegalArgumentException(); -} - - -sal_Int64 SAL_CALL BufferedInputStream::getPosition() - throw( IOException, - RuntimeException, std::exception ) -{ - osl::MutexGuard aGuard( m_aMutex ); - return m_nBufferLocation; -} - - -sal_Int64 SAL_CALL BufferedInputStream::getLength() throw( IOException,RuntimeException, std::exception ) -{ - osl::MutexGuard aGuard( m_aMutex ); - return m_nBufferSize; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx deleted file mode 100644 index 643d4099eb93..000000000000 --- a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx +++ /dev/null @@ -1,107 +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_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX -#define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX - -#include <cppuhelper/weak.hxx> -#include <osl/mutex.hxx> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/io/XSeekable.hpp> - - -namespace chelp { - - class BufferedInputStream - : public cppu::OWeakObject, - public css::io::XInputStream, - public css::io::XSeekable - { - private: - - sal_Int32 m_nBufferLocation; - sal_Int32 m_nBufferSize; - sal_Int8 *m_pBuffer; - osl::Mutex m_aMutex; - - public: - - explicit BufferedInputStream( - const css::uno::Reference<css::io::XInputStream>& xInputStream); - - virtual ~BufferedInputStream(); - - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type& rType ) - throw( css::uno::RuntimeException, std::exception ) override; - - virtual void SAL_CALL acquire() throw() override; - - virtual void SAL_CALL release() throw() override; - - - virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& aData, - sal_Int32 nBytesToRead ) - throw( css::io::NotConnectedException, - css::io::BufferSizeExceededException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int32 SAL_CALL readSomeBytes( css::uno::Sequence< sal_Int8 >& aData, - sal_Int32 nMaxBytesToRead ) - throw( css::io::NotConnectedException, - css::io::BufferSizeExceededException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) - throw( css::io::NotConnectedException, - css::io::BufferSizeExceededException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int32 SAL_CALL available() - throw( css::io::NotConnectedException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual void SAL_CALL closeInput() - throw( css::io::NotConnectedException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual void SAL_CALL seek( sal_Int64 location ) - throw( css::lang::IllegalArgumentException, - css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int64 SAL_CALL getPosition() - throw( css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int64 SAL_CALL getLength() - throw( css::io::IOException, - css::uno::RuntimeException, std::exception ) override; - }; - -} - -#endif // INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index cbb49ef58e74..471ffc6a5008 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -18,8 +18,6 @@ */ -#include "bufferedinputstream.hxx" - #include <string.h> #include <osl/diagnose.hxx> #include <osl/thread.h> |