summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-11-10 11:43:01 +0100
committerJulien Nabet <serval2412@yahoo.fr>2023-11-10 19:28:09 +0100
commitfe12f1d83ba80dff9f36f06decf125650eac9097 (patch)
tree02190754ea9f05b550276b97a4b89d1dbd98d54f /vcl
parent0c3b89da7cde9866bf3174a6276736c76efb8356 (diff)
Fix errors gtk4
[AWK] CustomTarget/postprocess/registry/fcfg_langpack_qtz.list /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:249:85: error: passing 'css::uno::Reference<css::accessibility::XAccessibleContext>' by value, rather pass by const lvalue reference [loplugin:passparamsbyref] css::uno::Reference<css::accessibility::XAccessibleContext> xContext) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:329:83: error: passing 'css::uno::Reference<css::accessibility::XAccessibleContext>' by value, rather pass by const lvalue reference [loplugin:passparamsbyref] css::uno::Reference<css::accessibility::XAccessibleContext> xContext) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ [XCD] registry_qtz [CUS] filter/source/svg [CUS] sw/generated [PY ] CustomTarget/writerfilter/source/ooxml/OOXMLFactory_generated.cxx [PY ] CustomTarget/writerfilter/source/ooxml/OOXMLFactory_generated.hxx [PY ] CustomTarget/writerfilter/source/ooxml/OOXMLFactory_values.hxx [PY ] CustomTarget/writerfilter/source/ooxml/qnametostr.cxx /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:311:81: error: replace function parameter of type 'const OUString &' with 'std::u16string_view' [loplugin:stringviewparam] static void applyObjectAttribute(GtkAccessible* pGtkAccessible, const OUString& rName, ~~~~~~~~~~~~~~~~^~~~~ /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:312:50: error: replace function parameter of type 'const OUString &' with 'std::u16string_view' [loplugin:stringviewparam] const OUString& rValue) ~~~~~~~~~~~~~~~~^~~~~~ 4 errors generated. /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:329:83: error: passing 'css::uno::Reference<css::accessibility::XAccessibleContext>' by value, rather pass by const lvalue reference [loplugin:passparamsbyref] css::uno::Reference<css::accessibility::XAccessibleContext> xContext) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:312:50: error: replace function parameter of type 'const OUString &' with 'std::u16string_view' [loplugin:stringviewparam] const OUString& rValue) ~~~~~~~~~~~~~~~~^~~~~~ /home/julien/lo/libreoffice/vcl/unx/gtk4/a11y.cxx:318:52: error: no member named 'toInt32' in 'std::basic_string_view<char16_t>' const int nLevel = static_cast<int>(rValue.toInt32()); ~~~~~~ ^ 1 error generated. Change-Id: I01942a3f65e87e33a093f8994e4bf44e74bafc65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159291 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk4/a11y.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 42a0fd59e4b9..2dad6615e1e3 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/accessibility/XAccessibleValue.hpp>
#include <unx/gtk/gtkframe.hxx>
#include <gtk/gtk.h>
+#include <o3tl/string_view.hxx>
#if GTK_CHECK_VERSION(4, 9, 0)
@@ -246,7 +247,7 @@ static css::uno::Reference<css::accessibility::XAccessible> get_uno_accessible(G
* in pGtkAccessible.
*/
static void applyStates(GtkAccessible* pGtkAccessible,
- css::uno::Reference<css::accessibility::XAccessibleContext> xContext)
+ css::uno::Reference<css::accessibility::XAccessibleContext>& xContext)
{
assert(pGtkAccessible);
@@ -308,14 +309,14 @@ static void applyStates(GtkAccessible* pGtkAccessible,
}
}
-static void applyObjectAttribute(GtkAccessible* pGtkAccessible, const OUString& rName,
- const OUString& rValue)
+static void applyObjectAttribute(GtkAccessible* pGtkAccessible, std::u16string_view rName,
+ std::u16string_view rValue)
{
assert(pGtkAccessible);
if (rName == u"level")
{
- const int nLevel = static_cast<int>(rValue.toInt32());
+ const int nLevel = o3tl::toInt32(rValue);
gtk_accessible_update_property(pGtkAccessible, GTK_ACCESSIBLE_PROPERTY_LEVEL, nLevel, -1);
}
}
@@ -326,7 +327,7 @@ static void applyObjectAttribute(GtkAccessible* pGtkAccessible, const OUString&
*/
static void
applyObjectAttributes(GtkAccessible* pGtkAccessible,
- css::uno::Reference<css::accessibility::XAccessibleContext> xContext)
+ css::uno::Reference<css::accessibility::XAccessibleContext>& xContext)
{
assert(pGtkAccessible);