vcl/qt5/QtFrame.cxx |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

New commits:
commit be6312f8c5ce4003d3e299493db7b4eb1c498d7d
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Sep 27 09:28:33 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Sep 28 09:32:55 2024 +0200

    qt: Use QList::indexOf instead of reimplementing logic
    
    Change-Id: If78bc419ccffd874e47419bc06ed2841ffbeab96
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174029
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 3308ccccea2e..b7691bc4d00d 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -76,23 +76,10 @@ static void SvpDamageHandler(void* handle, sal_Int32 
nExtentsX, sal_Int32 nExten
 
 namespace
 {
-sal_Int32 screenNumber(const QScreen* pScreen)
+sal_Int32 screenNumber(QScreen* pScreen)
 {
     const QList<QScreen*> screens = QApplication::screens();
-
-    sal_Int32 nScreen = 0;
-    bool bFound = false;
-    for (const QScreen* pCurScreen : screens)
-    {
-        if (pScreen == pCurScreen)
-        {
-            bFound = true;
-            break;
-        }
-        nScreen++;
-    }
-
-    return bFound ? nScreen : -1;
+    return screens.indexOf(pScreen);
 }
 }
 

Reply via email to