Message-Id: <199702131659.BAA18395@ff.iij4u.or.jp>
To: dumoulin@titan.ksc.nasa.gov
Subject: two fixes to wvart.cpp
From: Masaki Ishido <ishidou@po.iijnet.or.jp>
X-Mailer: Winbiff [Version 1.61]
Date: Fri, 14 Feb 1997 02:00:06 +0900
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Jim,

Here is two fixes to wvart.cpp for

1) Horizontal scroll problem (I'm not sure this works for Win16
   version, but it works for Win32 version)

2) tracking newly arrived cross posted article

hope it helps you.

Regards;
-- 
Masaki Ishido
Kawasaki City, Kanagawa, JAPAN

*** old\wvart.cpp	Sun Feb 09 06:56:30 1997
--- wvart.cpp	Thu Feb 13 14:49:58 1997
***************
*** 436,443 ****
    int ih, j;
    int found;
    long charnum;
!  // _int16 X, Y;
!   WORD X,Y;
    int CtrlState;
    TypLine far *LinePtr;
    TypBlock far *BlockPtr;
--- 436,443 ----
    int ih, j;
    int found;
    long charnum;
!   _int16 X, Y;
!   //WORD X,Y;
    int CtrlState;
    TypLine far *LinePtr;
    TypBlock far *BlockPtr;
***************
*** 548,561 ****
          X = LOWORD (lParam);
          Y = HIWORD (lParam);
  
!         if (X < ArtSideSpace) {
            TempX = (long) ArtSideSpace;
          }
          else {
!           TempX = (long) min (X, ThisDoc->ScXWidth);
          }
  
!         if (Y < ArtTopSpace) {
            TempY = ArtTopSpace;
          }
          else {
--- 548,561 ----
          X = LOWORD (lParam);
          Y = HIWORD (lParam);
  
!         if ((int)X < (int)ArtSideSpace) {
            TempX = (long) ArtSideSpace;
          }
          else {
!           TempX = (long) min ((int)X, (int)ThisDoc->ScXWidth);
          }
  
!         if ((int)Y < (int)ArtTopSpace) {
            TempY = ArtTopSpace;
          }
          else {
***************
*** 605,611 ****
            do                    // keep scrolling until the mouse moves.
             {
              TempX = ArtSideSpace;
!             if (Y < ArtTopSpace) {
                TempY = ArtTopSpace;
              }
              else {
--- 605,611 ----
            do                    // keep scrolling until the mouse moves.
             {
              TempX = ArtSideSpace;
!             if ((int)Y < (int)ArtTopSpace) {
                TempY = ArtTopSpace;
              }
              else {
***************
*** 627,645 ****
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == (unsigned int) CursorLocation.x) && (Y == (unsigned int) CursorLocation.y) &&
                   (ThisDoc->ScXOffset > 0));
          }
  
          GetScrollRange (ThisDoc->hDocWnd, SB_HORZ, &ScMin, &ScMax);
          // Check to see if text selection needs to scroll right.
!         if ((X > ThisDoc->ScXWidth) && (ThisDoc->ScXOffset < (unsigned int) ScMax)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
             {
              TempX = ThisDoc->ScXWidth;
!             if (Y < ArtTopSpace) {
                TempY = ArtTopSpace;
              }
              else {
--- 627,645 ----
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == CursorLocation.x) && (Y == CursorLocation.y) &&
                   (ThisDoc->ScXOffset > 0));
          }
  
          GetScrollRange (ThisDoc->hDocWnd, SB_HORZ, &ScMin, &ScMax);
          // Check to see if text selection needs to scroll right.
!         if (((int)X > (int)ThisDoc->ScXWidth) && (ThisDoc->ScXOffset < (unsigned int) ScMax)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
             {
              TempX = ThisDoc->ScXWidth;
!             if ((int)Y < (int)ArtTopSpace) {
                TempY = ArtTopSpace;
              }
              else {
***************
*** 663,684 ****
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == (unsigned int) CursorLocation.x) && (Y == (unsigned int) CursorLocation.y)
                   && ((int) ThisDoc->ScXOffset < ScMax));
          }
  
          // Check to see if text selection needs to scroll up.
!         if ((Y < 0) && (ThisDoc->TopLineOrd > 0)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
             {
              TempY = ArtTopSpace;
!             if (X < ArtSideSpace) {
                TempX = ArtSideSpace;
              }
              else {
!               TempX = min (X, ThisDoc->ScXWidth);
              }
  
              Previous.LineNum = ThisDoc->EndSelect.LineNum;
--- 663,684 ----
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == CursorLocation.x) && (Y == CursorLocation.y)
                   && ((int) ThisDoc->ScXOffset < ScMax));
          }
  
          // Check to see if text selection needs to scroll up.
!         if (((int)Y < 0) && (ThisDoc->TopLineOrd > 0)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
             {
              TempY = ArtTopSpace;
!             if ((int)X < (int)ArtSideSpace) {
                TempX = ArtSideSpace;
              }
              else {
!               TempX = min ((int)X, (int)ThisDoc->ScXWidth);
              }
  
              Previous.LineNum = ThisDoc->EndSelect.LineNum;
***************
*** 693,705 ****
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X ==(unsigned int) CursorLocation.x) && (Y == (unsigned int) CursorLocation.y)
                   && (ThisDoc->TopLineOrd > 0));
          }
  
          GetScrollRange (ThisDoc->hDocWnd, SB_VERT, &ScMin, &ScMax);
          // Check to see if text selection needs to scroll down.
!         if ((Y > ThisDoc->ScYHeight) && (ThisDoc->TopLineOrd < (unsigned int) ScMax)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
--- 693,705 ----
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == CursorLocation.x) && (Y == CursorLocation.y)
                   && (ThisDoc->TopLineOrd > 0));
          }
  
          GetScrollRange (ThisDoc->hDocWnd, SB_VERT, &ScMin, &ScMax);
          // Check to see if text selection needs to scroll down.
