From 8689bd5490b473a7ffb149bbe5f7f0683f679c72 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 29 Jul 2021 20:49:29 +0100 Subject: convert TextAlign to scoped enum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- drawinglayer/source/primitive2d/textlayoutdevice.cxx | 2 +- drawinglayer/source/tools/wmfemfhelper.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drawinglayer/source') diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 933476b2045a..dff9d3558d89 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -367,7 +367,7 @@ vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttri Size(bFontIsScaled ? std::max(nWidth, 1) : 0, nHeight)); #endif // define various other FontAttribute - aRetval.SetAlignment(ALIGN_BASELINE); + aRetval.SetAlignment(TextAlign::Baseline); aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE); aRetval.SetVertical(rFontAttribute.getVertical()); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index a54893025984..98a807fa5c47 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -1077,16 +1077,16 @@ namespace wmfemfhelper rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY()); // take text align into account - if(ALIGN_BASELINE != rFont.GetAlignment()) + if (TextAlign::Baseline != rFont.GetAlignment()) { drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; aTextLayouterDevice.setFont(rFont); - if(ALIGN_TOP == rFont.GetAlignment()) + if (TextAlign::Top == rFont.GetAlignment()) { rAlignmentOffset.setY(aTextLayouterDevice.getFontAscent()); } - else // ALIGN_BOTTOM + else // TextAlign::Bottom { rAlignmentOffset.setY(-aTextLayouterDevice.getFontDescent()); } -- cgit