summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 13:52:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 16:08:51 +0200
commitd7855213ae60d79fc51d8b9bfe49f13200137c05 (patch)
treea9f852a6ddacffce339945e8667500d3531257a4 /sd
parentb267650fd097f16d1b31c87a11a497294ad4ee42 (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 'sd')
-rw-r--r--sd/source/filter/eppt/epptso.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx4
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx2
-rw-r--r--sd/source/ui/sidebar/PreviewValueSet.cxx2
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.cxx2
-rw-r--r--sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayouter.cxx4
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx2
-rw-r--r--sd/source/ui/view/viewshel.cxx2
12 files changed, 14 insertions, 14 deletions
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index b56f82c13051..f3e7faf875f3 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -92,7 +92,7 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi
if ( rGraphicSize.Width() && rGraphicSize.Height() )
{
- if (aPrefSize.Width() == 0 || aPrefSize.Height() == 0)
+ if (aPrefSize.IsEmpty())
{
aBmpEx.Scale(aPrefSize);
}
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 7b66e6a53348..970076977ec2 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -338,7 +338,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
Size aSize( aSz.Width, aSz.Height );
- if (aSize.Height() == 0 || aSize.Width() == 0)
+ if (aSize.IsEmpty())
{
// rectangle with balanced edge ratio
aSize.setWidth( 14100 );
@@ -514,7 +514,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
aSize =Size( aSz.Width, aSz.Height );
aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- if (aSize.Height() == 0 || aSize.Width() == 0)
+ if (aSize.IsEmpty())
{
// rectangle with balanced edge ratio
aSize.setWidth( 14100 );
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index 67b6dbe9f37b..21fb595e9624 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -566,7 +566,7 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel()
if (iDescriptor != maContainer.end())
{
Size aPageSize ((*iDescriptor)->mpMasterPage->GetSize());
- OSL_ASSERT(aPageSize.Width() > 0 && aPageSize.Height() > 0);
+ OSL_ASSERT(!aPageSize.IsEmpty());
if (aPageSize.Width() > 0)
nWidth = aPageSize.Width();
if (aPageSize.Height() > 0)
diff --git a/sd/source/ui/sidebar/PreviewValueSet.cxx b/sd/source/ui/sidebar/PreviewValueSet.cxx
index 44d578576b4f..56863fc47f38 100644
--- a/sd/source/ui/sidebar/PreviewValueSet.cxx
+++ b/sd/source/ui/sidebar/PreviewValueSet.cxx
@@ -73,7 +73,7 @@ void PreviewValueSet::Resize()
SvtValueSet::Resize();
Size aWindowSize (GetOutputSizePixel());
- if (aWindowSize.Width()>0 && aWindowSize.Height()>0)
+ if (!aWindowSize.IsEmpty())
{
Rearrange();
}
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index aef1594f5b1d..56d14adf2370 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -330,7 +330,7 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( )
const Size& rTmpSize( mrOutputWindow.GetSizePixel() );
- if (rTmpSize.Width()<=0 || rTmpSize.Height()<=0)
+ if (rTmpSize.IsEmpty())
{
return geometry::AffineMatrix2D (1,0,0,0,1,0);
}
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
index d2d0a241e507..4136cb49d6bc 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
@@ -119,7 +119,7 @@ BitmapEx GenericPageCache::GetPreviewBitmap (
{
// Scale the bitmap to the desired size when that is possible,
// i.e. the bitmap is not empty.
- if (bResize && aBitmapSize.Width()>0 && aBitmapSize.Height()>0)
+ if (bResize && !aBitmapSize.IsEmpty())
{
aPreview.Scale(maPreviewSize);
}
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 82eb09404c3d..6b090fbe5f5a 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -292,7 +292,7 @@ void SlideSorterView::Rearrange()
if ( ! pWindow)
return;
const Size aWindowSize (pWindow->GetSizePixel());
- if (aWindowSize.Width()<=0 || aWindowSize.Height()<=0)
+ if (aWindowSize.IsEmpty())
return;
const bool bRearrangeSuccess (
diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
index b4c6dfd428e0..86205e8eca63 100644
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
@@ -484,9 +484,9 @@ bool Layouter::Implementation::Rearrange (
mnPageCount = nPageCount;
// Return early when the window or the model have not yet been initialized.
- if (rWindowSize.Width()<=0 || rWindowSize.Height()<=0)
+ if (rWindowSize.IsEmpty())
return false;
- if (rPreviewModelSize.Width()<=0 || rPreviewModelSize.Height()<=0)
+ if (rPreviewModelSize.IsEmpty())
return false;
CalculateRowAndColumnCount(rWindowSize);
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 8f5d2dd73609..34f394737c09 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -358,7 +358,7 @@ void PreviewRenderer::SetupOutputSize (
// Adapt it to the desired width.
const Size aPageModelSize (rPage.GetSize());
- if (aPageModelSize.Width()>0 || aPageModelSize.Height()>0)
+ if (!aPageModelSize.IsEmpty())
{
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
aMapMode.SetScaleX(
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 57b18bb945e4..ce7e22c52f84 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -466,7 +466,7 @@ bool ViewShellBase::HasSelection(bool bText) const
void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, bool)
{
Size aObjSize = GetObjectShell()->GetVisArea().GetSize();
- if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 )
+ if ( !aObjSize.IsEmpty() )
{
SvBorder aBorder( GetBorderPixel() );
Size aSize( rSize );
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 39097ac7fdfb..96b23e87f71b 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1209,7 +1209,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
::tools::Rectangle aVisArea = mpFrameView->GetVisArea();
Size aVisAreaSize = aVisArea.GetSize();
- if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0)
+ if (!aVisAreaSize.IsEmpty())
{
mbZoomOnPage = false;
SetZoomRect(aVisArea);
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 3ac055930198..9ef01355849c 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -877,7 +877,7 @@ void ViewShell::Resize()
// Make sure that the new size is not degenerate.
const Size aSize (mpParentWindow->GetSizePixel());
- if (aSize.Width()==0 || aSize.Height()==0)
+ if (aSize.IsEmpty())
return;
// Remember the new position and size.