diff options
-rw-r--r-- | starmath/source/ElementsDockingWindow.cxx | 15 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 5 |
2 files changed, 11 insertions, 9 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; diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 68b7a4ffc250..fb3092739ffc 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1264,14 +1264,15 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, pLayoutCache = nullptr; // don't use cache with modified string! pGlyphs = nullptr; } + DeviceCoordinate nPixelWidth = static_cast<DeviceCoordinate>(nLogicalWidth); - std::unique_ptr<DeviceCoordinate[]> xDXPixelArray; - DeviceCoordinate* pDXPixelArray(nullptr); if( nLogicalWidth && mbMap ) { nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth ); } + std::unique_ptr<DeviceCoordinate[]> xDXPixelArray; + DeviceCoordinate* pDXPixelArray(nullptr); if( pDXArray) { if(mbMap) |