cid#1689887 silence Division or modulo by float zero
and cid#1689888 Division or modulo by float zero cid#1689889 Division or modulo by float zero cid#1689883 Division or modulo by float zero Change-Id: I09240c21caca0fa58043162e94172ddff733114d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202275 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
@@ -494,10 +494,13 @@ void ScDrawView::SetMarkedOriginalSize()
|
||||
{
|
||||
tools::Rectangle aDrawRect = pObj->GetLogicRect();
|
||||
|
||||
pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
|
||||
pObj->Resize( aDrawRect.TopLeft(), double( aOriginalSize.Width() ) / aDrawRect.GetWidth(),
|
||||
double( aOriginalSize.Height() ) / aDrawRect.GetHeight() );
|
||||
++nDone;
|
||||
if (aDrawRect.GetWidth() && aDrawRect.GetHeight())
|
||||
{
|
||||
pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
|
||||
pObj->Resize( aDrawRect.TopLeft(), double( aOriginalSize.Width() ) / aDrawRect.GetWidth(),
|
||||
double( aOriginalSize.Height() ) / aDrawRect.GetHeight() );
|
||||
++nDone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,11 +111,11 @@ void ScTabViewShell::ExecuteObject( const SfxRequest& rReq )
|
||||
pDrView->MoveMarkedObj( Size( nNewVal - aRect.Left(), 0 ) );
|
||||
else if ( nSlotId == SID_OBJECT_TOP )
|
||||
pDrView->MoveMarkedObj( Size( 0, nNewVal - aRect.Top() ) );
|
||||
else if ( nSlotId == SID_OBJECT_WIDTH )
|
||||
else if ( nSlotId == SID_OBJECT_WIDTH && aRect.GetWidth() )
|
||||
pDrView->ResizeMarkedObj( aRect.TopLeft(),
|
||||
double(nNewVal) / aRect.GetWidth(),
|
||||
1.0 );
|
||||
else // if ( nSlotId == SID_OBJECT_HEIGHT )
|
||||
else if ( nSlotId == SID_OBJECT_HEIGHT && aRect.GetHeight() )
|
||||
pDrView->ResizeMarkedObj( aRect.TopLeft(),
|
||||
1.0,
|
||||
double(nNewVal) / aRect.GetHeight() );
|
||||
|
||||
@@ -918,9 +918,12 @@ void View::SetMarkedOriginalSize()
|
||||
{
|
||||
::tools::Rectangle aDrawRect( pObj->GetLogicRect() );
|
||||
|
||||
pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
|
||||
pObj->Resize( aDrawRect.TopLeft(), double( aOleSize.Width() ) / aDrawRect.GetWidth(),
|
||||
double( aOleSize.Height() ) / aDrawRect.GetHeight() );
|
||||
if (aDrawRect.GetWidth() && aDrawRect.GetHeight())
|
||||
{
|
||||
pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
|
||||
pObj->Resize( aDrawRect.TopLeft(), double( aOleSize.Width() ) / aDrawRect.GetWidth(),
|
||||
double( aOleSize.Height() ) / aDrawRect.GetHeight() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,7 +737,8 @@ SwRect SwAnchoredDrawObject::GetObjBoundRect() const
|
||||
nTargetHeight = nHeight * (*GetDrawObj()->GetRelativeHeight());
|
||||
}
|
||||
|
||||
if ( nTargetWidth != aCurrObjRect.GetWidth( ) || nTargetHeight != aCurrObjRect.GetHeight( ) )
|
||||
if ( (nTargetWidth != aCurrObjRect.GetWidth( ) || nTargetHeight != aCurrObjRect.GetHeight( ))
|
||||
&& aCurrObjRect.GetWidth() && aCurrObjRect.GetHeight() )
|
||||
{
|
||||
SwDoc& rDoc = const_cast<SwDoc&>(GetPageFrame()->GetFormat()->GetDoc());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user