summaryrefslogtreecommitdiffstats
path: root/l10ntools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-16 13:43:27 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-16 21:45:23 +0100
commit9ac55ae5423c3a70438765057c071def18864c1e (patch)
tree7396d1d8bded812a86c3ad1b465b0ce25772fed0 /l10ntools
parentInstead of labs, use overloaded abs (diff)
downloadcore-9ac55ae5423c3a70438765057c071def18864c1e.tar.gz
core-9ac55ae5423c3a70438765057c071def18864c1e.zip
Clean up --disable-assert-always-abort loplugin:stringviewparam
(457d76327a57303124804a201d58b52ba23ccefe "loplugin:stringviewparam (l10ntools)") Change-Id: Iebe0f61de4fd4d4744b47d17d8e3ff3f80217d18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105929 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/helper.hxx4
-rw-r--r--l10ntools/source/helper.cxx12
2 files changed, 5 insertions, 11 deletions
diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx
index ff81f5792105..621218a0c1b7 100644
--- a/l10ntools/inc/helper.hxx
+++ b/l10ntools/inc/helper.hxx
@@ -28,11 +28,7 @@ OString escapeAll(
const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
/// Unescape all given character in the text
OString unEscapeAll(
-#ifdef DEBUG
- const OString& rText, const OString& rEscaped, const OString& rUnEscaped );
-#else
const OString& rText, const OString& rEscaped, std::string_view rUnEscaped );
-#endif
/// Convert special characters to XML entity references
OString QuotHTML( const OString &rString );
diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx
index 22f5cc5df506..053375085911 100644
--- a/l10ntools/source/helper.cxx
+++ b/l10ntools/source/helper.cxx
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+
+#include <o3tl/safeint.hxx>
+
#include <helper.hxx>
namespace helper {
@@ -31,15 +35,9 @@ OString escapeAll(
OString unEscapeAll(
-#ifdef DEBUG
- const OString& rText, const OString& rEscaped, const OString& rUnEscaped)
-#else
const OString& rText, const OString& rEscaped, std::string_view rUnEscaped)
-#endif
{
-#ifdef DEBUG
- assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
-#endif
+ assert( o3tl::make_unsigned(rEscaped.getLength()) == 2*rUnEscaped.length() );
OStringBuffer sReturn;
const sal_Int32 nLength = rText.getLength();
for ( sal_Int32 nIndex = 0; nIndex < nLength; ++nIndex )