Kaydet (Commit) 9b3d96fd authored tarafından Michael Meeks's avatar Michael Meeks

fdo#57059 - fix crasher rendering borders for very small windows.

üst 3d55b14a
...@@ -5791,9 +5791,15 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, Point aPoint, BitmapEx& ...@@ -5791,9 +5791,15 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, Point aPoint, BitmapEx&
aPageBottomRightShadow ); aPageBottomRightShadow );
pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Right() + 1, aPagePxRect.Top() - mnShadowPxWidth ) ), pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Right() + 1, aPagePxRect.Top() - mnShadowPxWidth ) ),
aPageTopRightShadow ); aPageTopRightShadow );
if ( aPagePxRect.Height() > 2 * mnShadowPxWidth)
{
BitmapEx aPageRightShadow = aPageRightShadowBase; BitmapEx aPageRightShadow = aPageRightShadowBase;
aPageRightShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) ); aPageRightShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) );
lcl_paintBitmapExToRect(pOut, Point( aPaintRect.Right() + mnShadowPxWidth, aPagePxRect.Top() + mnShadowPxWidth - 1), aPageRightShadow, RIGHT ); lcl_paintBitmapExToRect( pOut, Point( aPaintRect.Right() + mnShadowPxWidth,
aPagePxRect.Top() + mnShadowPxWidth - 1),
aPageRightShadow, RIGHT );
}
} }
// Left shadows and corners // Left shadows and corners
...@@ -5803,17 +5809,23 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, Point aPoint, BitmapEx& ...@@ -5803,17 +5809,23 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, Point aPoint, BitmapEx&
pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft,
aPagePxRect.Bottom() + 1 + mnShadowPxWidth - aPageBottomLeftShadow.GetSizePixel().Height() ) ), aPageBottomLeftShadow ); aPagePxRect.Bottom() + 1 + mnShadowPxWidth - aPageBottomLeftShadow.GetSizePixel().Height() ) ), aPageBottomLeftShadow );
pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, aPagePxRect.Top() - mnShadowPxWidth ) ), aPageTopLeftShadow ); pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, aPagePxRect.Top() - mnShadowPxWidth ) ), aPageTopLeftShadow );
if ( aPagePxRect.Height() > 2 * mnShadowPxWidth)
{
BitmapEx aPageLeftShadow = aPageLeftShadowBase; BitmapEx aPageLeftShadow = aPageLeftShadowBase;
aPageLeftShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) ); aPageLeftShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) );
lcl_paintBitmapExToRect(pOut, Point( lLeft, aPagePxRect.Top() + mnShadowPxWidth - 1), aPageLeftShadow, LEFT); lcl_paintBitmapExToRect( pOut, Point( lLeft, aPagePxRect.Top() + mnShadowPxWidth - 1),
aPageLeftShadow, LEFT );
}
} }
BitmapEx aPageBottomShadow = aPageBottomShadowBase; BitmapEx aPageBottomShadow = aPageBottomShadowBase;
aPageBottomShadow.Scale( aPaintRect.Width(), 1 ); aPageBottomShadow.Scale( aPaintRect.Width(), 1 );
lcl_paintBitmapExToRect(pOut, Point( aPaintRect.Left(), aPagePxRect.Bottom() + 1 ), aPageBottomShadow, BOTTOM); lcl_paintBitmapExToRect( pOut, Point( aPaintRect.Left(), aPagePxRect.Bottom() + 1 ),
aPageBottomShadow, BOTTOM );
BitmapEx aPageTopShadow = aPageTopShadowBase; BitmapEx aPageTopShadow = aPageTopShadowBase;
aPageTopShadow.Scale( aPaintRect.Width(), 1 ); aPageTopShadow.Scale( aPaintRect.Width(), 1 );
lcl_paintBitmapExToRect(pOut, Point( aPaintRect.Left(), aPagePxRect.Top() - mnShadowPxWidth ), aPageTopShadow, TOP); lcl_paintBitmapExToRect( pOut, Point( aPaintRect.Left(), aPagePxRect.Top() - mnShadowPxWidth ),
aPageTopShadow, TOP );
} }
//mod #i6193# paint sidebar for notes //mod #i6193# paint sidebar for notes
......
...@@ -2175,6 +2175,10 @@ bool Bitmap::ImplScaleConvolution( const double& rScaleX, const double& rScaleY, ...@@ -2175,6 +2175,10 @@ bool Bitmap::ImplScaleConvolution( const double& rScaleX, const double& rScaleY,
int* pPixels; int* pPixels;
int* pCount; int* pCount;
// Handle negative scales safely cf. other ImplScale methods
if( ( nNewWidth < 1L ) || ( nNewHeight < 1L ) )
return false;
// Do horizontal filtering // Do horizontal filtering
ImplCalculateContributions( nWidth, nNewWidth, aNumberOfContributions, pWeights, pPixels, pCount, aKernel ); ImplCalculateContributions( nWidth, nNewWidth, aNumberOfContributions, pWeights, pPixels, pCount, aKernel );
pReadAcc = AcquireReadAccess(); pReadAcc = AcquireReadAccess();
......
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