Kaydet (Commit) ee57d525 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Minimize scope of variables

Change-Id: I6602c84b9bd7143e5e7b224c17559b083c9b7f9c
Reviewed-on: https://gerrit.libreoffice.org/71439
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst e300e8fb
...@@ -334,8 +334,6 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext) ...@@ -334,8 +334,6 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext)
} }
else else
{ {
Size aSizePixel = LogicToPixel(Size(element->getNode()->GetWidth(),
element->getNode()->GetHeight()));
if (mbVerticalMode) if (mbVerticalMode)
{ {
if (y + boxY > nControlHeight) if (y + boxY > nControlHeight)
...@@ -363,14 +361,17 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext) ...@@ -363,14 +361,17 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext)
pContext->Pop(); pContext->Pop();
} }
Point location(x + ((boxX - aSizePixel.Width()) / 2), element->mBoxLocation = Point(x,y);
y + ((boxY - aSizePixel.Height()) / 2)); element->mBoxSize = Size(boxX, boxY);
if (pContext) 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()); SmDrawingVisitor(*pContext, PixelToLogic(location), element->getNode().get());
}
element->mBoxLocation = Point(x,y);
element->mBoxSize = Size(boxX, boxY);
if (mbVerticalMode) if (mbVerticalMode)
y += boxY; y += boxY;
......
...@@ -1264,14 +1264,15 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, ...@@ -1264,14 +1264,15 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
pLayoutCache = nullptr; // don't use cache with modified string! pLayoutCache = nullptr; // don't use cache with modified string!
pGlyphs = nullptr; pGlyphs = nullptr;
} }
DeviceCoordinate nPixelWidth = static_cast<DeviceCoordinate>(nLogicalWidth); DeviceCoordinate nPixelWidth = static_cast<DeviceCoordinate>(nLogicalWidth);
std::unique_ptr<DeviceCoordinate[]> xDXPixelArray;
DeviceCoordinate* pDXPixelArray(nullptr);
if( nLogicalWidth && mbMap ) if( nLogicalWidth && mbMap )
{ {
nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth ); nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth );
} }
std::unique_ptr<DeviceCoordinate[]> xDXPixelArray;
DeviceCoordinate* pDXPixelArray(nullptr);
if( pDXArray) if( pDXArray)
{ {
if(mbMap) if(mbMap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment