diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 16:07:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 21:43:09 +0100 |
commit | 50d3ad9127aaf63afcfa299adcea060c9b09faa4 (patch) | |
tree | af3bf48ae8e31e180003c9f998831dd7777d1f5b /i18nutil | |
parent | cd4a239063a77d49fe178255c20f0558e337a82f (diff) |
Instead of labs, use overloaded abs
...more likely to pick an appropriate version for the involved integer types,
esp. after the recent long -> tools::Long changes
Change-Id: Ia91259ca35aaf74b0e907de6831fc926f30057f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18nutil')
-rw-r--r-- | i18nutil/source/utility/paper.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx index 1b87b37871c9..4e94f9b36a14 100644 --- a/i18nutil/source/utility/paper.cxx +++ b/i18nutil/source/utility/paper.cxx @@ -173,10 +173,10 @@ void PaperInfo::doSloppyFit() { if (i == PAPER_USER) continue; - tools::Long lDiffW = labs(aDinTab[i].m_nWidth - m_nPaperWidth); - tools::Long lDiffH = labs(aDinTab[i].m_nHeight - m_nPaperHeight); - tools::Long lFlipDiffW = labs(aDinTab[i].m_nHeight - m_nPaperWidth); - tools::Long lFlipDiffH = labs(aDinTab[i].m_nWidth - m_nPaperHeight); + tools::Long lDiffW = std::abs(aDinTab[i].m_nWidth - m_nPaperWidth); + tools::Long lDiffH = std::abs(aDinTab[i].m_nHeight - m_nPaperHeight); + tools::Long lFlipDiffW = std::abs(aDinTab[i].m_nHeight - m_nPaperWidth); + tools::Long lFlipDiffH = std::abs(aDinTab[i].m_nWidth - m_nPaperHeight); if ( (lDiffW < MAXSLOPPY && lDiffH < MAXSLOPPY) || (lFlipDiffW < MAXSLOPPY && lFlipDiffH < MAXSLOPPY) ) @@ -193,8 +193,8 @@ bool PaperInfo::sloppyEqual(const PaperInfo &rOther) const { return ( - (labs(m_nPaperWidth - rOther.m_nPaperWidth) < MAXSLOPPY) && - (labs(m_nPaperHeight - rOther.m_nPaperHeight) < MAXSLOPPY) + (std::abs(m_nPaperWidth - rOther.m_nPaperWidth) < MAXSLOPPY) && + (std::abs(m_nPaperHeight - rOther.m_nPaperHeight) < MAXSLOPPY) ); } @@ -205,11 +205,11 @@ tools::Long PaperInfo::sloppyFitPageDimension(tools::Long nDimension) if (i == PAPER_USER) continue; tools::Long lDiff; - lDiff = labs(aDinTab[i].m_nWidth - nDimension); + lDiff = std::abs(aDinTab[i].m_nWidth - nDimension); if ( lDiff < MAXSLOPPY ) return aDinTab[i].m_nWidth; - lDiff = labs(aDinTab[i].m_nHeight - nDimension); + lDiff = std::abs(aDinTab[i].m_nHeight - nDimension); if ( lDiff < MAXSLOPPY ) return aDinTab[i].m_nHeight; } |