[Libreoffice-commits] core.git: vcl/win

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 05:16:38 UTC 2018


 vcl/win/gdi/gdiimpl.cxx |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 007396b294c9ecdd7468c5dd7bc01a30905e904d
Author:     Dmitriy Shilin <dshil at fastmail.com>
AuthorDate: Wed Dec 12 17:20:49 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Dec 13 06:16:14 2018 +0100

    tdf#107792 vcl/win/gdi: reduce number of return paths
    
    Change-Id: I3e7f00a10e76933424149a931042a0611ede5d47
    Reviewed-on: https://gerrit.libreoffice.org/65036
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 5c1fa6df3e30..47548b4129b3 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -1361,17 +1361,15 @@ void WinSalGraphicsImpl::SetLineColor(Color nColor)
 HPEN WinSalGraphicsImpl::SearchStockPen(COLORREF nPenColor)
 {
     // Only screen, because printer has problems, when we use stock objects.
-    if (mrParent.isPrinter())
+    if (!mrParent.isPrinter())
     {
-        return nullptr;
-    }
-
-    const SalData* pSalData = GetSalData();
+        const SalData* pSalData = GetSalData();
 
-    for (sal_uInt16 i = 0; i < pSalData->mnStockPenCount; i++)
-    {
-        if (nPenColor == pSalData->maStockPenColorAry[i])
-            return pSalData->mhStockPenAry[i];
+        for (sal_uInt16 i = 0; i < pSalData->mnStockPenCount; i++)
+        {
+            if (nPenColor == pSalData->maStockPenColorAry[i])
+                return pSalData->mhStockPenAry[i];
+        }
     }
 
     return nullptr;


More information about the Libreoffice-commits mailing list