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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 30 20:02:48 UTC 2018


 vcl/qt5/Qt5AccessibleWidget.cxx |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 612e8f05d72b96c86122396ffc960cd76a742325
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Oct 30 17:23:35 2018 +0100
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue Oct 30 21:02:25 2018 +0100

    Qt5 actually return the selection
    
    This broke my Windows build with interesting error messages:
    
    Qt5AccessibleWidget.cxx(772): error C2440: "=": "sal_Int32 *"
    kann nicht in "int *" konvertiert werden
    
    Qt5AccessibleWidget.cxx(772): note: Die Typen, auf die verwiesen
    wird, sind nicht verknuepft; die Konvertierung erfordert einen
    reinterpret_cast-Operator oder eine Typumwandlung im C- oder
    Funktionsformat.
    
    Same for line 774.
    
    So actually return the selection parts depending on the provided
    int pointers.
    
    Change-Id: Iffbe4481883450b9dacefa867ba7035861d62cdf
    Reviewed-on: https://gerrit.libreoffice.org/62635
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index ba9ae72f14c3..637dd78ba343 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -761,18 +761,22 @@ void Qt5AccessibleWidget::scrollToSubstring(int /* startIndex */, int /* endInde
 {
     SAL_INFO("vcl.qt5", "Unsupported QAccessibleTextInterface::scrollToSubstring");
 }
-void Qt5AccessibleWidget::selection(int /* selectionIndex */, int* startOffset,
-                                    int* endOffset) const
+
+void Qt5AccessibleWidget::selection(int selectionIndex, int* startOffset, int* endOffset) const
 {
-    Reference<XAccessibleText> xText(m_xAccessible, UNO_QUERY);
-    if (!xText.is())
+    if (!startOffset && !endOffset)
         return;
 
-    sal_Int32 nStart = xText->getSelectionStart();
-    startOffset = &nStart;
-    sal_Int32 nEnd = xText->getSelectionEnd();
-    endOffset = &nEnd;
+    Reference<XAccessibleText> xText;
+    if (selectionIndex == 0)
+        xText = Reference<XAccessibleText>(m_xAccessible, UNO_QUERY);
+
+    if (startOffset)
+        *startOffset = xText.is() ? xText->getSelectionStart() : 0;
+    if (endOffset)
+        *endOffset = xText.is() ? xText->getSelectionEnd() : 0;
 }
+
 int Qt5AccessibleWidget::selectionCount() const
 {
     Reference<XAccessibleText> xText(m_xAccessible, UNO_QUERY);


More information about the Libreoffice-commits mailing list