summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-07 16:37:25 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-07 16:37:25 +0200
commit5670937747c8391e098da6a8712324a0a5aaaa91 (patch)
tree709586817877403cfa354401d6694e1bfdad67bd /sdext
parent13271f324759887244384aaaccf681390c96238d (diff)
clang-analyzer-deadcode.DeadStores
Change-Id: I7c19ce1bde1eb405fe64aba7504fc511c0ab646e
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterPaneBorderPainter.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
index b40434d32b59..b4b45eec7e9d 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