Fix useless assert(true) (which would never fire)

...and simplify the code a bit.  It had been introduced with
0a1d5af2a1 "tdf#115429 sax: assert if exporting an
invalid XML attribute/element", apparently meant to be an assert(false) instead.
A `make check screenshot` didn't cause the (now active) assert to fire in my
local build.

Change-Id: I275661f290491ff2d094288522f98d77cb4662ec
Reviewed-on: https://gerrit.libreoffice.org/82631
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
This commit is contained in:
Stephan Bergmann
2019-11-13 18:39:35 +01:00
parent c1fb36e477
commit 7e09d08807

View File

@@ -578,10 +578,8 @@ void CheckValidName(OUString const& rName)
auto const c(rName[i]);
if (c == ':')
{
if (hasColon)
assert("only one colon allowed");
else
hasColon = true;
assert(!hasColon && "only one colon allowed");
hasColon = true;
}
else if (!rtl::isAsciiAlphanumeric(c) && c != '_' && c != '-' && c != '.' &&
!inrange(c, 0x00C0, 0x00D6) && !inrange(c, 0x00D8, 0x00F6) &&