summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-23 12:43:02 +0200
committerNoel Grandin <noel@peralex.com>2015-07-24 09:52:08 +0200
commitdc7fc2074dd81f0960e6c112ead1cfe5bfd1bf4c (patch)
treeebbe8c4c405e651e0c9380f3fcc4bbf5288f7d32 /drawinglayer
parent7bf70574e1e04f027c542733bee9d156e989fae6 (diff)
convert WALLPAPER constants to scoped enum
Change-Id: I3b4b4e8a94904e22823a263bd5446a2e1aa47661
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx28
2 files changed, 16 insertions, 16 deletions
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 25854db1f9c4..09bc2cc99247 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1149,7 +1149,7 @@ namespace
// if bitmap visualisation is transparent, maybe background
// needs to be filled. Create background
if(aBitmapEx.IsTransparent()
- || (WALLPAPER_TILE != eWallpaperStyle && WALLPAPER_SCALE != eWallpaperStyle))
+ || (WallpaperStyle::Tile != eWallpaperStyle && WallpaperStyle::Scale != eWallpaperStyle))
{
if(rWallpaper.IsGradient())
{
@@ -2375,7 +2375,7 @@ namespace
aWallpaperRectangle.Left(), aWallpaperRectangle.Top(),
aWallpaperRectangle.Right(), aWallpaperRectangle.Bottom());
- if(WALLPAPER_NULL != eWallpaperStyle)
+ if(WallpaperStyle::NONE != eWallpaperStyle)
{
if(rWallpaper.IsBitmap())
{
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 63d8f7ef02f9..4f631c9788f1 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -44,7 +44,7 @@ namespace drawinglayer
if(rPixelSize.Width() > 0 && rPixelSize.Height() > 0)
{
- if(WALLPAPER_SCALE == getWallpaperStyle())
+ if(WallpaperStyle::Scale == getWallpaperStyle())
{
// shortcut for scale; use simple BitmapPrimitive2D
basegfx::B2DHomMatrix aObjectTransform;
@@ -76,64 +76,64 @@ namespace drawinglayer
switch(getWallpaperStyle())
{
- default: //case WALLPAPER_TILE :, also WALLPAPER_NULL and WALLPAPER_APPLICATIONGRADIENT
+ default: //case WallpaperStyle::Tile :, also WallpaperStyle::NONE and WallpaperStyle::ApplicationGradient
{
bUseTargetTopLeft = false;
break;
}
- case WALLPAPER_SCALE :
+ case WallpaperStyle::Scale :
{
// handled by shortcut above
break;
}
- case WALLPAPER_TOPLEFT :
+ case WallpaperStyle::TopLeft :
{
// nothing to do
break;
}
- case WALLPAPER_TOP :
+ case WallpaperStyle::Top :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5));
break;
}
- case WALLPAPER_TOPRIGHT :
+ case WallpaperStyle::TopRight :
{
aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX());
break;
}
- case WALLPAPER_LEFT :
+ case WallpaperStyle::Left :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5));
break;
}
- case WALLPAPER_CENTER :
+ case WallpaperStyle::Center :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft = aCenter - (aLogicSize * 0.5);
break;
}
- case WALLPAPER_RIGHT :
+ case WallpaperStyle::Right :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX());
aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5));
break;
}
- case WALLPAPER_BOTTOMLEFT :
+ case WallpaperStyle::BottomLeft :
{
aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY());
break;
}
- case WALLPAPER_BOTTOM :
+ case WallpaperStyle::Bottom :
{
const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter());
aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5));
aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY());
break;
}
- case WALLPAPER_BOTTOMRIGHT :
+ case WallpaperStyle::BottomRight :
{
aTargetTopLeft = getLocalObjectRange().getMaximum() - aLogicSize;
break;
@@ -164,14 +164,14 @@ namespace drawinglayer
}
else
{
- // WALLPAPER_TILE, WALLPAPER_NULL, WALLPAPER_APPLICATIONGRADIENT
+ // WallpaperStyle::Tile, WallpaperStyle::NONE, WallpaperStyle::ApplicationGradient
// convert to relative positions
const basegfx::B2DVector aRelativeSize(
aLogicSize.getX() / (getLocalObjectRange().getWidth() ? getLocalObjectRange().getWidth() : 1.0),
aLogicSize.getY() / (getLocalObjectRange().getHeight() ? getLocalObjectRange().getHeight() : 1.0));
basegfx::B2DPoint aRelativeTopLeft(0.0, 0.0);
- if(WALLPAPER_TILE != getWallpaperStyle())
+ if(WallpaperStyle::Tile != getWallpaperStyle())
{
aRelativeTopLeft.setX(0.5 - aRelativeSize.getX());
aRelativeTopLeft.setY(0.5 - aRelativeSize.getY());