diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-20 09:22:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-20 10:17:51 +0200 |
commit | 4e578adbc7dc5c4ece45b9f362e71b4cbe24752a (patch) | |
tree | 5fb6775ebc87d75ab09d1bc6b207e5612029c3ee /sw/source/core/view | |
parent | 95a0ac68413d3ed0755d8e8d5336e8f0c546bcd1 (diff) |
remove direct access to Size field on SwRect
so I can add asserts to prevent construction of invalid rectangles
Change-Id: I01ac97b3cc780acbd182a646f0e072e518a45bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92520
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/view')
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 78c0bc0e0020..317480500eac 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -184,7 +184,7 @@ void SwViewShellImp::SetFirstVisPage(OutputDevice const * pRenderContext) if ( bBookMode && pPage->IsEmptyPage() ) { const SwPageFrame& rFormatPage = pPage->GetFormatPage(); - aPageRect.SSize() = rFormatPage.GetBoundRect(pRenderContext).SSize(); + aPageRect.SSize( rFormatPage.GetBoundRect(pRenderContext).SSize() ); } } } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index cef9ecffb3e6..7b9529155a91 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1133,7 +1133,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) if ( bBookMode ) { const SwPageFrame& rFormatPage = pPage->GetFormatPage(); - aPageRect.SSize() = rFormatPage.GetBoundRect(GetWin()).SSize(); + aPageRect.SSize( rFormatPage.GetBoundRect(GetWin()).SSize() ); } // #i9719# - consider new border and shadow width @@ -1298,12 +1298,12 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); } else - aRect.SSize().AdjustWidth(2*aPixSz.Width() ); + aRect.AddWidth(2*aPixSz.Width() ); aRect.Pos().setY( lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height() : aRect.Top() - aSize.Height() + aPixSz.Height() ); aRect.Pos().setX( std::max( 0L, aRect.Left()-aPixSz.Width() ) ); aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos())); - aRect.SSize()= GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())); + aRect.SSize( GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())) ); maVisArea = aRect; const Point aPt( -aRect.Left(), -aRect.Top() ); aMapMode.SetOrigin( aPt ); @@ -1537,13 +1537,13 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect if ( bBookMode ) { const SwPageFrame& rFormatPage = static_cast<const SwPageFrame*>(pPage)->GetFormatPage(); - aPageRect.SSize() = rFormatPage.getFrameArea().SSize(); + aPageRect.SSize( rFormatPage.getFrameArea().SSize() ); } const bool bSidebarRight = static_cast<const SwPageFrame*>(pPage)->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT; aPageRect.Pos().AdjustX( -(bSidebarRight ? 0 : nSidebarWidth) ); - aPageRect.SSize().AdjustWidth(nSidebarWidth ); + aPageRect.AddWidth(nSidebarWidth ); if ( aPageRect.IsOver( rRect ) ) aRegion -= aPageRect; |