Bug#824035: impress: adding/moving slides gets slower and slower
Package: libreoffice-impress
Version: 1:5.1.3~rc1-1
Severity: important
Tags: upstream patch fixed-upstream
User: debian-accessibility@lists.debian.org
Usertags: a11y
Hello,
When accessibility is enabled, and opening a big file in impress, adding
and moving slides takes a long time, and longer and longer while doing
such kinds of operations, making Impress just ususable for big files.
I reported it upstream:
https://bugs.documentfoundation.org/show_bug.cgi?id=99392
and they wrote a fix, which I backported to the Debian 1:5.1.3~rc1-1
package, confirming that this does improve the issue a lot, though not
fixing it completely, but at least Impress becomes usable again with my
big file.
Could you apply that upstream patch into the Debian package?
Thanks,
Samuel
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.5.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libreoffice-impress depends on:
ii dpkg 1.18.4
ii libc6 2.22-7
ii libetonyek-0.1-1 0.1.6-1
ii libgcc1 1:6-20160109-1
ii libgl1-mesa-glx [libgl1] 11.1.3-1
ii libglew1.13 1.13.0-2
ii libglu1-mesa [libglu1] 9.0.0-2.1
ii libmwaw-0.3-3 0.3.7-1
ii libodfgen-0.1-1 0.1.6-1
ii libreoffice-core 1:5.1.3~rc1-1
ii libreoffice-draw 1:5.1.3~rc1-1
ii librevenge-0.0-0 0.0.4-4
ii libstdc++6 6-20160109-1
ii libxml2 2.9.3+dfsg1-1
ii uno-libs3 5.1.3~rc1-1
ii ure 5.1.3~rc1-1
ii zlib1g 1:1.2.8.dfsg-2+b1
Versions of packages libreoffice-impress recommends:
ii libreoffice-avmedia-backend-gstreamer 1:5.1.3~rc1-1
Versions of packages libreoffice-impress suggests:
ii bluez 5.36-1
Versions of packages libreoffice-core depends on:
ii fontconfig 2.11.0-6.4
ii fonts-opensymbol 2:102.7+LibO5.1.3~rc1-1
ii libboost-date-time1.58.0 1.58.0+dfsg-5+b1
ii libc6 2.22-7
ii libcairo2 1.14.6-1+b1
ii libclucene-contribs1v5 2.3.3.4-4.1
ii libclucene-core1v5 2.3.3.4-4.1
ii libcmis-0.5-5v5 0.5.1-2
ii libcups2 2.1.3-5
ii libcurl3-gnutls 7.47.0-1
ii libdbus-1-3 1.10.8-1
ii libdbus-glib-1-2 0.106-1
ii libdconf1 0.26.0-1
ii libeot0 0.01-3
ii libexpat1 2.1.1-1
ii libexttextcat-2.0-0 3.4.4-1
ii libfontconfig1 2.11.0-6.4
ii libfreetype6 2.6.3-3+b1
ii libgcc1 1:6-20160109-1
ii libgl1-mesa-glx [libgl1] 11.1.3-1
ii libglew1.13 1.13.0-2
ii libglib2.0-0 2.48.0-1
ii libgltf-0.0-0v5 0.0.2-4+b1
ii libglu1-mesa [libglu1] 9.0.0-2.1
ii libgraphite2-3 1.3.8-1
ii libharfbuzz-icu0 1.0.1-1+b1
ii libharfbuzz0b 1.0.1-1+b1
ii libhunspell-1.3-0 1.3.4-2
ii libhyphen0 2.8.8-3
ii libice6 2:1.0.9-1+b1
ii libicu55 55.1-7
ii libjpeg62-turbo 1:1.4.2-2
ii liblangtag1 0.5.7-2
ii liblcms2-2 2.7-1
ii libldap-2.4-2 2.4.42+dfsg-2+b2
ii libmythes-1.2-0 2:1.2.4-1
ii libneon27-gnutls 0.30.1-3
ii libnspr4 2:4.12-2
ii libnss3 2:3.23-2
ii libodfgen-0.1-1 0.1.6-1
ii libpcre3 2:8.38-3.1
ii libpng16-16 1.6.21-4
ii librdf0 1.0.17-1+b1
ii libreoffice-common 1:5.1.3~rc1-1
ii librevenge-0.0-0 0.0.4-4
ii libsm6 2:1.2.2-1+b1
ii libssl1.0.2 1.0.2h-1
ii libstdc++6 6-20160109-1
ii libx11-6 2:1.6.3-1
ii libxext6 2:1.3.3-1
ii libxinerama1 2:1.1.3-1+b1
ii libxml2 2.9.3+dfsg1-1
ii libxrandr2 2:1.5.0-1
ii libxrender1 1:0.9.9-2
ii libxslt1.1 1.1.28-2.1
ii uno-libs3 5.1.3~rc1-1
ii ure 5.1.3~rc1-1
ii zlib1g 1:1.2.8.dfsg-2+b1
Versions of packages libreoffice-draw depends on:
ii dpkg 1.18.4
ii libavahi-client3 0.6.32~rc+dfsg-1
ii libavahi-common3 0.6.32~rc+dfsg-1
ii libc6 2.22-7
ii libcdr-0.1-1 0.1.2-2
ii libdbus-1-3 1.10.8-1
ii libdbus-glib-1-2 0.106-1
ii libfreehand-0.1-1 0.1.1-1
ii libgcc1 1:6-20160109-1
ii libglib2.0-0 2.48.0-1
ii libicu55 55.1-7
ii liblcms2-2 2.7-1
ii libmspub-0.1-1 0.1.2-2+b1
ii libmwaw-0.3-3 0.3.7-1
ii libodfgen-0.1-1 0.1.6-1
ii libpagemaker-0.0-0 0.0.3-1
ii libreoffice-core 1:5.1.3~rc1-1
ii librevenge-0.0-0 0.0.4-4
ii libstdc++6 6-20160109-1
ii libvisio-0.1-1 0.1.5-1
ii libwpd-0.10-10 0.10.1-1
ii libwpg-0.3-3 0.3.1-1
ii libxml2 2.9.3+dfsg1-1
ii uno-libs3 5.1.3~rc1-1
ii ure 5.1.3~rc1-1
ii zlib1g 1:1.2.8.dfsg-2+b1
-- no debconf information
--
Samuel
tohi.cybercable.fr (212.198.0.3) si une personne se reconnait derriere
cette adresse que ce soit un pirate ou une victime qu'il se manifeste,
cette personne pourrait bien etre un petit malin
-+- Fred in NPC : Mamaaaaan, y a le routeur qui veut me hacker -+-
>From 2fb31f248fe86c52c1070cbc8b18b24872a4bedc Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 6 May 2016 09:33:37 +0200
Subject: improve perf. of VCL event dispatch, take II
Change-Id: I5052f0c3e2c8739b336da52ef9590e5008255247
Index: libreoffice-5.1.3~rc1/vcl/inc/window.h
===================================================================
--- libreoffice-5.1.3~rc1.orig/vcl/inc/window.h
+++ libreoffice-5.1.3~rc1/vcl/inc/window.h
@@ -230,6 +230,8 @@ public:
VclPtr<vcl::Window> mpLastFocusWindow;
VclPtr<vcl::Window> mpDlgCtrlDownWindow;
std::vector<Link<VclWindowEvent&,void>> maEventListeners;
+ int mnEventListenersIteratingCount;
+ std::set<Link<VclWindowEvent&,void>> maEventListenersDeleted;
std::vector<Link<VclWindowEvent&,void>> maChildEventListeners;
// The canvas interface for this VCL window. Is persistent after the first GetCanvas() call
Index: libreoffice-5.1.3~rc1/vcl/source/window/event.cxx
===================================================================
--- libreoffice-5.1.3~rc1.orig/vcl/source/window/event.cxx
+++ libreoffice-5.1.3~rc1/vcl/source/window/event.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/awt/MouseEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/awt/MouseButton.hpp>
+#include <comphelper/scopeguard.hxx>
namespace vcl {
@@ -216,11 +217,22 @@ void Window::CallEventListeners( sal_uLo
{
// Copy the list, because this can be destroyed when calling a Link...
std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
+ // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
+ mpWindowImpl->mnEventListenersIteratingCount++;
+ auto& rWindowImpl = *mpWindowImpl;
+ comphelper::ScopeGuard aGuard(
+ [&rWindowImpl]()
+ {
+ rWindowImpl.mnEventListenersIteratingCount--;
+ if (rWindowImpl.mnEventListenersIteratingCount == 0)
+ rWindowImpl.maEventListenersDeleted.clear();
+ }
+ );
for ( Link<VclWindowEvent&,void>& rLink : aCopy )
{
if (aDelData.IsDead()) break;
// check this hasn't been removed in some re-enterancy scenario fdo#47368
- if( std::find(mpWindowImpl->maEventListeners.begin(), mpWindowImpl->maEventListeners.end(), rLink) != mpWindowImpl->maEventListeners.end() )
+ if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
rLink.Call( aEvent );
}
}
@@ -278,6 +290,8 @@ void Window::RemoveEventListener( const
{
auto& rListeners = mpWindowImpl->maEventListeners;
rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
+ if (mpWindowImpl->mnEventListenersIteratingCount)
+ mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
}
}
Index: libreoffice-5.1.3~rc1/vcl/source/window/window.cxx
===================================================================
--- libreoffice-5.1.3~rc1.orig/vcl/source/window/window.cxx
+++ libreoffice-5.1.3~rc1/vcl/source/window/window.cxx
@@ -631,6 +631,7 @@ WindowImpl::WindowImpl( WindowType nType
mpNextOverlap = nullptr; // next overlap window of frame
mpLastFocusWindow = nullptr; // window for focus restore
mpDlgCtrlDownWindow = nullptr; // window for dialog control
+ mnEventListenersIteratingCount = 0;
mpFirstDel = nullptr; // Dtor notification list
mpUserData = nullptr; // user data
mpCursor = nullptr; // cursor
Reply to: