diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-16 10:11:04 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-12 22:06:19 -0400 |
commit | 2d2ae27b7e7aa147351655a40ed324b67cecf828 (patch) | |
tree | eb52bec1a946d147e3e8b9f3d5db6e250d533f85 /filter | |
parent | c5cdfe39d3afca716e7b11f8f8e169ce378861ea (diff) |
update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
(cherry picked from commit 2c8fe2e737b84ecd3dbac36a4fe6bd061bbd3bae)
Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Library_xmlfa.mk | 1 | ||||
-rw-r--r-- | filter/source/flash/swfwriter2.cxx | 36 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/cgmtypes.hxx | 11 | ||||
-rw-r--r-- | filter/source/svg/gfxtypes.hxx | 12 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.hxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.hxx | 17 | ||||
-rw-r--r-- | filter/source/xmlfilteradaptor/streamwrap.cxx | 59 | ||||
-rw-r--r-- | filter/source/xmlfilteradaptor/streamwrap.hxx | 58 |
8 files changed, 5 insertions, 193 deletions
diff --git a/filter/Library_xmlfa.mk b/filter/Library_xmlfa.mk index 0f6cddcfd385..e23cd7d2df74 100644 --- a/filter/Library_xmlfa.mk +++ b/filter/Library_xmlfa.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Library_use_libraries,xmlfa,\ $(eval $(call gb_Library_add_exception_objects,xmlfa,\ filter/source/xmlfilteradaptor/XmlFilterAdaptor \ filter/source/xmlfilteradaptor/genericfilter \ - filter/source/xmlfilteradaptor/streamwrap \ )) # vim: set noet sw=4 ts=4: diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 3649cceba7d7..4d4875cfd667 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -29,7 +29,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; - sal_uInt16 getMaxBitsUnsigned( sal_uInt32 nValue ) { sal_uInt16 nBits = 0; @@ -44,7 +43,6 @@ sal_uInt16 getMaxBitsUnsigned( sal_uInt32 nValue ) } - sal_uInt16 getMaxBitsSigned( sal_Int32 nValue ) { if( nValue < 0 ) @@ -54,7 +52,6 @@ sal_uInt16 getMaxBitsSigned( sal_Int32 nValue ) } - BitStream::BitStream() { mnBitPos = 8; @@ -62,7 +59,6 @@ BitStream::BitStream() } - void BitStream::writeUB( sal_uInt32 nValue, sal_uInt16 nBits ) { while( nBits != 0 ) @@ -86,21 +82,18 @@ void BitStream::writeUB( sal_uInt32 nValue, sal_uInt16 nBits ) } - void BitStream::writeSB( sal_Int32 nValue, sal_uInt16 nBits ) { writeUB( static_cast< sal_uInt32 >(nValue), nBits ); } - void BitStream::writeFB( sal_uInt32 nValue, sal_uInt16 nBits ) { writeUB( nValue, nBits ); } - void BitStream::pad() { if( 8 != mnBitPos ) @@ -112,7 +105,6 @@ void BitStream::pad() } - void BitStream::writeTo( SvStream& out ) { pad(); @@ -126,21 +118,18 @@ void BitStream::writeTo( SvStream& out ) } - sal_uInt32 BitStream::getOffset() const { return maData.size(); } - Tag::Tag( sal_uInt8 nTagId ) { mnTagId = nTagId; } - void Tag::write( SvStream &out ) { Seek( STREAM_SEEK_TO_END ); @@ -203,21 +192,18 @@ void Tag::addUI16( sal_uInt16 nValue ) } - void Tag::addUI8( sal_uInt8 nValue ) { WriteUChar( nValue ); } - void Tag::addBits( BitStream& rIn ) { rIn.writeTo( *this ); } - void Tag::addRGBA( const Color& rColor ) { addUI8( rColor.GetRed() ); @@ -227,7 +213,6 @@ void Tag::addRGBA( const Color& rColor ) } - void Tag::addRGB( const Color& rColor ) { addUI8( rColor.GetRed() ); @@ -236,14 +221,12 @@ void Tag::addRGB( const Color& rColor ) } - void Tag::addRect( const Rectangle& rRect ) { writeRect( *this, rRect ); } - void Tag::writeRect( SvStream& rOut, const Rectangle& rRect ) { BitStream aBits; @@ -293,14 +276,12 @@ void Tag::writeRect( SvStream& rOut, const Rectangle& rRect ) } - void Tag::addMatrix( const ::basegfx::B2DHomMatrix& rMatrix ) // #i73264# { writeMatrix( *this, rMatrix ); } - void Tag::writeMatrix( SvStream& rOut, const ::basegfx::B2DHomMatrix& rMatrix ) // #i73264# { @@ -342,7 +323,6 @@ void Tag::writeMatrix( SvStream& rOut, const ::basegfx::B2DHomMatrix& rMatrix ) } - void Tag::addString( const char* pString ) { if( pString ) @@ -355,21 +335,18 @@ void Tag::addString( const char* pString ) } - void Tag::addStream( SvStream& rIn ) { (*this).WriteStream( rIn ); } - Sprite::Sprite( sal_uInt16 nId ) : mnId( nId ), mnFrames(0) { } - Sprite::~Sprite() { for(vector< Tag* >::iterator i = maTags.begin(); i != maTags.end(); ++i) @@ -377,7 +354,6 @@ Sprite::~Sprite() } - void Sprite::write( SvStream& out ) { SvMemoryStream aTmp; @@ -397,7 +373,6 @@ void Sprite::write( SvStream& out ) } - void Sprite::addTag( Tag* pNewTag ) { if( pNewTag ) @@ -410,7 +385,6 @@ void Sprite::addTag( Tag* pNewTag ) } - sal_uInt32 swf::getFixed( double fValue ) { sal_Int16 nUpper = (sal_Int16)floor(fValue); @@ -423,7 +397,6 @@ sal_uInt32 swf::getFixed( double fValue ) } - /** constructs a new flash font for the given VCL Font */ FlashFont::FlashFont( const vcl::Font& rFont, sal_uInt16 nId ) : maFont( rFont ), mnNextIndex(0), mnId( nId ) @@ -431,13 +404,11 @@ FlashFont::FlashFont( const vcl::Font& rFont, sal_uInt16 nId ) } - FlashFont::~FlashFont() { } - /** gets the glyph id for the given character. The glyphs are created on demand */ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev ) { @@ -497,7 +468,6 @@ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev ) } - void FlashFont::write( SvStream& out ) { Tag aTag( TAG_DEFINEFONT ); @@ -516,7 +486,6 @@ void FlashFont::write( SvStream& out ) } - /** this c'tor creates a solid fill style */ FillStyle::FillStyle( const Color& rSolidColor ) : meType(solid ) @@ -526,7 +495,6 @@ FillStyle::FillStyle( const Color& rSolidColor ) } - /** this c'tor creates a tiled or clipped bitmap fill style */ FillStyle::FillStyle( sal_uInt16 nBitmapId, bool bClipped, const ::basegfx::B2DHomMatrix& rMatrix ) // #i73264# : meType( bClipped ? clipped_bitmap : tiled_bitmap ), @@ -536,7 +504,6 @@ FillStyle::FillStyle( sal_uInt16 nBitmapId, bool bClipped, const ::basegfx::B2DH } - FillStyle::FillStyleType Impl_getFillStyleType( const Gradient& rGradient ) { switch( rGradient.GetStyle() ) @@ -554,7 +521,6 @@ FillStyle::FillStyleType Impl_getFillStyleType( const Gradient& rGradient ) } - /** this c'tor creates a linear or radial gradient fill style */ FillStyle::FillStyle( const Rectangle& rBoundRect, const Gradient& rGradient ) : meType(Impl_getFillStyleType(rGradient)) @@ -565,7 +531,6 @@ FillStyle::FillStyle( const Rectangle& rBoundRect, const Gradient& rGradient ) } - void FillStyle::addTo( Tag* pTag ) const { pTag->addUI8( sal::static_int_cast<sal_uInt8>( meType ) ); @@ -587,7 +552,6 @@ void FillStyle::addTo( Tag* pTag ) const } - struct GradRecord { sal_uInt8 mnRatio; diff --git a/filter/source/graphicfilter/icgm/cgmtypes.hxx b/filter/source/graphicfilter/icgm/cgmtypes.hxx index 07e121d38b28..a90ede633883 100644 --- a/filter/source/graphicfilter/icgm/cgmtypes.hxx +++ b/filter/source/graphicfilter/icgm/cgmtypes.hxx @@ -25,7 +25,7 @@ struct FloatPoint double X; double Y; FloatPoint():X(0), Y(0){}; - FloatPoint( const double& rX, const double& rY ) { X = rX, Y = rY; }; + FloatPoint( const double& rX, const double& rY ) { X = rX; Y = rY; }; }; struct FloatRect @@ -35,13 +35,6 @@ struct FloatRect double Right; double Bottom; FloatRect():Left(0), Top(0), Right(0), Bottom(0){}; - FloatRect( const FloatPoint& rTopLeft, const FloatPoint& rBottomRight ) - { - Left = rTopLeft.X; - Top = rTopLeft.Y; - Right = rBottomRight.X; - Bottom = rBottomRight.Y; - } void Justify() { double fTemp; @@ -132,8 +125,6 @@ enum FillInteriorStyle { FIS_HOLLOW = 0, FIS_SOLID = 1, FIS_PATTERN = 2, FIS_HA FIS_INTERPOLATED = 6, FIS_GRADIENT = 7 }; - - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx index 3d502da9ccd9..e98399fb0f63 100644 --- a/filter/source/svg/gfxtypes.hxx +++ b/filter/source/svg/gfxtypes.hxx @@ -28,24 +28,12 @@ struct ARGBColor {} explicit ARGBColor(double fGrey) : a(1.0), r(fGrey), g(fGrey), b(fGrey) {} - ARGBColor( double r_, double g_, double b_ ) : - a(1.0), r(r_), g(g_), b(b_) - {} - ARGBColor( double a_, double r_, double g_, double b_ ) : - a(a_), r(r_), g(g_), b(b_) - {} ARGBColor( int r_, int g_, int b_ ) : a(1.0), r(toDoubleColor(sal::static_int_cast<sal_uInt8>(r_))), g(toDoubleColor(sal::static_int_cast<sal_uInt8>(g_))), b(toDoubleColor(sal::static_int_cast<sal_uInt8>(b_))) {} - ARGBColor( int a_, int r_, int g_, int b_ ) : - a(toDoubleColor(sal::static_int_cast<sal_uInt8>(a_))), - r(toDoubleColor(sal::static_int_cast<sal_uInt8>(r_))), - g(toDoubleColor(sal::static_int_cast<sal_uInt8>(g_))), - b(toDoubleColor(sal::static_int_cast<sal_uInt8>(b_))) - {} double a; double r; double g; diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 89544adb79ae..d34e7e55fb1b 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -119,10 +119,6 @@ protected: virtual void _ExportContent() override {} virtual void _ExportMasterStyles() override {} virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum /* eClass */ ) override { return 0; } - -private: - - SVGExport(); }; class ObjectRepresentation diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index d0d3312d078a..d6a8c2d78f27 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -61,7 +61,6 @@ #include <stack> #include <unordered_map> - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; @@ -71,8 +70,6 @@ using namespace ::com::sun::star::style; using namespace ::com::sun::star::svg; using namespace ::com::sun::star::xml::sax; - - #define SVG_DTD_STRING "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">" #define SVGWRITER_WRITE_FILL 0x00000001 @@ -151,6 +148,7 @@ class SVGActionWriter; class SVGExport; class SVGFontExport; + class SVGAttributeWriter { private: @@ -206,15 +204,11 @@ struct SVGShapeDescriptor }; - class SVGAttributeWriter; class SVGExport; class GDIMetaFile; - -// - BulletListItemInfo - - struct BulletListItemInfo { long nFontSize; @@ -224,9 +218,6 @@ struct BulletListItemInfo }; - -// - SVGTextWriter - - class SVGTextWriter { public: @@ -323,10 +314,9 @@ class SVGTextWriter void implRegisterInterface( const Reference< XInterface >& rxIf ); const OUString & implGetValidIDFromInterface( const Reference< XInterface >& rxIf ); -}; -// - SVGActionWriter - +}; class SVGActionWriter @@ -411,6 +401,7 @@ public: const GDIMetaFile* pTextEmbeddedBitmapMtf = nullptr ); }; + class SVGWriter : public cppu::WeakImplHelper< XSVGWriter > { private: @@ -429,6 +420,6 @@ public: throw( RuntimeException, std::exception ) override; }; -#endif +#endif // INCLUDED_FILTER_SOURCE_SVG_SVGWRITER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xmlfilteradaptor/streamwrap.cxx b/filter/source/xmlfilteradaptor/streamwrap.cxx deleted file mode 100644 index bcc2d97cb753..000000000000 --- a/filter/source/xmlfilteradaptor/streamwrap.cxx +++ /dev/null @@ -1,59 +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 "streamwrap.hxx" -#include <osl/file.hxx> - -namespace foo -{ - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::io; -using namespace ::com::sun::star::lang; -using namespace ::osl; - - -//= OOutputStreamWrapper - - -void SAL_CALL OOutputStreamWrapper::writeBytes(const css::uno::Sequence< sal_Int8 >& aData) throw( css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception ) -{ - sal_uInt64 nWritten = 0; - rStream.write(aData.getConstArray(),aData.getLength(),nWritten); - if (nWritten != (sal_uInt64)aData.getLength()) - { - throw css::io::BufferSizeExceededException(OUString(),static_cast<css::uno::XWeak*>(this)); - } -} - - -void SAL_CALL OOutputStreamWrapper::flush() throw( css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception ) -{ -} - - -void SAL_CALL OOutputStreamWrapper::closeOutput() throw( css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception ) -{ -} - -} // namespace utl - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xmlfilteradaptor/streamwrap.hxx b/filter/source/xmlfilteradaptor/streamwrap.hxx deleted file mode 100644 index 1f57e31573e0..000000000000 --- a/filter/source/xmlfilteradaptor/streamwrap.hxx +++ /dev/null @@ -1,58 +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_FILTER_SOURCE_XMLFILTERADAPTOR_STREAMWRAP_HXX -#define INCLUDED_FILTER_SOURCE_XMLFILTERADAPTOR_STREAMWRAP_HXX - -#include <osl/mutex.hxx> -#include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/io/XSeekable.hpp> -#include <cppuhelper/implbase.hxx> - -namespace osl -{ - class File; -} - -namespace foo -{ - -//= OOutputStreamWrapper - -typedef ::cppu::WeakImplHelper<css::io::XOutputStream> OutputStreamWrapper_Base; - // needed for some compilers -class OOutputStreamWrapper : public OutputStreamWrapper_Base -{ - ::osl::File& rStream; - -public: - explicit OOutputStreamWrapper(osl::File& _rStream) :rStream(_rStream) { } - -// css::io::XOutputStream - virtual void SAL_CALL writeBytes(const css::uno::Sequence< sal_Int8 >& aData) throw(css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL flush() throw(css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL closeOutput() throw(css::io::NotConnectedException, css::io::BufferSizeExceededException, css::uno::RuntimeException, std::exception) override; -}; - -} // namespace utl - - -#endif // INCLUDED_FILTER_SOURCE_XMLFILTERADAPTOR_STREAMWRAP_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |