From 875abc7774e5fb72bc764e0ae8004a85cc9dd14f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 2 Jun 2022 18:50:13 +0200 Subject: [PATCH] Use o3tl::make_unsigned, length is known to be non-negative Change-Id: I2fac355230fd0c80016ca2259b8c6150e7160567 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135323 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- xmloff/source/text/txtflde.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index fb6cd419b923..242b641369c8 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -2853,7 +2854,7 @@ void XMLTextFieldExport::ExplodeFieldMasterName( size_t nSeparator = sMasterName.find('.', nLength); // '.' found? - if (static_cast(nSeparator) == nLength || nSeparator == std::u16string_view::npos) { + if (nSeparator == o3tl::make_unsigned(nLength) || nSeparator == std::u16string_view::npos) { SAL_WARN("xmloff.text", "no field var name!"); } else