Kaydet (Commit) c35d44ff authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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/49081Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 2a94fddc
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <algorithm>
#include <hintids.hxx> #include <hintids.hxx>
#include <editeng/charscaleitem.hxx> #include <editeng/charscaleitem.hxx>
#include <txtatr.hxx> #include <txtatr.hxx>
...@@ -694,8 +698,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM ...@@ -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 // It were cleaner and maybe necessary later on to iterate over the content
// of the text frame and call GetMinMaxSize recursively // of the text frame and call GetMinMaxSize recursively
nAktWidth = FLYINCNT_MIN_WIDTH; // 0.5 cm nAktWidth = FLYINCNT_MIN_WIDTH; // 0.5 cm
if( static_cast<long>(rMax) < USHRT_MAX ) rMax = std::max(rMax, sal_uLong(USHRT_MAX));
rMax = USHRT_MAX;
} }
else else
nAktWidth = pFrameFormat->GetFrameSize().GetWidth(); nAktWidth = pFrameFormat->GetFrameSize().GetWidth();
......
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