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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 5 11:17:12 UTC 2018


 vcl/win/gdi/salgdi.cxx |   38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

New commits:
commit 6fa4c3e4778959d4591c053461329d396741ee64
Author:     Dmitriy Shilin <dshil at fastmail.com>
AuthorDate: Fri Nov 30 08:41:00 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Dec 5 12:16:45 2018 +0100

    tdf#39593 vcl: extract SysColor list deletion
    
    Change-Id: I7d1b319a1cf551e1fd6b67f13f738ab42df1b77d
    Reviewed-on: https://gerrit.libreoffice.org/64591
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx
index c1ec8bd88e2d..da06dc999e4c 100644
--- a/vcl/win/gdi/salgdi.cxx
+++ b/vcl/win/gdi/salgdi.cxx
@@ -54,6 +54,24 @@ struct SysColorEntry
 static SysColorEntry* pFirstSysColor = nullptr;
 static SysColorEntry* pActSysColor = nullptr;
 
+namespace
+{
+
+void DeleteSysColorList()
+{
+    SysColorEntry* pEntry = pFirstSysColor;
+    pActSysColor = pFirstSysColor = nullptr;
+
+    while( pEntry )
+    {
+        SysColorEntry* pTmp = pEntry->pNext;
+        delete pEntry;
+        pEntry = pTmp;
+    }
+}
+
+} // namespace
+
 // Blue7
 static PALETTEENTRY aImplExtraColor1 =
 {
@@ -315,15 +333,7 @@ void ImplFreeSalGDI()
         delete[] pSalData->mpDitherHigh;
     }
 
-    // delete SysColorList
-    SysColorEntry* pEntry = pFirstSysColor;
-    while( pEntry )
-    {
-        SysColorEntry* pTmp = pEntry->pNext;
-        delete pEntry;
-        pEntry = pTmp;
-    }
-    pFirstSysColor = nullptr;
+    DeleteSysColorList();
 
     // delete icon cache
     SalIcon* pIcon = pSalData->mpFirstIcon;
@@ -409,15 +419,7 @@ static void ImplInsertSysColorEntry( int nSysIndex )
 
 void ImplUpdateSysColorEntries()
 {
-    // delete old SysColorList
-    SysColorEntry* pEntry = pFirstSysColor;
-    while( pEntry )
-    {
-        SysColorEntry* pTmp = pEntry->pNext;
-        delete pEntry;
-        pEntry = pTmp;
-    }
-    pActSysColor = pFirstSysColor = nullptr;
+    DeleteSysColorList();
 
     // create new sys color list
     ImplInsertSysColorEntry( COLOR_ACTIVEBORDER );


More information about the Libreoffice-commits mailing list