diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-23 12:43:02 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-07-24 09:52:08 +0200 |
commit | dc7fc2074dd81f0960e6c112ead1cfe5bfd1bf4c (patch) | |
tree | ebbe8c4c405e651e0c9380f3fcc4bbf5288f7d32 /vcl/source | |
parent | 7bf70574e1e04f027c542733bee9d156e989fae6 (diff) |
convert WALLPAPER constants to scoped enum
Change-Id: I3b4b4e8a94904e22823a263bd5446a2e1aa47661
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 24 | ||||
-rw-r--r-- | vcl/source/gdi/wall.cxx | 32 | ||||
-rw-r--r-- | vcl/source/outdev/outdevstate.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/wallpaper.cxx | 26 | ||||
-rw-r--r-- | vcl/source/window/dockingarea.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 4 |
6 files changed, 47 insertions, 47 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 70a150263f4b..cd1109189aa0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -348,7 +348,7 @@ void doTestCode() aWriter.NewPage( 595, 842 ); aWriter.SetMapMode( MapMode( MAP_100TH_MM ) ); Wallpaper aWall( aTransMask ); - aWall.SetStyle( WALLPAPER_TILE ); + aWall.SetStyle( WallpaperStyle::Tile ); aWriter.DrawWallpaper( Rectangle( Point( 4400, 4200 ), Size( 10200, 6300 ) ), aWall ); aWriter.NewPage( 595, 842 ); @@ -11823,9 +11823,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal aBmpPos = aRect.TopLeft(); aBmpSize = aRect.GetSize(); } - if( rWall.GetStyle() != WALLPAPER_SCALE ) + if( rWall.GetStyle() != WallpaperStyle::Scale ) { - if( rWall.GetStyle() != WALLPAPER_TILE ) + if( rWall.GetStyle() != WallpaperStyle::Tile ) { bDrawBitmap = true; if( rWall.IsGradient() ) @@ -11834,33 +11834,33 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal bDrawColor = true; switch( rWall.GetStyle() ) { - case WALLPAPER_TOPLEFT: + case WallpaperStyle::TopLeft: break; - case WALLPAPER_TOP: + case WallpaperStyle::Top: aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; break; - case WALLPAPER_LEFT: + case WallpaperStyle::Left: aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; break; - case WALLPAPER_TOPRIGHT: + case WallpaperStyle::TopRight: aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); break; - case WALLPAPER_CENTER: + case WallpaperStyle::Center: aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; break; - case WALLPAPER_RIGHT: + case WallpaperStyle::Right: aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; break; - case WALLPAPER_BOTTOMLEFT: + case WallpaperStyle::BottomLeft: aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); break; - case WALLPAPER_BOTTOM: + case WallpaperStyle::Bottom: aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); break; - case WALLPAPER_BOTTOMRIGHT: + case WallpaperStyle::BottomRight: aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); break; diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index 847a5a1a34be..e462f2d37de5 100644 --- a/vcl/source/gdi/wall.cxx +++ b/vcl/source/gdi/wall.cxx @@ -36,7 +36,7 @@ ImplWallpaper::ImplWallpaper() : mpCache = NULL; mpGradient = NULL; mpRect = NULL; - meStyle = WALLPAPER_NULL; + meStyle = WallpaperStyle::NONE; } ImplWallpaper::ImplWallpaper( const ImplWallpaper& rImplWallpaper ) : @@ -148,7 +148,7 @@ SvStream& WriteImplWallpaper( SvStream& rOStm, const ImplWallpaper& rImplWallpap // version 1 WriteColor( rOStm, rImplWallpaper.maColor ); - rOStm.WriteUInt16( rImplWallpaper.meStyle ); + rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplWallpaper.meStyle) ); // version 2 rOStm.WriteBool( bRect ).WriteBool( bGrad ).WriteBool( bBmp ).WriteBool( bDummy ).WriteBool( bDummy ).WriteBool( bDummy ); @@ -207,7 +207,7 @@ Wallpaper::Wallpaper( const Color& rColor ) mpImplWallpaper = new ImplWallpaper; mpImplWallpaper->maColor = rColor; - mpImplWallpaper->meStyle = WALLPAPER_TILE; + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } Wallpaper::Wallpaper( const BitmapEx& rBmpEx ) @@ -215,7 +215,7 @@ Wallpaper::Wallpaper( const BitmapEx& rBmpEx ) mpImplWallpaper = new ImplWallpaper; mpImplWallpaper->mpBitmap = new BitmapEx( rBmpEx ); - mpImplWallpaper->meStyle = WALLPAPER_TILE; + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } Wallpaper::Wallpaper( const Gradient& rGradient ) @@ -223,7 +223,7 @@ Wallpaper::Wallpaper( const Gradient& rGradient ) mpImplWallpaper = new ImplWallpaper; mpImplWallpaper->mpGradient = new Gradient( rGradient ); - mpImplWallpaper->meStyle = WALLPAPER_TILE; + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } Wallpaper::~Wallpaper() @@ -245,8 +245,8 @@ void Wallpaper::SetColor( const Color& rColor ) ImplMakeUnique(); mpImplWallpaper->maColor = rColor; - if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle ) - mpImplWallpaper->meStyle = WALLPAPER_TILE; + if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle ) + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } const Color& Wallpaper::GetColor() const @@ -260,7 +260,7 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle ) ImplMakeUnique( false ); - if( eStyle == WALLPAPER_APPLICATIONGRADIENT ) + if( eStyle == WallpaperStyle::ApplicationGradient ) // set a dummy gradient, the correct gradient // will be created dynamically in GetGradient() SetGradient( ImplGetApplicationGradient() ); @@ -295,8 +295,8 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap ) mpImplWallpaper->mpBitmap = new BitmapEx( rBitmap ); } - if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle) - mpImplWallpaper->meStyle = WALLPAPER_TILE; + if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle) + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } BitmapEx Wallpaper::GetBitmap() const @@ -327,14 +327,14 @@ void Wallpaper::SetGradient( const Gradient& rGradient ) else mpImplWallpaper->mpGradient = new Gradient( rGradient ); - if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle ) - mpImplWallpaper->meStyle = WALLPAPER_TILE; + if( WallpaperStyle::NONE == mpImplWallpaper->meStyle || WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle ) + mpImplWallpaper->meStyle = WallpaperStyle::Tile; } Gradient Wallpaper::GetGradient() const { - if( WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle ) + if( WallpaperStyle::ApplicationGradient == mpImplWallpaper->meStyle ) return ImplGetApplicationGradient(); else if ( mpImplWallpaper->mpGradient ) return *(mpImplWallpaper->mpGradient); @@ -407,7 +407,7 @@ bool Wallpaper::IsRect() const bool Wallpaper::IsFixed() const { - if ( mpImplWallpaper->meStyle == WALLPAPER_NULL ) + if ( mpImplWallpaper->meStyle == WallpaperStyle::NONE ) return false; else return (!mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient); @@ -415,12 +415,12 @@ bool Wallpaper::IsFixed() const bool Wallpaper::IsScrollable() const { - if ( mpImplWallpaper->meStyle == WALLPAPER_NULL ) + if ( mpImplWallpaper->meStyle == WallpaperStyle::NONE ) return false; else if ( !mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient ) return true; else if ( mpImplWallpaper->mpBitmap ) - return (mpImplWallpaper->meStyle == WALLPAPER_TILE); + return (mpImplWallpaper->meStyle == WallpaperStyle::Tile); else return false; } diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index e1c649807a6a..ad8e8aef9f1d 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -466,7 +466,7 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground ) maBackground = rBackground; - if( rBackground.GetStyle() == WALLPAPER_NULL ) + if( rBackground.GetStyle() == WallpaperStyle::NONE ) mbBackground = false; else mbBackground = true; diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index adf935a57329..175f0d199eda 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -36,7 +36,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect, if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() ) return; - if ( rWallpaper.GetStyle() != WALLPAPER_NULL ) + if ( rWallpaper.GetStyle() != WallpaperStyle::NONE ) { Rectangle aRect = LogicToPixel( rRect ); aRect.Justify(); @@ -150,7 +150,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, bDrawColorBackground = true; } } - else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE ) + else if( eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale ) { if( rWallpaper.IsGradient() ) bDrawGradientBackground = true; @@ -187,7 +187,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, switch( eStyle ) { - case( WALLPAPER_SCALE ): + case( WallpaperStyle::Scale ): if( !pCached || ( pCached->GetSizePixel() != aSize ) ) { if( pCached ) @@ -199,41 +199,41 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, } break; - case( WALLPAPER_TOPLEFT ): + case( WallpaperStyle::TopLeft ): break; - case( WALLPAPER_TOP ): + case( WallpaperStyle::Top ): aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; break; - case( WALLPAPER_TOPRIGHT ): + case( WallpaperStyle::TopRight ): aPos.X() += ( aSize.Width() - nBmpWidth ); break; - case( WALLPAPER_LEFT ): + case( WallpaperStyle::Left ): aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; break; - case( WALLPAPER_CENTER ): + case( WallpaperStyle::Center ): aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; break; - case( WALLPAPER_RIGHT ): + case( WallpaperStyle::Right ): aPos.X() += ( aSize.Width() - nBmpWidth ); aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; break; - case( WALLPAPER_BOTTOMLEFT ): + case( WallpaperStyle::BottomLeft ): aPos.Y() += ( aSize.Height() - nBmpHeight ); break; - case( WALLPAPER_BOTTOM ): + case( WallpaperStyle::Bottom ): aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; aPos.Y() += ( aSize.Height() - nBmpHeight ); break; - case( WALLPAPER_BOTTOMRIGHT ): + case( WallpaperStyle::BottomRight ): aPos.X() += ( aSize.Width() - nBmpWidth ); aPos.Y() += ( aSize.Height() - nBmpHeight ); break; @@ -245,7 +245,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, long nFirstX; long nFirstY; - if( eStyle == WALLPAPER_TILE ) + if( eStyle == WallpaperStyle::Tile ) { nFirstX = aPos.X(); nFirstY = aPos.Y(); diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index aa88007b7a40..e847685278e3 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -128,9 +128,9 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext) { Wallpaper aWallpaper(rPersonaBitmap); if (GetAlign() == WINDOWALIGN_TOP) - aWallpaper.SetStyle(WALLPAPER_TOPRIGHT); + aWallpaper.SetStyle(WallpaperStyle::TopRight); else - aWallpaper.SetStyle(WALLPAPER_BOTTOMRIGHT); + aWallpaper.SetStyle(WallpaperStyle::BottomRight); aWallpaper.SetColor(rSetting.GetWorkspaceColor()); // we need to shift the bitmap vertically so that it spans over the @@ -152,7 +152,7 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext) else if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL)) { Wallpaper aWallpaper; - aWallpaper.SetStyle(WALLPAPER_APPLICATIONGRADIENT); + aWallpaper.SetStyle(WallpaperStyle::ApplicationGradient); rRenderContext.SetBackground(aWallpaper); } else diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 87bb541b1636..c6a0783bb2f3 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -1054,7 +1054,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext) if (!rPersonaBitmap.IsEmpty()) { Wallpaper aWallpaper(rPersonaBitmap); - aWallpaper.SetStyle(WALLPAPER_TOPRIGHT); + aWallpaper.SetStyle(WallpaperStyle::TopRight); aWallpaper.SetColor(Application::GetSettings().GetStyleSettings().GetWorkspaceColor()); rRenderContext.SetBackground(aWallpaper); @@ -1068,7 +1068,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext) else { Wallpaper aWallpaper; - aWallpaper.SetStyle(WALLPAPER_APPLICATIONGRADIENT); + aWallpaper.SetStyle(WallpaperStyle::ApplicationGradient); rRenderContext.SetBackground(aWallpaper); SetPaintTransparent(false); SetParentClipMode(ParentClipMode::NONE); |