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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/core/data/table5.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xechart.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/cctrl/cbuttonw.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun7.cxx | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 6c2645077d70..d33ccf6ddf0d 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -1025,7 +1025,7 @@ void ScTable::SyncColRowFlags() void ScTable::SetPageSize( const Size& rSize ) { - if ( rSize.Width() != 0 && rSize.Height() != 0 ) + if ( !rSize.IsEmpty() ) { if (aPageSizeTwips != rSize) InvalidatePageBreaks(); diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index c3cc1b38190e..5437f5060540 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -3428,7 +3428,7 @@ XclExpChartDrawing::XclExpChartDrawing( const XclExpRoot& rRoot, const Reference< XModel >& rxModel, const Size& rChartSize ) : XclExpRoot( rRoot ) { - if( (rChartSize.Width() > 0) && (rChartSize.Height() > 0) ) + if( !rChartSize.IsEmpty() ) { ScfPropertySet aPropSet( rxModel ); Reference< XShapes > xShapes; diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index eb701ca85cc2..2d762fd41d9a 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -1429,7 +1429,7 @@ css::awt::Rectangle ScAccessibleCsvCell::implGetBounds() tools::Rectangle aRect( implGetRealPos(), implGetRealSize() ); aRect.Intersection( aClipRect ); - if( (aRect.GetWidth() <= 0) || (aRect.GetHeight() <= 0) ) + if( aRect.IsEmpty() ) aRect.SetSize( Size( -1, -1 ) ); return css::awt::Rectangle(aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight()); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b80ab75b75ae..c9b69f63ad5e 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -520,7 +520,7 @@ void ScInputWindow::NotifyLOKClient() if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { Size aSize = GetSizePixel(); - if (aSize.Width() != 0 && aSize.Height() != 0) + if (!aSize.IsEmpty()) { std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back("type", "calc-input-win"); diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index 6a6a76892704..52660ee7a28d 100644 --- a/sc/source/ui/cctrl/cbuttonw.cxx +++ b/sc/source/ui/cctrl/cbuttonw.cxx @@ -49,7 +49,7 @@ void ScDDComboBoxButton::SetOptSizePixel() void ScDDComboBoxButton::Draw( const Point& rAt, const Size& rSize ) { - if ( rSize.Width() == 0 || rSize.Height() == 0 ) + if ( rSize.IsEmpty() ) return; // save old state diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index e18dd815396f..6b3cc310e98c 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -313,7 +313,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* 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( 5000 ); @@ -498,7 +498,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); bool bSizeCh = false; - if (aSize.Height() <= 0 || aSize.Width() <= 0) + if (aSize.IsEmpty()) { aSize.setWidth( 5000 ); aSize.setHeight( 5000 ); @@ -651,7 +651,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV >>= aDialogAWTSize ) { Size aDialogSize( aDialogAWTSize.Width, aDialogAWTSize.Height ); - if ( aDialogSize.Width() > 0 && aDialogSize.Height() > 0 ) + if ( !aDialogSize.IsEmpty() ) { //calculate and set new position Point aDialogPos = rViewShell.GetChartDialogPos( aDialogSize, aRect ); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index f4f61330b4fb..fa8c8d854460 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -305,7 +305,7 @@ void ScTabViewShell::UpdateOleZoom() { //TODO/LATER: is there a difference between the two GetVisArea methods? Size aObjSize = static_cast<const SfxObjectShell*>(pDocSh)->GetVisArea().GetSize(); - if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) + if ( !aObjSize.IsEmpty() ) { vcl::Window* pWin = GetActiveWin(); Size aWinHMM = pWin->PixelToLogic(pWin->GetOutputSizePixel(), MapMode(MapUnit::Map100thMM)); @@ -330,7 +330,7 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize, boo aSize.AdjustWidth( -(aBorder.Left() + aBorder.Right()) ); aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); - if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) + if ( !aObjSize.IsEmpty() ) { Size aLogicSize = GetWindow()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( Fraction( aLogicSize.Width(),aObjSize.Width() ), diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 86b6f0f2f155..a438fcca7800 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -328,7 +328,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X aSize = Size( aSz.Width, aSz.Height ); aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapObj), MapMode(aMap100)); // for SdrOle2Obj - if( aSize.Height() == 0 || aSize.Width() == 0 ) + if( aSize.IsEmpty() ) { OSL_FAIL("SvObjectDescriptor::GetSize == 0"); aSize.setWidth( 5000 ); |