vcl/qt5/QtAccessibleWidget.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f29e3dbe015571d49d4262f4623a165a0cbc94a3
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Aug 16 09:39:01 2022 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Aug 16 11:43:44 2022 +0200

    qt a11y: Replace dynamic_cast with static_cast
    
    The Qt doc on implementing accessible plugins [1]
    says:
    
    > Note that `object` will always be an instance of `classname`.
    
    Therefore, `static_cast` can be used here to avoid the
    cost of `dynamic_cast`.
    
    [1] 
https://doc.qt.io/qt-6/accessible-qwidget.html#implementing-accessible-plugins
    
    Change-Id: I57721c927808fa710b7d790c54d01bd899146a60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138341
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index c0ed4a2096f7..9d2b17f86de7 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -730,7 +730,7 @@ QAccessibleInterface* 
QtAccessibleWidget::customFactory(const QString& classname
     }
     if (classname == QLatin1String("QtXAccessible") && object)
     {
-        QtXAccessible* pXAccessible = dynamic_cast<QtXAccessible*>(object);
+        QtXAccessible* pXAccessible = static_cast<QtXAccessible*>(object);
         if (pXAccessible && pXAccessible->m_xAccessible.is())
             return new QtAccessibleWidget(pXAccessible->m_xAccessible, object);
     }

Reply via email to