[Libreoffice-commits] core.git: vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 30 12:15:49 UTC 2018


 vcl/Library_vclplug_qt5.mk          |    1 
 vcl/inc/qt5/Qt5AccessibleValue.hxx  |   38 ----------------------
 vcl/inc/qt5/Qt5AccessibleWidget.hxx |   10 +++++
 vcl/qt5/Qt5AccessibleValue.cxx      |   61 ------------------------------------
 vcl/qt5/Qt5AccessibleWidget.cxx     |   46 ++++++++++++++++++++++++---
 5 files changed, 50 insertions(+), 106 deletions(-)

New commits:
commit ccc53c51f35e38750b26768dd54fc311a696afba
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Oct 29 17:26:52 2018 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Oct 30 13:15:25 2018 +0100

    qt5 a11y: Fix QAccessibleValueInterface
    
    Needs to be part of Qt5AccessibleWidget
    
    Change-Id: I3543cb3b5834c9967066733f0dbd73e974175892
    Reviewed-on: https://gerrit.libreoffice.org/62515
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index ba7e41cefa3b..cd3605720534 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -81,7 +81,6 @@ endif
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5AccessibleEventListener \
-    vcl/qt5/Qt5AccessibleValue \
     vcl/qt5/Qt5AccessibleWidget \
     vcl/qt5/Qt5Bitmap \
     vcl/qt5/Qt5Clipboard \
diff --git a/vcl/inc/qt5/Qt5AccessibleValue.hxx b/vcl/inc/qt5/Qt5AccessibleValue.hxx
deleted file mode 100644
index 4805a4d38073..000000000000
--- a/vcl/inc/qt5/Qt5AccessibleValue.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#pragma once
-
-#include <vclpluginapi.h>
-
-#include <QtGui/QAccessibleValueInterface>
-
-#include <QtCore/QVariant>
-
-#include <com/sun/star/accessibility/XAccessible.hpp>
-
-class Qt5Frame;
-class Qt5Widget;
-
-class VCLPLUG_QT5_PUBLIC Qt5AccessibleValue : public QAccessibleValueInterface
-{
-public:
-    Qt5AccessibleValue(const css::uno::Reference<css::accessibility::XAccessible> xAccessible);
-
-    QVariant currentValue() const override;
-    QVariant maximumValue() const override;
-    QVariant minimumStepSize() const override;
-    QVariant minimumValue() const override;
-    void setCurrentValue(const QVariant& value) override;
-
-private:
-    css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
index 338bc7b5c36a..e358f966b622 100644
--- a/vcl/inc/qt5/Qt5AccessibleWidget.hxx
+++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
@@ -32,7 +32,8 @@ class Qt5Widget;
 class VCLPLUG_QT5_PUBLIC Qt5AccessibleWidget : public QObject,
                                                public QAccessibleInterface,
                                                public QAccessibleActionInterface,
-                                               public QAccessibleTextInterface
+                                               public QAccessibleTextInterface,
+                                               public QAccessibleValueInterface
 {
     Q_OBJECT
 
@@ -93,6 +94,13 @@ public:
     QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,
                              int* startOffset, int* endOffset) const override;
 
+    // QAccessibleValueInterface
+    QVariant currentValue() const override;
+    QVariant maximumValue() const override;
+    QVariant minimumStepSize() const override;
+    QVariant minimumValue() const override;
+    void setCurrentValue(const QVariant& value) override;
+
     // Factory
     static QAccessibleInterface* customFactory(const QString& classname, QObject* object);
 
diff --git a/vcl/qt5/Qt5AccessibleValue.cxx b/vcl/qt5/Qt5AccessibleValue.cxx
deleted file mode 100644
index ab95127aca12..000000000000
--- a/vcl/qt5/Qt5AccessibleValue.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <Qt5AccessibleValue.hxx>
-
-#include <QtGui/QAccessibleInterface>
-
-#include <com/sun/star/accessibility/XAccessible.hpp>
-#include <com/sun/star/accessibility/XAccessibleValue.hpp>
-
-using namespace css;
-using namespace css::accessibility;
-using namespace css::uno;
-
-Qt5AccessibleValue::Qt5AccessibleValue(const Reference<XAccessible> xAccessible)
-    : m_xAccessible(xAccessible)
-{
-}
-
-QVariant Qt5AccessibleValue::currentValue() const
-{
-    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
-    if (!xValue.is())
-        return QVariant();
-    double aDouble = 0;
-    xValue->getCurrentValue() >>= aDouble;
-    return QVariant(aDouble);
-}
-QVariant Qt5AccessibleValue::maximumValue() const
-{
-    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
-    if (!xValue.is())
-        return QVariant();
-    double aDouble = 0;
-    xValue->getMaximumValue() >>= aDouble;
-    return QVariant(aDouble);
-}
-QVariant Qt5AccessibleValue::minimumStepSize() const { return QVariant(); }
-QVariant Qt5AccessibleValue::minimumValue() const
-{
-    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
-    if (!xValue.is())
-        return QVariant();
-    double aDouble = 0;
-    xValue->getMinimumValue() >>= aDouble;
-    return QVariant(aDouble);
-}
-void Qt5AccessibleValue::setCurrentValue(const QVariant& value)
-{
-    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
-    if (!xValue.is())
-        return;
-    xValue->setCurrentValue(Any(value.toDouble()));
-}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index 06712281c2a0..ba9ae72f14c3 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -23,7 +23,6 @@
 #include <QtGui/QAccessibleInterface>
 
 #include <Qt5AccessibleEventListener.hxx>
-#include <Qt5AccessibleValue.hxx>
 #include <Qt5Frame.hxx>
 #include <Qt5Tools.hxx>
 #include <Qt5Widget.hxx>
@@ -41,6 +40,7 @@
 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
 #include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
 #include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 
 #include <comphelper/AccessibleImplementationHelper.hxx>
@@ -619,6 +619,8 @@ void* Qt5AccessibleWidget::interface_cast(QAccessible::InterfaceType t)
         return static_cast<QAccessibleActionInterface*>(this);
     if (t == QAccessible::TextInterface)
         return static_cast<QAccessibleTextInterface*>(this);
+    if (t == QAccessible::ValueInterface)
+        return static_cast<QAccessibleValueInterface*>(this);
     return nullptr;
 }
 
