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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 27 14:17:44 UTC 2020


 vcl/inc/qt5/Qt5VirtualDevice.hxx |    4 ++--
 vcl/qt5/Qt5VirtualDevice.cxx     |    4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 2a81fc0ee9478758f7a919519f922f0d4cb5f279
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Sep 27 12:48:02 2020 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun Sep 27 16:17:04 2020 +0200

    Replace list by vector in vcl/Qt5VirtualDevice
    
    Change-Id: I137019c15d3ee2886ad1bd53e671a89990891481
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103506
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/vcl/inc/qt5/Qt5VirtualDevice.hxx b/vcl/inc/qt5/Qt5VirtualDevice.hxx
index 89251c96d783..ad0dc3c3c804 100644
--- a/vcl/inc/qt5/Qt5VirtualDevice.hxx
+++ b/vcl/inc/qt5/Qt5VirtualDevice.hxx
@@ -22,7 +22,7 @@
 #include <salvd.hxx>
 
 #include <memory>
-#include <list>
+#include <vector>
 
 #include <QtCore/QSize>
 
@@ -32,7 +32,7 @@ enum class DeviceFormat;
 
 class Qt5VirtualDevice final : public SalVirtualDevice
 {
-    std::list<Qt5Graphics*> m_aGraphics;
+    std::vector<Qt5Graphics*> m_aGraphics;
     std::unique_ptr<QImage> m_pImage;
     DeviceFormat m_eFormat;
     QSize m_aFrameSize;
diff --git a/vcl/qt5/Qt5VirtualDevice.cxx b/vcl/qt5/Qt5VirtualDevice.cxx
index f1c7d9606c8f..10b2066ccbf6 100644
--- a/vcl/qt5/Qt5VirtualDevice.cxx
+++ b/vcl/qt5/Qt5VirtualDevice.cxx
@@ -40,7 +40,9 @@ SalGraphics* Qt5VirtualDevice::AcquireGraphics()
 
 void Qt5VirtualDevice::ReleaseGraphics(SalGraphics* pGraphics)
 {
-    m_aGraphics.remove(dynamic_cast<Qt5Graphics*>(pGraphics));
+    m_aGraphics.erase(
+        std::remove(m_aGraphics.begin(), m_aGraphics.end(), dynamic_cast<Qt5Graphics*>(pGraphics)),
+        m_aGraphics.end());
     delete pGraphics;
 }
 


More information about the Libreoffice-commits mailing list