summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-02-01 11:33:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-02-01 15:07:36 +0100
commitc35d44ff72eb00c9f572870734e4d1832e8d9a5e (patch)
tree33699f6a3436cd40d321ad82f5888ebe3d57617a
parent2a94fddcc8cca382787313d0ac4fcbfe1b9a5df8 (diff)
Use std::max
(with the nice side-effect of removing one more false -Wsign-compare from Android builds where USHRT_MAX is erroneously of type unsigned int) (the original cast of rMax (of some unsigned type) to (signed) long had probably originally been added to silence some signed-vs.-unsigned comparison warning, so would no longer be necessary when using std::max) Change-Id: I26212e731e26d885b848c7351a9ca5f9735e1f78 Reviewed-on: https://gerrit.libreoffice.org/49081 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sw/source/core/text/itratr.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 10fb397e3092..baf09a0f30fa 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <algorithm>
+
#include <hintids.hxx>
#include <editeng/charscaleitem.hxx>
#include <txtatr.hxx>
@@ -694,8 +698,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
// It were cleaner and maybe necessary later on to iterate over the content
// of the text frame and call GetMinMaxSize recursively
nAktWidth = FLYINCNT_MIN_WIDTH; // 0.5 cm
- if( static_cast<long>(rMax) < USHRT_MAX )
- rMax = USHRT_MAX;
+ rMax = std::max(rMax, sal_uLong(USHRT_MAX));
}
else
nAktWidth = pFrameFormat->GetFrameSize().GetWidth();