@@ -714,10 +716,7 @@ QStringList Qt5AccessibleWidget::keyBindingsForAction(const QString& actionName)
     return keyBindings;
 }
 
-QAccessibleValueInterface* Qt5AccessibleWidget::valueInterface()
-{
-    return new Qt5AccessibleValue(m_xAccessible);
-}
+QAccessibleValueInterface* Qt5AccessibleWidget::valueInterface() { return nullptr; }
 
 QAccessibleTextInterface* Qt5AccessibleWidget::textInterface() { return nullptr; }
 
@@ -822,4 +821,41 @@ QString Qt5AccessibleWidget::textBeforeOffset(int /* offset */,
     return QString();
 }
 
+// QAccessibleValueInterface
+QVariant Qt5AccessibleWidget::currentValue() const
+{
+    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
+    if (!xValue.is())
+        return QVariant();
+    double aDouble = 0;
+    xValue->getCurrentValue() >>= aDouble;
+    return QVariant(aDouble);
+}
+QVariant Qt5AccessibleWidget::maximumValue() const
+{
+    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
+    if (!xValue.is())
+        return QVariant();
+    double aDouble = 0;
+    xValue->getMaximumValue() >>= aDouble;
+    return QVariant(aDouble);
+}
+QVariant Qt5AccessibleWidget::minimumStepSize() const { return QVariant(); }
+QVariant Qt5AccessibleWidget::minimumValue() const
+{
+    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
+    if (!xValue.is())
+        return QVariant();
+    double aDouble = 0;
+    xValue->getMinimumValue() >>= aDouble;
+    return QVariant(aDouble);
+}
+void Qt5AccessibleWidget::setCurrentValue(const QVariant& value)
+{
+    Reference<XAccessibleValue> xValue(m_xAccessible->getAccessibleContext(), UNO_QUERY);
+    if (!xValue.is())
+        return;
+    xValue->setCurrentValue(Any(value.toDouble()));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list