gtk4 a11y: Fix '--enable-werror' GCC build
`offset` is unsigned int, so can't be negative,
causing an `--enable-werror --enable-gtk4` GCC 13.2
build on Debian testing to fail like this:
.../libreoffice-WORKTREE/vcl/unx/gtk4/gtkaccessibletext.cxx: In function ‘GBytes* lo_accessible_text_get_contents_at(GtkAccessibleText*, unsigned int, GtkAccessibleTextGranularity, unsigned int*, unsigned int*)’:
.../libreoffice-WORKTREE/vcl/unx/gtk4/gtkaccessibletext.cxx:79:16: error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]
79 | if (offset < 0 || offset > o3tl::make_unsigned(xText->getCharacterCount()))
| ~~~~~~~^~~
cc1plus: all warnings being treated as errors
Change-Id: Ib5a67c9d5948802fe269275c79f624df09712011
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163802
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/vcl/unx/gtk4/gtkaccessibletext.cxx b/vcl/unx/gtk4/gtkaccessibletext.cxx
index 32e1448..c982754 100644
--- a/vcl/unx/gtk4/gtkaccessibletext.cxx
+++ b/vcl/unx/gtk4/gtkaccessibletext.cxx
@@ -76,7 +76,7 @@ static GBytes* lo_accessible_text_get_contents_at(GtkAccessibleText* self, unsig
if (!xText.is())
return nullptr;
if (offset < 0 || offset > o3tl::make_unsigned(xText->getCharacterCount()))
if (offset > o3tl::make_unsigned(xText->getCharacterCount()))
{
SAL_WARN("vcl.gtk",
"lo_accessible_text_get_contents_at called with invalid offset: " << offset);