diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-04-27 20:43:37 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-04-28 00:49:02 +0200 |
commit | ee57d5253a2ee054b06a4158204bda1a8fc3b5dc (patch) | |
tree | 5abe2e3e3239d354aca2975e831dbe6fa7a9f2c7 /starmath | |
parent | e300e8fbe891e23777ce95556488010f6f59c0e6 (diff) |
Minimize scope of variables
Change-Id: I6602c84b9bd7143e5e7b224c17559b083c9b7f9c
Reviewed-on: https://gerrit.libreoffice.org/71439
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/ElementsDockingWindow.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index bb15c28d11a4..f093723daf2a 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -334,8 +334,6 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext) } else { - Size aSizePixel = LogicToPixel(Size(element->getNode()->GetWidth(), - element->getNode()->GetHeight())); if (mbVerticalMode) { if (y + boxY > nControlHeight) @@ -363,14 +361,17 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext) pContext->Pop(); } - Point location(x + ((boxX - aSizePixel.Width()) / 2), - y + ((boxY - aSizePixel.Height()) / 2)); + element->mBoxLocation = Point(x,y); + element->mBoxSize = Size(boxX, boxY); if (pContext) + { + Size aSizePixel = LogicToPixel(Size(element->getNode()->GetWidth(), + element->getNode()->GetHeight())); + Point location(x + ((boxX - aSizePixel.Width()) / 2), + y + ((boxY - aSizePixel.Height()) / 2)); SmDrawingVisitor(*pContext, PixelToLogic(location), element->getNode().get()); - - element->mBoxLocation = Point(x,y); - element->mBoxSize = Size(boxX, boxY); + } if (mbVerticalMode) y += boxY; |