vcl/unx/gtk4/a11y.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit fe12f1d83ba80dff9f36f06decf125650eac9097
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Nov 10 11:43:01 2023 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Fri Nov 10 19:28:09 2023 +0100

    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.wegh...@posteo.de>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

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);
 

Reply via email to