diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 13:52:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 16:08:51 +0200 |
commit | d7855213ae60d79fc51d8b9bfe49f13200137c05 (patch) | |
tree | a9f852a6ddacffce339945e8667500d3531257a4 /sfx2 | |
parent | b267650fd097f16d1b31c87a11a497294ad4ee42 (diff) |
add an IsEmpty method to tools::Size and use it
Change-Id: I7f5201e2ea6c74329336e16bf219630e38ff92cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92264
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/new.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index fda8a28dc7ad..f3488e417f84 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -207,7 +207,7 @@ void ThumbnailView::DrawItem(ThumbnailViewItem const *pItem) { ::tools::Rectangle aRect = pItem->getDrawArea(); - if ((aRect.GetHeight() > 0) && (aRect.GetWidth() > 0)) + if (!aRect.IsEmpty()) Invalidate(aRect); } } @@ -1382,7 +1382,7 @@ void SfxThumbnailView::DrawItem(ThumbnailViewItem const *pItem) { ::tools::Rectangle aRect = pItem->getDrawArea(); - if ((aRect.GetHeight() > 0) && (aRect.GetWidth() > 0)) + if (!aRect.IsEmpty()) Invalidate(aRect); } } diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index ff892863dd0d..8af946eeab82 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -58,7 +58,7 @@ void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFil rRenderContext.DrawRect(tools::Rectangle(Point(0,0), rRenderContext.GetOutputSize())); Size aTmpSize = pFile ? pFile->GetPrefSize() : Size(1, 1); - DBG_ASSERT(aTmpSize.Height() != 0 && aTmpSize.Width() != 0, "size of first page is 0, override GetFirstPageSize or set visible-area!"); + DBG_ASSERT(!aTmpSize.IsEmpty(), "size of first page is 0, override GetFirstPageSize or set visible-area!"); #define FRAME 4 diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 17f3f1263404..8bdafbc3a5c8 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -131,7 +131,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const } xFile->SetPrefSize( aTmpSize ); - DBG_ASSERT( aTmpSize.Height() != 0 && aTmpSize.Width() != 0, + DBG_ASSERT( !aTmpSize.IsEmpty(), "size of first page is 0, override GetFirstPageSize or set visible-area!" ); xFile->Record( pDevice ); |