diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 44327de5e0..265510e699 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,21 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-11 12:08 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * source/rtl/console.c + ! Fixed __EJECT() writing an EJECT only if output device + was "PRINTER". This fixes problem reported by Ciro, and + also a very old TOFIX which was removed very long ago + by mistake. (see thread "Bug: __EJECT() (David)" on 2000-07-27) + [TOMERGE 1.0] + + * source/rtl/treport.prg + ! Fixed some linefeed differences. + [TOMERGE 1.0] + + * source/vm/set.c + * Minor formatting. + 2008-11-11 05:34 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * make_vc.mak diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 9ec60a3ec7..71d4bcf54d 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -382,10 +382,10 @@ HB_FUNC( __EJECT ) /* Ejects the current page from the printer */ { PHB_PRNPOS pPrnPos; - if( hb_setGetPrintHan() != FS_ERROR && hb_stricmp( hb_setGetDevice(), "PRINTER" ) == 0 ) + if( hb_setGetPrintHan() != FS_ERROR ) { - static const BYTE byEop[ 4 ] = { 0x0C, 0x0D, 0x00, 0x00 }; /* Buffer is 4 bytes to make CodeGuard happy */ - hb_fsWrite( hb_setGetPrintHan(), byEop, 2 ); + static const BYTE s_byEop[ 4 ] = { 0x0C, 0x0D, 0x00, 0x00 }; /* Buffer is 4 bytes to make CodeGuard happy */ + hb_fsWrite( hb_setGetPrintHan(), s_byEop, 2 ); } pPrnPos = hb_prnPos(); diff --git a/harbour/source/rtl/treport.prg b/harbour/source/rtl/treport.prg index 0f6e2d2926..34bf9c3c50 100644 --- a/harbour/source/rtl/treport.prg +++ b/harbour/source/rtl/treport.prg @@ -219,9 +219,6 @@ METHOD New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nReco ENDIF ENDIF -#ifdef OLDCODE - DEFAULT lPrinter TO .F. -#endif DEFAULT cHeading TO "" // Set output devices @@ -271,6 +268,8 @@ METHOD New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nReco ::nLinesLeft := ::aReportData[ RPT_LINES ] + QOUT() // output additional line on first page (S87 compatibility) + ::nLinesLeft-- // Check to see if a "before report" eject, or TO FILE has been specified IF ::aReportData[ RPT_BEJECT ] @@ -509,6 +508,8 @@ METHOD ReportHeader() CLASS HBReportForm NEXT nLine + AADD( aPageHeader, "" ) // S87 compat. + nLinesInHeader := Len( aPageHeader) nMaxColLength :=0 FOR nCol := 1 TO Len( ::aReportData[RPT_COLUMNS] ) diff --git a/harbour/source/vm/set.c b/harbour/source/vm/set.c index 9e2352046c..39b57b3fbe 100644 --- a/harbour/source/vm/set.c +++ b/harbour/source/vm/set.c @@ -269,9 +269,11 @@ static HB_FHANDLE open_handle( PHB_SET_STRUCT pSet, const char * file_name, BOOL } } } - else bCreate = TRUE; /* Otherwise create a new file. */ + else + bCreate = TRUE; /* Otherwise create a new file. */ } - else bCreate = TRUE; /* Always create a new file for overwrite mode. */ + else + bCreate = TRUE; /* Always create a new file for overwrite mode. */ if( bCreate ) handle = hb_fsCreate( ( BYTE * ) path, FC_NORMAL ); @@ -434,7 +436,7 @@ HB_FUNC( SET ) if( args > 1 ) { close_text( pSet, pSet->hb_set_althan ); - if( pSet->HB_SET_ALTFILE && pSet->HB_SET_ALTFILE[0] != '\0' ) + if( pSet->HB_SET_ALTFILE && pSet->HB_SET_ALTFILE[ 0 ] != '\0' ) pSet->hb_set_althan = open_handle( pSet, pSet->HB_SET_ALTFILE, bFlag, ".txt", HB_SET_ALTFILE ); else pSet->hb_set_althan = FS_ERROR; @@ -660,7 +662,7 @@ HB_FUNC( SET ) if( args > 1 && ! HB_IS_NIL( pArg2 ) ) { close_text( pSet, pSet->hb_set_extrahan ); - if( pSet->HB_SET_EXTRAFILE && pSet->HB_SET_EXTRAFILE[0] != '\0' ) + if( pSet->HB_SET_EXTRAFILE && pSet->HB_SET_EXTRAFILE[ 0 ] != '\0' ) pSet->hb_set_extrahan = open_handle( pSet, pSet->HB_SET_EXTRAFILE, bFlag, ".prn", HB_SET_EXTRAFILE ); else pSet->hb_set_extrahan = FS_ERROR; @@ -774,7 +776,7 @@ HB_FUNC( SET ) { close_binary( pSet->hb_set_printhan ); pSet->hb_set_printhan = FS_ERROR; - if( pSet->HB_SET_PRINTFILE && pSet->HB_SET_PRINTFILE[0] != '\0' ) + if( pSet->HB_SET_PRINTFILE && pSet->HB_SET_PRINTFILE[ 0 ] != '\0' ) pSet->hb_set_printhan = open_handle( pSet, pSet->HB_SET_PRINTFILE, bFlag, ".prn", HB_SET_PRINTFILE ); } break; @@ -1224,7 +1226,7 @@ static BOOL hb_setSetFile( HB_set_enum set_specifier, const char * szFile, BOOL /* Limit size of SET strings to 64K, truncating if source is longer */ pSet->HB_SET_ALTFILE = szFile ? hb_strndup( szFile, USHRT_MAX ) : NULL; close_text( pSet, pSet->hb_set_althan ); - if( pSet->HB_SET_ALTFILE && pSet->HB_SET_ALTFILE[0] != '\0' ) + if( pSet->HB_SET_ALTFILE && pSet->HB_SET_ALTFILE[ 0 ] != '\0' ) pSet->hb_set_althan = open_handle( pSet, pSet->HB_SET_ALTFILE, fAdditive, ".txt", HB_SET_ALTFILE ); else @@ -1239,7 +1241,7 @@ static BOOL hb_setSetFile( HB_set_enum set_specifier, const char * szFile, BOOL if( szFile ) { close_text( pSet, pSet->hb_set_extrahan ); - if( pSet->HB_SET_EXTRAFILE && pSet->HB_SET_EXTRAFILE[0] != '\0' ) + if( pSet->HB_SET_EXTRAFILE && pSet->HB_SET_EXTRAFILE[ 0 ] != '\0' ) pSet->hb_set_extrahan = open_handle( pSet, pSet->HB_SET_EXTRAFILE, fAdditive, ".prn", HB_SET_EXTRAFILE ); else @@ -1255,7 +1257,7 @@ static BOOL hb_setSetFile( HB_set_enum set_specifier, const char * szFile, BOOL if( szFile ) { close_binary( pSet->hb_set_printhan ); - if( pSet->HB_SET_PRINTFILE && pSet->HB_SET_PRINTFILE[0] != '\0' ) + if( pSet->HB_SET_PRINTFILE && pSet->HB_SET_PRINTFILE[ 0 ] != '\0' ) pSet->hb_set_printhan = open_handle( pSet, pSet->HB_SET_PRINTFILE, fAdditive, ".prn", HB_SET_PRINTFILE ); else