!         if (((int)Y > (int)ThisDoc->ScYHeight) && (ThisDoc->TopLineOrd < (unsigned int) ScMax)) {
            ScrollText = TRUE;
  
            do                    // keep scrolling until the mouse moves.
***************
*** 709,719 ****
                TempY = (long) (ArtTopSpace + (ThisDoc->TotalLines - ThisDoc->TopLineOrd - 1) * ArtLineHeight);
              }
  
!             if (X < ArtSideSpace) {
                TempX = ArtSideSpace;
              }
              else {
!               TempX = min (X, ThisDoc->ScXWidth);
              }
  
              Previous.LineNum = ThisDoc->EndSelect.LineNum;
--- 709,719 ----
                TempY = (long) (ArtTopSpace + (ThisDoc->TotalLines - ThisDoc->TopLineOrd - 1) * ArtLineHeight);
              }
  
!             if ((int)X < (int)ArtSideSpace) {
                TempX = ArtSideSpace;
              }
              else {
!               TempX = min ((int)X, (int)ThisDoc->ScXWidth);
              }
  
              Previous.LineNum = ThisDoc->EndSelect.LineNum;
***************
*** 728,745 ****
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == (unsigned int) CursorLocation.x) && (Y == (unsigned int) CursorLocation.y)
                   && (ThisDoc->TopLineOrd < (unsigned int) ScMax));
          }
  
          if (!ScrollText) {
!           if (X < ArtSideSpace) {
              TempX = ArtSideSpace;
            }
            else {
!             TempX = min (X, ThisDoc->ScXWidth);
            }
!           if (Y < ArtTopSpace) {
              TempY = ArtTopSpace;
            }
            else {
--- 728,745 ----
              GetCursorPos (&CursorLocation);
              ScreenToClient (ThisDoc->hDocWnd, &CursorLocation);
            }
!           while ((X == CursorLocation.x) && (Y == CursorLocation.y)
                   && (ThisDoc->TopLineOrd < (unsigned int) ScMax));
          }
  
          if (!ScrollText) {
!           if ((int)X < (int)ArtSideSpace) {
              TempX = ArtSideSpace;
            }
            else {
!             TempX = min ((int)X, (int)ThisDoc->ScXWidth);
            }
!           if ((int)Y < (int)ArtTopSpace) {
              TempY = ArtTopSpace;
            }
            else {
***************
*** 787,799 ****
            X = LOWORD (lParam);
            Y = HIWORD (lParam);
  
!           if (X < ArtSideSpace) {
              TempX = ArtSideSpace;
            }
            else {
!             TempX = min (X, ThisDoc->ScXWidth);
            }
!           if (Y < ArtTopSpace) {
              TempY = ArtTopSpace;
            }
            else {
--- 787,799 ----
            X = LOWORD (lParam);
            Y = HIWORD (lParam);
  
!           if ((int)X < (int)ArtSideSpace) {
              TempX = ArtSideSpace;
            }
            else {
!             TempX = min ((int)X, (int)ThisDoc->ScXWidth);
            }
!           if ((int)Y < (int)ArtTopSpace) {
              TempY = ArtTopSpace;
            }
            else {
***************
*** 2475,2482 ****
--- 2475,2492 ----
        
        if(MyGroup->Subscribed ? TrackSubscribedCrossposts : TrackUnsubscribedCrossposts)
        {
+ #if 0 //ishido
          if(!MyGroup->pSeendb)
            MyGroup->pSeendb = new WVSeenDB(MyGroup->ServerFirst, MyGroup->ServerLast); // this can fail...
+ #else //ishido
+         WVSeenDB*pSDB;
+         pSDB = MyGroup->pSeendb;
+         MyGroup->pSeendb = new WVSeenDB(MyGroup->ServerFirst, MyGroup->ServerLast, pSDB);
+         if(MyGroup->pSeendb)
+           delete pSDB;
+         else
+           MyGroup->pSeendb = pSDB;
+ #endif
          MyGroup->pSeendb->MarkSeen(artindex);
          
          if((MyGroup->total_headers > 0) && (MyGroup->header_handle) && (MyGroup->SubjDoc))
 
