[Libreoffice-commits] core.git: sdext/source
Stephan Bergmann
sbergman at redhat.com
Mon Sep 7 07:37:49 PDT 2015
sdext/source/presenter/PresenterPaneBorderPainter.cxx | 20 +++++++++---------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 5670937747c8391e098da6a8712324a0a5aaaa91
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Sep 7 16:37:25 2015 +0200
clang-analyzer-deadcode.DeadStores
Change-Id: I7c19ce1bde1eb405fe64aba7504fc511c0ab646e
diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
index b40434d..b4b45ee 100644
--- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx
+++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
@@ -86,7 +86,8 @@ namespace {
PresenterTheme::SharedFontDescriptor mpFont;
sal_Int32 mnFontXOffset;
sal_Int32 mnFontYOffset;
- enum Anchor { AnchorLeft, AnchorRight, AnchorCenter } meFontAnchor;
+ enum class Anchor { Left, Right, Center };
+ Anchor meFontAnchor;
BorderSize maInnerBorderSize;
BorderSize maOuterBorderSize;
BorderSize maTotalBorderSize;
@@ -536,21 +537,20 @@ void PresenterPaneBorderPainter::Renderer::PaintTitle (
geometry::RealRectangle2D aBox (xLayout->queryTextBounds());
const double nTextHeight = aBox.Y2 - aBox.Y1;
const double nTextWidth = aBox.X1 + aBox.X2;
- double nX = rInnerBox.X + (rInnerBox.Width - nTextWidth)/2;
const sal_Int32 nTitleBarHeight = rInnerBox.Y - rOuterBox.Y - 1;
double nY = rOuterBox.Y + (nTitleBarHeight - nTextHeight) / 2 - aBox.Y1;
if (nY >= rInnerBox.Y)
nY = rInnerBox.Y - 1;
+ double nX;
switch (rpStyle->meFontAnchor)
{
- default:
- case RendererPaneStyle::AnchorLeft:
+ case RendererPaneStyle::Anchor::Left:
nX = rInnerBox.X;
break;
- case RendererPaneStyle::AnchorRight:
+ case RendererPaneStyle::Anchor::Right:
nX = rInnerBox.X + rInnerBox.Width - nTextWidth;
break;
- case RendererPaneStyle::AnchorCenter:
+ case RendererPaneStyle::Anchor::Center:
nX = rInnerBox.X + (rInnerBox.Width - nTextWidth)/2;
break;
}
@@ -810,7 +810,7 @@ RendererPaneStyle::RendererPaneStyle (
mpFont(),
mnFontXOffset(0),
mnFontYOffset(0),
- meFontAnchor(AnchorCenter),
+ meFontAnchor(Anchor::Center),
maInnerBorderSize(),
maOuterBorderSize(),
maTotalBorderSize()
@@ -840,11 +840,11 @@ RendererPaneStyle::RendererPaneStyle (
}
if ( sAnchor == "Left" )
- meFontAnchor = AnchorLeft;
+ meFontAnchor = Anchor::Left;
else if ( sAnchor == "Right" )
- meFontAnchor = AnchorRight;
+ meFontAnchor = Anchor::Right;
else
- meFontAnchor = AnchorCenter;
+ meFontAnchor = Anchor::Center;
// Get border sizes.
try
More information about the Libreoffice-commits
mailing list