From f29e3dbe015571d49d4262f4623a165a0cbc94a3 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 16 Aug 2022 09:39:01 +0200 Subject: 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 --- vcl/qt5/QtAccessibleWidget.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/qt5') 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(object); + QtXAccessible* pXAccessible = static_cast(object); if (pXAccessible && pXAccessible->m_xAccessible.is()) return new QtAccessibleWidget(pXAccessible->m_xAccessible, object); } -- cgit