diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-04-21 07:50:54 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-04-21 11:02:29 +0200 |
commit | de07f40030bbd604bc42d58f0e954cca284a2646 (patch) | |
tree | d16090c7008b533b8af295b68701681012ba7608 /vcl/unx/generic/gdi/cairotextrender.cxx | |
parent | 3322661414a558d29146c40c0cd5e9db0a7b21dd (diff) |
cppcheck: identicalInnerCondition
renamed temporary list in EnhancedCustomShape2d.cxx to avoid shadow
of a local variable
Change-Id: I17a2261dafd2067480fcc5314af4f48765d6b690
Reviewed-on: https://gerrit.libreoffice.org/53244
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'vcl/unx/generic/gdi/cairotextrender.cxx')
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 7febf686e9fd..25317651a003 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -275,17 +275,16 @@ void CairoTextRender::DrawTextLayout(const CommonSalLayout& rLayout) //like them double xdiff = 0.0; double ydiff = 0.0; - if (nGlyphRotation) - { - // The y is the origin point position, but Cairo will draw - // the glyph *above* that point, we need to move it down to - // the glyph’s baseline. - cairo_text_extents_t aExt; - cairo_glyph_extents(cr, &cairo_glyphs[nStartIndex], nLen, &aExt); - double nDescender = std::fmax(aExt.height + aExt.y_bearing, 0); - ydiff = (aExt.x_advance - nDescender) / nHeight; - xdiff = -font_extents.descent/nHeight; - } + + // The y is the origin point position, but Cairo will draw + // the glyph *above* that point, we need to move it down to + // the glyph’s baseline. + cairo_text_extents_t aExt; + cairo_glyph_extents(cr, &cairo_glyphs[nStartIndex], nLen, &aExt); + double nDescender = std::fmax(aExt.height + aExt.y_bearing, 0); + ydiff = (aExt.x_advance - nDescender) / nHeight; + xdiff = -font_extents.descent/nHeight; + cairo_matrix_translate(&m, xdiff, ydiff); } |