diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-05-10 05:45:30 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-05-10 05:45:30 -0700 |
commit | 67b28965f143d0f37697326a9250b328b287a22f (patch) | |
tree | 7c38e838eebe99d03072f1a1b95a170248ff102e /slideshow/source/engine/shapes/gdimtftools.cxx | |
parent | f8976086a437d3bb5b5263cf8c953f6047f6d28f (diff) |
GDIMetaFile cleanup
Plus trailing whitespace cleanup.
Diffstat (limited to 'slideshow/source/engine/shapes/gdimtftools.cxx')
-rw-r--r-- | slideshow/source/engine/shapes/gdimtftools.cxx | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 8c358c6a3..5265926f5 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -68,7 +68,7 @@ using namespace ::com::sun::star; namespace slideshow { -namespace internal +namespace internal { // TODO(E2): Detect the case when svx/drawing layer is not // in-process, or even not on the same machine, and @@ -87,8 +87,8 @@ bool hasUnsupportedActions( const GDIMetaFile& rMtf ) MetaAction* pCurrAct; // TODO(Q3): avoid const-cast - for( pCurrAct = const_cast<GDIMetaFile&>(rMtf).FirstAction(); - pCurrAct; + for( pCurrAct = const_cast<GDIMetaFile&>(rMtf).FirstAction(); + pCurrAct; pCurrAct = const_cast<GDIMetaFile&>(rMtf).NextAction() ) { switch( pCurrAct->GetType() ) @@ -118,12 +118,12 @@ namespace { typedef ::cppu::WeakComponentImplHelper1< graphic::XGraphicRenderer > DummyRenderer_Base; -class DummyRenderer : +class DummyRenderer : public DummyRenderer_Base, public cppu::BaseMutex { public: - DummyRenderer() : + DummyRenderer() : DummyRenderer_Base( m_aMutex ), mxGraphic() { @@ -147,11 +147,11 @@ public: GDIMetaFile getMtf( bool bForeignSource ) const { ::osl::MutexGuard aGuard( m_aMutex ); - + Graphic aGraphic( mxGraphic ); if( aGraphic.GetType() == GRAPHIC_BITMAP || - (bForeignSource && + (bForeignSource && hasUnsupportedActions(aGraphic.GetGDIMetaFile()) ) ) { // wrap bitmap into GDIMetafile @@ -178,10 +178,10 @@ private: }; } // anon namespace - + // Quick'n'dirty way: tunnel Graphic (only works for // in-process slideshow, of course) -bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, +bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, const uno::Reference< drawing::XDrawPage >& xContainingPage, GDIMetaFile& rMtf, int mtfLoadFlags, @@ -200,7 +200,7 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, uno::Reference< graphic::XGraphicRenderer > xRenderer( pRenderer ); // -> stuff that into UnoGraphicExporter. - uno::Reference<lang::XMultiComponentFactory> xFactory( + uno::Reference<lang::XMultiComponentFactory> xFactory( rxContext->getServiceManager() ); OSL_ENSURE( xFactory.is(), "### no UNO?!" ); @@ -209,7 +209,7 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, // creating the graphic exporter uno::Reference< document::XExporter > xExporter( - xFactory->createInstanceWithContext( + xFactory->createInstanceWithContext( OUSTR("com.sun.star.drawing.GraphicExportFilter"), rxContext), uno::UNO_QUERY ); @@ -232,7 +232,7 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, aFilterData[1].Name = OUSTR("ScrollText"); aFilterData[1].Value <<= ((mtfLoadFlags & MTF_LOAD_SCROLL_TEXT_MTF) != 0); - + aFilterData[2].Name = OUSTR("ExportOnlyBackground"); aFilterData[2].Value <<= ((mtfLoadFlags & MTF_LOAD_BACKGROUND_ONLY) != 0); @@ -267,7 +267,7 @@ void removeTextActions( GDIMetaFile& rMtf ) MetaAction* pCurrAct; int nActionIndex(0); - pCurrAct = rMtf.FirstAction(); + pCurrAct = rMtf.FirstAction(); while( pCurrAct ) { switch( pCurrAct->GetType() ) @@ -304,7 +304,7 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct ) // Special handling for actions that represent // more than one indexable action // =========================================== - + switch (pCurrAct->GetType()) { case META_TEXT_ACTION: { MetaTextAction * pAct = static_cast<MetaTextAction *>(pCurrAct); @@ -330,7 +330,7 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct ) // (though this is currently not used from the // DrawingLayer - shape transparency gradients // don't affect shape text) - return pAct->GetGDIMetaFile().GetActionCount(); + return pAct->GetGDIMetaFile().GetActionSize(); } default: return 1; @@ -350,7 +350,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // some loop invariants Animation aAnimation( rGraphic.GetAnimation() ); const Point aEmptyPoint; - const Size aAnimSize( aAnimation.GetDisplaySizePixel() ); + const Size aAnimSize( aAnimation.GetDisplaySizePixel() ); // setup VDev, into which all bitmaps are painted (want to // normalize animations to n bitmaps of same size. An Animation, @@ -399,24 +399,24 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, { case DISPOSE_NOT: { - aVDev.DrawBitmapEx(rAnimBmp.aPosPix, + aVDev.DrawBitmapEx(rAnimBmp.aPosPix, rAnimBmp.aBmpEx); Bitmap aMask = rAnimBmp.aBmpEx.GetMask(); if( aMask.IsEmpty() ) { const Point aEmpty; - const Rectangle aRect(aEmptyPoint, + const Rectangle aRect(aEmptyPoint, aVDevMask.GetOutputSizePixel()); const Wallpaper aWallpaper(COL_BLACK); - aVDevMask.DrawWallpaper(aRect, + aVDevMask.DrawWallpaper(aRect, aWallpaper); } else { - BitmapEx aTmpMask = BitmapEx(aMask, + BitmapEx aTmpMask = BitmapEx(aMask, aMask); - aVDevMask.DrawBitmapEx(rAnimBmp.aPosPix, + aVDevMask.DrawBitmapEx(rAnimBmp.aPosPix, aTmpMask ); } break; @@ -447,16 +447,16 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, case DISPOSE_FULL: { - aVDev.DrawBitmapEx(rAnimBmp.aPosPix, + aVDev.DrawBitmapEx(rAnimBmp.aPosPix, rAnimBmp.aBmpEx); break; } case DISPOSE_PREVIOUS : { - aVDev.DrawBitmapEx(rAnimBmp.aPosPix, + aVDev.DrawBitmapEx(rAnimBmp.aPosPix, rAnimBmp.aBmpEx); - aVDevMask.DrawBitmap(rAnimBmp.aPosPix, + aVDevMask.DrawBitmap(rAnimBmp.aPosPix, rAnimBmp.aBmpEx.GetMask()); break; } @@ -465,7 +465,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // extract current aVDev content into a new animation // frame GDIMetaFileSharedPtr pMtf( new GDIMetaFile() ); - pMtf->AddAction( + pMtf->AddAction( new MetaBmpExAction( aEmptyPoint, BitmapEx( aVDev.GetBitmap( @@ -490,13 +490,13 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // time to show first page (whole day) nWaitTime100thSeconds = 100 * 60 * 60 * 24; } - + // There are animated GIFs with no WaitTime set. Take 0.1 sec, the // same duration that is used by the edit view. if( nWaitTime100thSeconds == 0 ) nWaitTime100thSeconds = 10; - o_rFrames.push_back( MtfAnimationFrame( pMtf, + o_rFrames.push_back( MtfAnimationFrame( pMtf, nWaitTime100thSeconds / 100.0 ) ); } @@ -506,7 +506,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect, ::basegfx::B2DRectangle& o_rPaintRect, const GDIMetaFileSharedPtr& rMtf ) -{ +{ // extract bounds: scroll rect, paint rect bool bScrollRectSet(false); bool bPaintRectSet(false); |