Kaydet (Commit) 6ed95903 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

nfc: use std::min in fly.cxx:CalcRel

Other parts of CalcRel are already using std::min. It makes it
much easier to read when the code is consistent.

Change-Id: Ie3b07b96e48843271683cdf6a7dabca16cfab10b
Reviewed-on: https://gerrit.libreoffice.org/50035Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 074fc4a1
...@@ -2344,13 +2344,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const ...@@ -2344,13 +2344,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const
nRelWidth = pSh->GetBrowseWidth(); nRelWidth = pSh->GetBrowseWidth();
nRelHeight = pSh->VisArea().Height(); nRelHeight = pSh->VisArea().Height();
Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
long nDiff = nRelWidth - pRel->getFramePrintArea().Width(); nRelWidth = std::min( nRelWidth, pRel->getFramePrintArea().Width() );
if ( nDiff > 0 )
nRelWidth -= nDiff;
nRelHeight -= 2*aBorder.Height(); nRelHeight -= 2*aBorder.Height();
nDiff = nRelHeight - pRel->getFramePrintArea().Height(); nRelHeight = std::min( nRelHeight, pRel->getFramePrintArea().Height() );
if ( nDiff > 0 )
nRelHeight -= nDiff;
} }
// At the moment only the "== PAGE_FRAME" and "!= PAGE_FRAME" cases are handled. // At the moment only the "== PAGE_FRAME" and "!= PAGE_FRAME" cases are handled.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment