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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 3 | ||||
-rw-r--r-- | svtools/source/filter/DocumentToGraphicRenderer.cxx | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index cd85b2756ea1..cd62dff7c05a 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -1874,8 +1874,7 @@ void BrowseBox::MakeFieldVisible Size aTestSize = pDataWin->GetSizePixel(); - if ( !bBootstrapped || - ( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) ) + if ( !bBootstrapped || aTestSize.IsEmpty() ) return; // is it visible already? diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx index bec55b93fbe3..415ab353e73f 100644 --- a/svtools/source/filter/DocumentToGraphicRenderer.cxx +++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx @@ -204,8 +204,7 @@ Graphic DocumentToGraphicRenderer::renderToGraphic( if (!xDevice.is()) return Graphic(); - assert( aDocumentSizePixel.Width() > 0 && aDocumentSizePixel.Height() > 0 && - aTargetSizePixel.Width() > 0 && aTargetSizePixel.Height() > 0); + assert( !aDocumentSizePixel.IsEmpty() && !aTargetSizePixel.IsEmpty()); double fScaleX = aTargetSizePixel.Width() / static_cast<double>(aDocumentSizePixel.Width()); double fScaleY = aTargetSizePixel.Height() / static_cast<double>(aDocumentSizePixel.Height()); |