Author: gschneider
Date: Wed Apr 14 21:08:27 2010
New Revision: 46870

URL: http://svn.reactos.org/svn/reactos?rev=46870&view=rev
Log:
[DESK]
- Create a function for updating the currently selected theme id
- Call this function before saving theme data to the registry, fixes saving 
invalid theme indexes
- Remove unnecessary header tags
See issue #5016 for more details.

Modified:
    trunk/reactos/dll/cpl/desk/appearance.c
    trunk/reactos/dll/cpl/desk/effappdlg.c

Modified: trunk/reactos/dll/cpl/desk/appearance.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/appearance.c?rev=46870&r1=46869&r2=46870&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/desk/appearance.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/appearance.c [iso-8859-1] Wed Apr 14 21:08:27 
2010
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            lib/cpl/desk/appearance.c
@@ -486,11 +485,17 @@
        return TRUE;
 }
 
+static void
+UpdateSelectedThemeId(HWND hwndDlg, GLOBALS *g)
+{
+       int sel;
+       sel = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, 
CB_GETCURSEL, 0, 0);
+       g->Theme.Id = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, 
CB_GETITEMDATA, (WPARAM)sel, 0);
+}
 
 INT_PTR CALLBACK
 AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-       INT i;
        GLOBALS *g;
        LPNMHDR lpnm;
 
@@ -538,8 +543,7 @@
                                        {
                                                
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                                                g->Theme.bHasChanged = TRUE;
-                                               i = SendDlgItemMessage(hwndDlg, 
IDC_APPEARANCE_COLORSCHEME, CB_GETCURSEL, 0, 0);
-                                               g->Theme.Id = 
SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_GETITEMDATA, 
(WPARAM)i, 0);
+                                               UpdateSelectedThemeId(hwndDlg, 
g);
                                                LoadThemeFromReg(g);
                                                //SendDlgItemMessage(hwndDlg, 
IDC_APPEARANCE_PREVIEW, WM_PAINT, 0, 0);
                                        }
@@ -557,6 +561,7 @@
                                case PSN_APPLY:
                                        if (g->Theme.bHasChanged)
                                        {
+                                               UpdateSelectedThemeId(hwndDlg, 
g);
                                                ApplyTheme(g);
                                        }
                                        return TRUE;

Modified: trunk/reactos/dll/cpl/desk/effappdlg.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/effappdlg.c?rev=46870&r1=46869&r2=46870&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] Wed Apr 14 21:08:27 2010
@@ -1,5 +1,4 @@
-/* $Id: effappdlg.c 24836 2007-02-12 03:12:56Z tkreuzer $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            dll/cpl/desk/effappdlg.c


Reply via email to