svx/source/dialog/dialcontrol.cxx | 5 +++-- svx/source/svdraw/svdogrp.cxx | 27 ++++++++++++++++++--------- svx/source/svdraw/svdopath.cxx | 8 ++++++++ sw/source/uibase/uiview/view.cxx | 12 ++++++++---- 4 files changed, 37 insertions(+), 15 deletions(-)
New commits: commit f8d29fea9915a5fe66e4ba24cbd3b248929b51b7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri May 10 15:47:53 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 09:09:52 2019 +0200 handle empty tools::Rectangle in svx Change-Id: I45e26c9cdc00ae6d3bc56534d612b83b5ac26074 Reviewed-on: https://gerrit.libreoffice.org/72125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 547949ce5e2e..598caafc8201 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -212,8 +212,9 @@ void DialControlBmp::DrawBackground() SetLineColor(); SetFillColor( GetBackgroundColor() ); - DrawEllipse( tools::Rectangle( maRect.Left() + DIAL_OUTER_WIDTH, maRect.Top() + DIAL_OUTER_WIDTH, - maRect.Right() - DIAL_OUTER_WIDTH, maRect.Bottom() - DIAL_OUTER_WIDTH ) ); + tools::Rectangle aEllipseRect = maRect; + aEllipseRect.shrink(DIAL_OUTER_WIDTH); + DrawEllipse( aEllipseRect ); } diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 61bca73c9a37..c50ba9524908 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -501,17 +501,26 @@ void SdrObjGroup::SetSnapRect(const tools::Rectangle& rRect) { tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); tools::Rectangle aOld(GetSnapRect()); - long nMulX=rRect.Right()-rRect.Left(); - long nDivX=aOld.Right()-aOld.Left(); - long nMulY=rRect.Bottom()-rRect.Top(); - long nDivY=aOld.Bottom()-aOld.Top(); - if (nDivX==0) { nMulX=1; nDivX=1; } - if (nDivY==0) { nMulY=1; nDivY=1; } - if (nMulX!=nDivX || nMulY!=nDivY) { - Fraction aX(nMulX,nDivX); - Fraction aY(nMulY,nDivY); + if (aOld.IsEmpty()) + { + Fraction aX(1,1); + Fraction aY(1,1); Resize(aOld.TopLeft(),aX,aY); } + else + { + long nMulX=rRect.Right()-rRect.Left(); + long nDivX=aOld.Right()-aOld.Left(); + long nMulY=rRect.Bottom()-rRect.Top(); + long nDivY=aOld.Bottom()-aOld.Top(); + if (nDivX==0) { nMulX=1; nDivX=1; } + if (nDivY==0) { nMulY=1; nDivY=1; } + if (nMulX!=nDivX || nMulY!=nDivY) { + Fraction aX(nMulX,nDivX); + Fraction aY(nMulY,nDivY); + Resize(aOld.TopLeft(),aX,aY); + } + } if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) { Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top())); } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 4c3d0f2040b9..12a7b2c1af39 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2362,6 +2362,14 @@ void SdrPathObj::RecalcSnapRect() void SdrPathObj::NbcSetSnapRect(const tools::Rectangle& rRect) { tools::Rectangle aOld(GetSnapRect()); + if (aOld.IsEmpty()) + { + Fraction aX(1,1); + Fraction aY(1,1); + NbcResize(aOld.TopLeft(), aX, aY); + NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top())); + return; + } // Take empty into account when calculating scale factors long nMulX = rRect.IsWidthEmpty() ? 0 : rRect.Right() - rRect.Left(); commit 08b79ade4f2e2fa98487696591123f71a7521dff Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri May 10 15:47:05 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 09:09:39 2019 +0200 handle empty tools::Rectangle in sw Change-Id: I44c4b5a6d4f0aada0ed95d8cd4d05366958c6207 Reviewed-on: https://gerrit.libreoffice.org/72124 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index c48a59c22841..67fce780a56a 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1527,13 +1527,17 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() ))); - aVector.push_back(comphelper::makePropertyValue("VisibleLeft", convertTwipToMm100 ( rVis.Left() ))); + auto visibleLeft = convertTwipToMm100 ( rVis.Left() ); + aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft)); - aVector.push_back(comphelper::makePropertyValue("VisibleTop", convertTwipToMm100 ( rVis.Top() ))); + auto visibleTop = convertTwipToMm100 ( rVis.Top() ); + aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop)); - aVector.push_back(comphelper::makePropertyValue("VisibleRight", convertTwipToMm100 ( rVis.Right() ))); + auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() ); + aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight)); - aVector.push_back(comphelper::makePropertyValue("VisibleBottom", convertTwipToMm100 ( rVis.Bottom() ))); + auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() ); + aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom)); const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType()); aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits