diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-27 09:28:33 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-28 09:32:55 +0200 |
commit | be6312f8c5ce4003d3e299493db7b4eb1c498d7d (patch) | |
tree | 46639fb07227f402559105aa8a039850e78b653d | |
parent | 25e5f050756bb25d67b6a90433c0a50a149d5dc0 (diff) |
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.weghorn@posteo.de>
Tested-by: Jenkins
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 17 |
1 files changed, 2 insertions, 15 deletions
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); } } |