summaryrefslogtreecommitdiffstats
path: root/cppcanvas/source
diff options
context:
space:
mode:
Diffstat (limited to 'cppcanvas/source')
-rw-r--r--cppcanvas/source/inc/outdevstate.hxx2
-rw-r--r--cppcanvas/source/mtfrenderer/mtftools.cxx26
2 files changed, 12 insertions, 16 deletions
diff --git a/cppcanvas/source/inc/outdevstate.hxx b/cppcanvas/source/inc/outdevstate.hxx
index 16cc3c4ff25a..09b70b6cdcd5 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -63,7 +63,7 @@ namespace cppcanvas::internal
textOverlineStyle(LINESTYLE_NONE),
textUnderlineStyle(LINESTYLE_NONE),
textStrikeoutStyle(STRIKEOUT_NONE),
- textReferencePoint(ALIGN_BASELINE),
+ textReferencePoint(TextAlign::Baseline),
isTextOutlineModeSet( false ),
isTextEffectShadowSet( false ),
diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx
index c5d36eb00652..52e35b73dc0c 100644
--- a/cppcanvas/source/mtfrenderer/mtftools.cxx
+++ b/cppcanvas/source/mtfrenderer/mtftools.cxx
@@ -51,28 +51,24 @@ namespace cppcanvas::tools
::Size getBaselineOffset( const ::cppcanvas::internal::OutDevState& outdevState,
const VirtualDevice& rVDev )
{
+ ::Size aRet(0, 0);
const ::FontMetric& aMetric = rVDev.GetFontMetric();
// calc offset for text output, the XCanvas always renders
// baseline offset.
switch( outdevState.textReferencePoint )
{
- case ALIGN_TOP:
- return ::Size( 0,
- aMetric.GetInternalLeading() + aMetric.GetAscent() );
-
- default:
- ENSURE_OR_THROW( false,
- "tools::getBaselineOffset(): Unexpected TextAlign value" );
- // FALLTHROUGH intended (to calm compiler warning - case won't happen)
- case ALIGN_BASELINE:
- return ::Size( 0, 0 );
-
- case ALIGN_BOTTOM:
- return ::Size( 0,
- -aMetric.GetDescent() );
-
+ case TextAlign::Baseline:
+ break;
+ case TextAlign::Top:
+ aRet = ::Size(0, aMetric.GetInternalLeading() + aMetric.GetAscent());
+ break;
+ case TextAlign::Bottom:
+ aRet = ::Size(0, -aMetric.GetDescent());
+ break;
}
+
+ return aRet;
}
::basegfx::B2DHomMatrix& calcLogic2PixelLinearTransform( ::basegfx::B2DHomMatrix& o_rMatrix,