[SCM] qtbase packaging branch, master, updated. debian/5.7.1+dfsg-2-2-gc4d9c4f

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Jan 4 19:47:42 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtbase.git;a=commitdiff;h=c4d9c4f

The following commit has been merged in the master branch:
commit c4d9c4fc8a195061f1df873c25ab050fe9c4ec82
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Jan 4 22:42:38 2017 +0300

    Backport upstream change to fix accessibility-related crashes.
    
    Closes: #834750.
---
 debian/changelog                            |  3 ++
 debian/patches/fix_accessibility_crash.diff | 79 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 3 files changed, 83 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 435cd0b..3bec438 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 qtbase-opensource-src (5.7.1+dfsg-3) UNRELEASED; urgency=medium
 
+  [ Dmitry Shachnev ]
+  * Backport upstream change to fix accessibility-related crashes
+    (fix_accessibility_crash.diff; closes: #834750).
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Wed, 04 Jan 2017 22:39:02 +0300
 
diff --git a/debian/patches/fix_accessibility_crash.diff b/debian/patches/fix_accessibility_crash.diff
new file mode 100644
index 0000000..7df43cd
--- /dev/null
+++ b/debian/patches/fix_accessibility_crash.diff
@@ -0,0 +1,79 @@
+Description: use QPersistentModelIndex for storing a model index
+ QModelIndex is not safe to be used to store an index as it is designed
+ to be discarded right after use as the index information can change.
+ .
+ Therefore a QPersistentModelIndex should be used instead to store the
+ index. Subsequently the m_index does not need to be updated whenever
+ the model changes anymore as this is already done for us.
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=bd591064be388216
+Last-Update: 2017-01-04
+
+--- a/src/widgets/accessible/itemviews.cpp
++++ b/src/widgets/accessible/itemviews.cpp
+@@ -556,20 +556,8 @@
+             QAccessible::Id id = iter.value();
+             QAccessibleInterface *iface = QAccessible::accessibleInterface(id);
+             Q_ASSERT(iface);
+-            if (iface->role() == QAccessible::Cell || iface->role() == QAccessible::ListItem) {
+-                Q_ASSERT(iface->tableCellInterface());
+-                QAccessibleTableCell *cell = static_cast<QAccessibleTableCell*>(iface->tableCellInterface());
+-                if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsInserted
+-                        && cell->m_index.row() >= event->firstRow()) {
+-                    int newRow = cell->m_index.row() + newRows;
+-                    cell->m_index = cell->m_index.sibling(newRow, cell->m_index.column());
+-                } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::ColumnsInserted
+-                        && cell->m_index.column() >= event->firstColumn()) {
+-                    int newColumn = cell->m_index.column() + newColumns;
+-                    cell->m_index = cell->m_index.sibling(cell->m_index.row(), newColumn);
+-                }
+-            } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsInserted
+-                       && iface->role() == QAccessible::RowHeader) {
++            if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsInserted
++                && iface->role() == QAccessible::RowHeader) {
+                 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);
+                 if (cell->index >= event->firstRow()) {
+                     cell->index += newRows;
+@@ -608,27 +596,11 @@
+             if (iface->role() == QAccessible::Cell || iface->role() == QAccessible::ListItem) {
+                 Q_ASSERT(iface->tableCellInterface());
+                 QAccessibleTableCell *cell = static_cast<QAccessibleTableCell*>(iface->tableCellInterface());
+-                if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsRemoved) {
+-                    if (cell->m_index.row() < event->firstRow()) {
+-                        newCache.insert(indexOfChild(cell), id);
+-                    } else if (cell->m_index.row() > event->lastRow()) {
+-                        int newRow = cell->m_index.row() - deletedRows;
+-                        cell->m_index = cell->m_index.sibling(newRow, cell->m_index.column());
+-                        newCache.insert(indexOfChild(cell), id);
+-                    } else {
+-                        QAccessible::deleteAccessibleInterface(id);
+-                    }
+-                } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::ColumnsRemoved) {
+-                    if (cell->m_index.column() < event->firstColumn()) {
+-                        newCache.insert(indexOfChild(cell), id);
+-                    } else if (cell->m_index.column() > event->lastColumn()) {
+-                        int newColumn = cell->m_index.column() - deletedColumns;
+-                        cell->m_index = cell->m_index.sibling(cell->m_index.row(), newColumn);
+-                        newCache.insert(indexOfChild(cell), id);
+-                    } else {
+-                        QAccessible::deleteAccessibleInterface(id);
+-                    }
+-                }
++                // Since it is a QPersistentModelIndex, we only need to check if it is valid
++                if (cell->m_index.isValid())
++                    newCache.insert(indexOfChild(cell), id);
++                else
++                    QAccessible::deleteAccessibleInterface(id);
+             } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsRemoved
+                        && iface->role() == QAccessible::RowHeader) {
+                 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);
+--- a/src/widgets/accessible/itemviews_p.h
++++ b/src/widgets/accessible/itemviews_p.h
+@@ -213,7 +213,7 @@
+     QHeaderView *verticalHeader() const;
+     QHeaderView *horizontalHeader() const;
+     QPointer<QAbstractItemView > view;
+-    QModelIndex m_index;
++    QPersistentModelIndex m_index;
+     QAccessible::Role m_role;
+ 
+     void selectCell();
diff --git a/debian/patches/series b/debian/patches/series
index 792e9c6..45b0687 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,6 +3,7 @@ qsettings_simplify_logic.diff
 qsettings_XDG_CONFIG_DIRS.diff
 fix_build_on_x32.diff
 gcc_6.3.diff
+fix_accessibility_crash.diff
 
 # Debian specific.
 no_dbus_dependency.diff

-- 
qtbase packaging



More information about the pkg-kde-commits mailing list