Eric Pouech : winhelp: Also store the relative offsets of a page in the history and back information sets .

Alexandre Julliard julliard at winehq.org
Wed Apr 23 07:59:32 CDT 2008


Module: wine
Branch: master
Commit: 857d0e063c9c82c0bf9fcf21fd5df59506fbb9e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=857d0e063c9c82c0bf9fcf21fd5df59506fbb9e7

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Tue Apr 22 22:01:02 2008 +0200

winhelp: Also store the relative offsets of a page in the history and back information sets.

---

 programs/winhelp/winhelp.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index 60362d0..4981748 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -485,11 +485,11 @@ void            WINHELP_LayoutMainWindow(WINHELP_WINDOW* win)
 
 }
 
-static void     WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page)
+static void     WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage)
 {
     unsigned        num;
 
-    if (!Globals.history.index || Globals.history.set[0].page != page)
+    if (!Globals.history.index || Globals.history.set[0].page != wpage->page)
     {
         num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]);
         /* we're full, remove latest entry */
@@ -500,10 +500,9 @@ static void     WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page)
         }
         memmove(&Globals.history.set[1], &Globals.history.set[0],
                 Globals.history.index * sizeof(Globals.history.set[0]));
-        Globals.history.set[0].page = page;
-        Globals.history.set[0].wininfo = win->info;
+        Globals.history.set[0] = *wpage;
         Globals.history.index++;
-        page->file->wRefCount++;
+        wpage->page->file->wRefCount++;
     }
     if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
 
@@ -516,9 +515,8 @@ static void     WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page)
                 (num - 1) * sizeof(win->back.set[0]));
         win->back.index--;
     }
-    win->back.set[win->back.index].page = page;
-    win->back.set[win->back.index++].wininfo = win->info;
-    page->file->wRefCount++;
+    win->back.set[win->back.index++] = *wpage;
+    wpage->page->file->wRefCount++;
 }
 
 /***********************************************************************
@@ -592,7 +590,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
 
     if (!bPopup && wpage->page && remember)
     {
-        WINHELP_RememberPage(win, wpage->page);
+        WINHELP_RememberPage(win, wpage);
     }
 
     if (!bPopup)




More information about the wine-cvs mailing list