Changeset 850 for trunk/dll/newview.c


Ignore:
Timestamp:
Oct 7, 2007, 4:50:15 AM (18 years ago)
Author:
Steven Levine
Message:

Rework large file support wrappers (ticket #41)
Add code to avoid NTFS driver small file read defect (ticket #159)
Add debug code to try to catch David's drive bar exception
Another attempt to correct newview fast viewer text load failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/newview.c

    r844 r850  
    2424  26 Aug 07 GKY Fixed fast viewer text load failure
    2525  28 Aug 07 GKY Reversed horizontal scrollbar behavior to be present for unwrapped text and absent for wrapped text & hex.
    26 
     26  14 Sep 07 SHL Another attempt to correct the fast viewer text load failure
    2727
    2828***********************************************************************/
     
    10931093      IncrThreadUsage();
    10941094      ad = WinQueryWindowPtr(hwnd, QWL_USER);
    1095       if (ad) {
    1096         if (ad->text && ad->textsize && !ad->hex)
    1097           DosSleep(32);   // 26 Aug 07 GKY Fixes failure to load text file in some cases
    1098         ad->relining = TRUE;
     1095      if (ad)
     1096        Runtime_Error(pszSrcFile, __LINE__, "no data");
     1097      else {
    10991098        if (!DosRequestMutexSem(ad->ScanSem, SEM_INDEFINITE_WAIT)) {
     1099          ad->relining = TRUE;
    11001100          ad->busy++;
    11011101          ad->maxx = 0;
     
    11851185                    for (x = 0; x < ad->numlines; x++) {
    11861186                      if ((LONG) (Rectl.yTop -
    1187                                   (ad->lMaxHeight * (((x + 1) -
    1188                                                       ad->topline) + 1))) < 0)
    1189                         break;
     1187                                  (ad->lMaxHeight * (((x + 1) -
     1188                                                      ad->topline) + 1))) < 0)
     1189                        break;
    11901190                      PaintLine(hwnd, ad->hps, x, 1, &Rectl);
    11911191                    }
     
    12361236          PostMsg(hwnd, UM_SETUP4, MPVOID, MPVOID);
    12371237          ad->busy--;
    1238         }
    1239       }
     1238        } // if got sim
     1239      } // if got VIEWDATA
    12401240      WinDestroyMsgQueue(hmq2);
    12411241    }
     
    13141314              }
    13151315              else {
    1316                 ad->text = xmalloc(len + 2, pszSrcFile, __LINE__);
     1316                // 06 Oct 07 SHL Protect against 4096 NFTS driver small buffer defect
     1317                ad->text = xmalloc(min(len + 2, 4096),
     1318                                   pszSrcFile,
     1319                                   __LINE__);
    13171320                if (ad->text) {
    13181321                  *ad->text = 0;
     
    18711874
    18721875      if (ad->wrapon || ad->hex) { // GKY reverse case where hscroll bar is presnt
    1873         if (WinQueryWindow(ad->hhscroll, QW_PARENT) == ad->hwndFrame) {
    1874           invalidate = TRUE;
    1875           WinSetOwner(ad->hhscroll, HWND_OBJECT);
    1876           WinSetParent(ad->hhscroll, HWND_OBJECT, TRUE);
    1877           ad->maxx = 0;
    1878           ad->horzscroll = 0;
    1879         }
     1876        if (WinQueryWindow(ad->hhscroll, QW_PARENT) == ad->hwndFrame) {
     1877          invalidate = TRUE;
     1878          WinSetOwner(ad->hhscroll, HWND_OBJECT);
     1879          WinSetParent(ad->hhscroll, HWND_OBJECT, TRUE);
     1880          ad->maxx = 0;
     1881          ad->horzscroll = 0;
     1882        }
    18801883      }
    18811884      else {
Note: See TracChangeset for help on using the changeset viewer.