From 7c0e3d0b37131b12262d0f610505b3384923c4a1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 9 Mar 2017 13:08:45 +0200 Subject: convert GraphicDrawMode to scoped enum Change-Id: I18eec89c4e1ebb86d64297e7cef4b36bf12df59f Reviewed-on: https://gerrit.libreoffice.org/35004 Tested-by: Jenkins Reviewed-by: Noel Grandin --- drawinglayer/source/primitive2d/graphicprimitive2d.cxx | 2 +- .../source/primitive2d/graphicprimitivehelper2d.cxx | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index e0b344a32130..d0935fcc676e 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -80,7 +80,7 @@ namespace drawinglayer Graphic aTransformedGraphic(rGraphicObject.GetGraphic()); const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get()); const bool isAdjusted(getGraphicAttr().IsAdjusted()); - const bool isDrawMode(GRAPHICDRAWMODE_STANDARD != getGraphicAttr().GetDrawMode()); + const bool isDrawMode(GraphicDrawMode::Standard != getGraphicAttr().GetDrawMode()); if(isBitmap && (isAdjusted || isDrawMode)) { diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 7014dcf67cfc..c2e574aef8b1 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -577,22 +577,22 @@ namespace drawinglayer // embeddings from here aRetval = rChildren; - if(GRAPHICDRAWMODE_WATERMARK == aGraphicDrawMode) + if(GraphicDrawMode::Watermark == aGraphicDrawMode) { // this is solved by applying fixed values additionally to luminance - // and contrast, do it here and reset DrawMode to GRAPHICDRAWMODE_STANDARD + // and contrast, do it here and reset DrawMode to GraphicDrawMode::Standard // original in svtools uses: // #define WATERMARK_LUM_OFFSET 50 // #define WATERMARK_CON_OFFSET -70 fLuminance = basegfx::clamp(fLuminance + 0.5, -1.0, 1.0); fContrast = basegfx::clamp(fContrast - 0.7, -1.0, 1.0); - aGraphicDrawMode = GRAPHICDRAWMODE_STANDARD; + aGraphicDrawMode = GraphicDrawMode::Standard; } - // DrawMode (GRAPHICDRAWMODE_WATERMARK already handled) + // DrawMode (GraphicDrawMode::Watermark already handled) switch(aGraphicDrawMode) { - case GRAPHICDRAWMODE_GREYS: + case GraphicDrawMode::Greys: { // convert to grey const Primitive2DReference aPrimitiveGrey( @@ -604,7 +604,7 @@ namespace drawinglayer aRetval = Primitive2DContainer { aPrimitiveGrey }; break; } - case GRAPHICDRAWMODE_MONO: + case GraphicDrawMode::Mono: { // convert to mono (black/white with threshold 0.5) const Primitive2DReference aPrimitiveBlackAndWhite( @@ -616,11 +616,11 @@ namespace drawinglayer aRetval = Primitive2DContainer { aPrimitiveBlackAndWhite }; break; } - default: // case GRAPHICDRAWMODE_STANDARD: + default: // case GraphicDrawMode::Standard: { assert( - aGraphicDrawMode != GRAPHICDRAWMODE_WATERMARK - && "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)"); + aGraphicDrawMode != GraphicDrawMode::Watermark + && "OOps, GraphicDrawMode::Watermark should already be handled (see above)"); // nothing to do break; } -- cgit