diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-09 08:45:51 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-13 09:37:12 +0200 |
commit | 26ec80f47df1b32c5e1ae8c96d597ef8c90fee86 (patch) | |
tree | 11b53e701f50ff170552054ef7d23136cd4710b6 /cppcanvas | |
parent | b5f5a386504e320b022f8609c9c36652ae2d3d18 (diff) |
loplugin:staticmethods
Change-Id: I33a8ca28b0c3bf1c31758d93238e74927bebde9c
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/inc/implrenderer.hxx | 20 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfplus.cxx | 6 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 8 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 2 | ||||
-rw-r--r-- | cppcanvas/source/uno/uno_mtfrenderer.cxx | 5 | ||||
-rw-r--r-- | cppcanvas/source/wrapper/basegfxfactory.cxx | 26 | ||||
-rw-r--r-- | cppcanvas/source/wrapper/vclfactory.cxx | 28 |
7 files changed, 27 insertions, 68 deletions
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 1aa88f199f84..7514bc4205b5 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -219,8 +219,8 @@ static float GetSwapFloat( SvStream& rSt ) typedef ::std::vector< MtfAction > ActionVector; /* EMF+ */ - void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); - void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags); + static void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); + static void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags); void MapToDevice (double &x, double &y); ::basegfx::B2DPoint Map (double ix, double iy); ::basegfx::B2DSize MapSize (double iwidth, double iheight); @@ -231,18 +231,18 @@ static float GetSwapFloat( SvStream& rSt ) ImplRenderer(const ImplRenderer&) SAL_DELETED_FUNCTION; ImplRenderer& operator=( const ImplRenderer& ) SAL_DELETED_FUNCTION; - void updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly, + static void updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly, const ActionFactoryParameters& rParms, bool bIntersect ); - void updateClipping( const ::Rectangle& rClipRect, + static void updateClipping( const ::Rectangle& rClipRect, const ActionFactoryParameters& rParms, bool bIntersect ); - ::com::sun::star::uno::Reference< + static ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > createFont( double& o_rFontRotation, const ::vcl::Font& rFont, - const ActionFactoryParameters& rParms ) const; + const ActionFactoryParameters& rParms ); bool createActions( GDIMetaFile& rMtf, const ActionFactoryParameters& rParms, bool bSubsettableActions ); @@ -250,13 +250,13 @@ static float GetSwapFloat( SvStream& rSt ) const ActionFactoryParameters& rParms ); bool createFillAndStroke( const ::basegfx::B2DPolygon& rPoly, const ActionFactoryParameters& rParms ); - void skipContent( GDIMetaFile& rMtf, + static void skipContent( GDIMetaFile& rMtf, const char* pCommentString, - sal_Int32& io_rCurrActionIndex ) const; + sal_Int32& io_rCurrActionIndex ); - bool isActionContained( GDIMetaFile& rMtf, + static bool isActionContained( GDIMetaFile& rMtf, const char* pCommentString, - sal_uInt16 nType ) const; + sal_uInt16 nType ); void createGradientAction( const ::tools::PolyPolygon& rPoly, const ::Gradient& rGradient, diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index c5cf98172231..5afa0b27d691 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1880,7 +1880,7 @@ namespace cppcanvas float dx, dy, dw, dh; - ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); + ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000)); SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh); @@ -1939,7 +1939,7 @@ namespace cppcanvas float dx, dy, dw, dh; - ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); + ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000)); SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh); @@ -2098,7 +2098,7 @@ namespace cppcanvas } else if (type == EmfPlusRecordTypeDrawImage) { float dx, dy, dw, dh; - ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); + ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000)); SAL_INFO("cppcanvas.emf", "EMF+ destination rectangle: " << dx << "," << dy << " " << dw << "x" << dh); diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index edc3a6ef887d..9e93995ed2af 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -419,7 +419,7 @@ namespace cppcanvas void ImplRenderer::skipContent( GDIMetaFile& rMtf, const char* pCommentString, - sal_Int32& io_rCurrActionIndex ) const + sal_Int32& io_rCurrActionIndex ) { ENSURE_OR_THROW( pCommentString, "ImplRenderer::skipContent(): NULL string given" ); @@ -445,7 +445,7 @@ namespace cppcanvas bool ImplRenderer::isActionContained( GDIMetaFile& rMtf, const char* pCommentString, - sal_uInt16 nType ) const + sal_uInt16 nType ) { ENSURE_OR_THROW( pCommentString, "ImplRenderer::isActionContained(): NULL string given" ); @@ -754,7 +754,7 @@ namespace cppcanvas uno::Reference< rendering::XCanvasFont > ImplRenderer::createFont( double& o_rFontRotation, const vcl::Font& rFont, - const ActionFactoryParameters& rParms ) const + const ActionFactoryParameters& rParms ) { rendering::FontRequest aFontRequest; @@ -2688,7 +2688,7 @@ namespace cppcanvas { } - bool result() const + static bool result() { return true; // nothing can fail here } diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index fa91a85f1c3f..8237a12216b4 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -350,7 +350,7 @@ namespace cppcanvas // update buffered bitmap and transformation - BitmapSharedPtr aBmp( VCLFactory::getInstance().createBitmap( + BitmapSharedPtr aBmp( VCLFactory::createBitmap( mpCanvas, aVDev.GetBitmapEx( aEmptyPoint, diff --git a/cppcanvas/source/uno/uno_mtfrenderer.cxx b/cppcanvas/source/uno/uno_mtfrenderer.cxx index ea9fe16d64f6..ba220ab08342 100644 --- a/cppcanvas/source/uno/uno_mtfrenderer.cxx +++ b/cppcanvas/source/uno/uno_mtfrenderer.cxx @@ -22,9 +22,8 @@ void MtfRenderer::setMetafile (const uno::Sequence< sal_Int8 >& /*rMtf*/) throw void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeException, std::exception) { if (mpMetafile && mxCanvas.get()) { - cppcanvas::VCLFactory& factory = cppcanvas::VCLFactory::getInstance(); - cppcanvas::BitmapCanvasSharedPtr canvas = factory.createBitmapCanvas (mxCanvas); - cppcanvas::RendererSharedPtr renderer = factory.createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ()); + cppcanvas::BitmapCanvasSharedPtr canvas = cppcanvas::VCLFactory::createBitmapCanvas (mxCanvas); + cppcanvas::RendererSharedPtr renderer = cppcanvas::VCLFactory::createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ()); ::basegfx::B2DHomMatrix aMatrix; aMatrix.scale( fScaleX, fScaleY ); canvas->setTransformation( aMatrix ); diff --git a/cppcanvas/source/wrapper/basegfxfactory.cxx b/cppcanvas/source/wrapper/basegfxfactory.cxx index 0cca17086d34..f72394be8252 100644 --- a/cppcanvas/source/wrapper/basegfxfactory.cxx +++ b/cppcanvas/source/wrapper/basegfxfactory.cxx @@ -44,28 +44,8 @@ using namespace ::com::sun::star; namespace cppcanvas { - /* Singleton handling */ - struct InitInstance2 - { - BaseGfxFactory* operator()() - { - return new BaseGfxFactory(); - } - }; - - BaseGfxFactory& BaseGfxFactory::getInstance() - { - return *rtl_Instance< BaseGfxFactory, InitInstance2, ::osl::MutexGuard, - ::osl::GetGlobalMutex >::create( - InitInstance2(), ::osl::GetGlobalMutex()); - } - - BaseGfxFactory::BaseGfxFactory() - { - } - PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas, - const ::basegfx::B2DPolygon& rPoly ) const + const ::basegfx::B2DPolygon& rPoly ) { OSL_ENSURE( rCanvas.get() != NULL && rCanvas->getUNOCanvas().is(), @@ -86,7 +66,7 @@ namespace cppcanvas } BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas, - const ::basegfx::B2ISize& rSize ) const + const ::basegfx::B2ISize& rSize ) { OSL_ENSURE( rCanvas.get() != NULL && rCanvas->getUNOCanvas().is(), @@ -106,7 +86,7 @@ namespace cppcanvas } BitmapSharedPtr BaseGfxFactory::createAlphaBitmap( const CanvasSharedPtr& rCanvas, - const ::basegfx::B2ISize& rSize ) const + const ::basegfx::B2ISize& rSize ) { OSL_ENSURE( rCanvas.get() != NULL && rCanvas->getUNOCanvas().is(), diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx index 0b5f7c33fd80..669aabfc16e3 100644 --- a/cppcanvas/source/wrapper/vclfactory.cxx +++ b/cppcanvas/source/wrapper/vclfactory.cxx @@ -39,26 +39,6 @@ using namespace ::com::sun::star; namespace cppcanvas { - /* Singleton handling */ - struct InitInstance - { - VCLFactory* operator()() - { - return new VCLFactory(); - } - }; - - VCLFactory& VCLFactory::getInstance() - { - return *rtl_Instance< VCLFactory, InitInstance, ::osl::MutexGuard, - ::osl::GetGlobalMutex >::create( - InitInstance(), ::osl::GetGlobalMutex()); - } - - VCLFactory::VCLFactory() - { - } - CanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XCanvas >& xCanvas ) { return CanvasSharedPtr( @@ -71,7 +51,7 @@ namespace cppcanvas new internal::ImplBitmapCanvas( xCanvas ) ); } - SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const vcl::Window& rVCLWindow ) const + SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const vcl::Window& rVCLWindow ) { return SpriteCanvasSharedPtr( new internal::ImplSpriteCanvas( @@ -80,14 +60,14 @@ namespace cppcanvas uno::UNO_QUERY) ) ); } - SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& xCanvas ) const + SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& xCanvas ) { return SpriteCanvasSharedPtr( new internal::ImplSpriteCanvas( xCanvas ) ); } BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr& rCanvas, - const ::BitmapEx& rBmpEx ) const + const ::BitmapEx& rBmpEx ) { OSL_ENSURE( rCanvas.get() != NULL && rCanvas->getUNOCanvas().is(), @@ -108,7 +88,7 @@ namespace cppcanvas RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr& rCanvas, const ::GDIMetaFile& rMtf, - const Renderer::Parameters& rParms ) const + const Renderer::Parameters& rParms ) { return RendererSharedPtr( new internal::ImplRenderer( rCanvas, rMtf, |