diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ab67df3277..fe7a7c7e23 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-26 20:37 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/xhb/tfile.prg + * contrib/xhb/ttable.prg + * contrib/xhb/xhberr.prg + * contrib/xhb/xhbtedit.prg + ! unicode compatibility patches. build tested only. review me + and continue. + + * examples/hbdoc/genhtml.prg + * examples/hbdoc/hbdoc.prg + ! fixed regression from 2012-06-11 15:31 UTC+0200 + + changed to generate HTML5 compliant HTML output + 2012-06-26 18:29 UTC+0200 Viktor Szakats (harbour syenar.net) * TODO - deleted unicode support from TODO list. diff --git a/harbour/contrib/xhb/tfile.prg b/harbour/contrib/xhb/tfile.prg index f52037b852..51d842f7f9 100644 --- a/harbour/contrib/xhb/tfile.prg +++ b/harbour/contrib/xhb/tfile.prg @@ -278,7 +278,7 @@ METHOD ReadByte() CLASS TCgiFile LOCAL nBytes LOCAL cBuff := Space( 1 ) - nBytes := Fread( ::Handle, @cBuff, 1 ) + nBytes := Fread( ::Handle, @cBuff, hb_BLen( cBuff ) ) RETURN IIF( nBytes > 0, Asc( cBuff ), - 1 ) @@ -292,7 +292,7 @@ METHOD ReadInt() CLASS TCgiFile LOCAL nBytes LOCAL cBuff := Space( 2 ) - nBytes := Fread( ::Handle, @cBuff, 2 ) + nBytes := Fread( ::Handle, @cBuff, hb_BLen( cBuff ) ) RETURN IIF( nBytes > 0, Bin2i( cBuff ), - 1 ) @@ -306,7 +306,7 @@ METHOD ReadLong() CLASS TCgiFile LOCAL nBytes LOCAL cBuff := Space( 4 ) - nBytes := Fread( ::Handle, @cBuff, 4 ) + nBytes := Fread( ::Handle, @cBuff, hb_BLen( cBuff ) ) RETURN IIF( nBytes > 0, Bin2l( cBuff ), - 1 ) @@ -318,7 +318,7 @@ RETURN IIF( nBytes > 0, Bin2l( cBuff ), - 1 ) METHOD WriteByte( nByte ) CLASS TCgiFile - LOCAL lSuccess := ( Fwrite( ::nHandle, Chr( nByte ), 1 ) == 1 ) + LOCAL lSuccess := ( Fwrite( ::nHandle, hb_BCode( nByte ), 1 ) == 1 ) RETURN lSuccess /* @@ -501,7 +501,7 @@ METHOD PrevLine( nBytes ) CLASS TCgiFile // Check preceeding 2 chars for CR+LF Fseek( fHandle, - 2, FS_RELATIVE ) cTemp := Space( 2 ) - Fread( fHandle, @cTemp, 2 ) + Fread( fHandle, @cTemp, hb_BLen( cTemp ) ) IF cTemp == CRLF() Fseek( fHandle, - 2, FS_RELATIVE ) diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 73586ead45..30f3dfed1c 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -94,7 +94,7 @@ FUNCTION NetDbUse( cDataBase, cAlias, nSeconds, cDriver, ; nSeconds *= 1.00 lforever := ( nSeconds == 0 ) - KEYBOARD CHR( 255 ) + hb_keyIns( 255 ) INKEY() DO WHILE ( lforever .or. nSeconds > 0 ) .and. LASTKEY() != K_ESC diff --git a/harbour/contrib/xhb/xhberr.prg b/harbour/contrib/xhb/xhberr.prg index 052606164a..fa44f26f4f 100644 --- a/harbour/contrib/xhb/xhberr.prg +++ b/harbour/contrib/xhb/xhberr.prg @@ -607,14 +607,14 @@ STATIC FUNCTION LogError( oerr ) nBytes := FSeek( nHandle2, 0, FS_END ) - cBuff := space(10) + cBuff := Space( 10 ) FSeek( nHandle2, 0, FS_SET ) while nBytes > 0 - nRead := FRead( nHandle2, @cBuff, 10 ) - FWrite( nHandle, cBuff, nRead ) - nBytes -= nRead - cBuff := space( 10 ) + nRead := FRead( nHandle2, @cBuff, hb_BLen( cBuffer ) ) + FWrite( nHandle, cBuff, nRead ) + nBytes -= nRead + cBuff := Space( 10 ) enddo FClose( nHandle2 ) @@ -626,7 +626,7 @@ STATIC FUNCTION LogError( oerr ) FClose( nHandle ) endif - Endif + endif Return .f. @@ -641,17 +641,17 @@ STATIC FUNCTION strvalue( c, l ) cr := c EXIT CASE "N" - cr := Alltrim( Str( c ) ) + cr := hb_ntos( c ) EXIT CASE "M" cr := c EXIT CASE "D" - cr := Dtoc( c ) + cr := DToC( c ) EXIT CASE "L" -// cr := Iif( l, Iif( c, "On", "Off" ), Iif( c, "True", "False" ) ) - cr := Iif( l, Iif( c, "On", "Off" ), Iif( c, ".t.", ".f." ) ) +// cr := iif( l, iif( c, "On", "Off" ), iif( c, "True", "False" ) ) + cr := iif( l, iif( c, "On", "Off" ), iif( c, ".t.", ".f." ) ) EXIT ENDSWITCH diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index d6172e9e9f..a7b290e2b8 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -1006,7 +1006,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor OTHERWISE - IF nKey >= K_SPACE .AND. nKey < 256 + IF Len( hb_KeyChar( nKey ) ) > 0 IF ::lEditAllow ::ClrTextSelection() ::K_Ascii( nKey ) @@ -1435,8 +1435,6 @@ METHOD K_Mouse( nKey ) CLASS XHBEditor METHOD K_Ascii( nKey ) CLASS XHBEditor - // nKey := ASC( HB_ANSITOOEM( CHR( nKey ) ) ) // convert from windows - IF !::lEditAllow .OR. ::nCol > ::nWordWrapCol + 1 RETURN Self ENDIF @@ -1460,10 +1458,10 @@ METHOD K_Ascii( nKey ) CLASS XHBEditor // insert char if in insert mode or at end of current line // IF ::lInsert .OR. ( ::nCol > ::LineLen( ::nRow ) ) - ::aText[ ::nRow ]:cText := Stuff( ::aText[ ::nRow ]:cText, ::nCol, 0, Chr( nKey ) ) + ::aText[ ::nRow ]:cText := Stuff( ::aText[ ::nRow ]:cText, ::nCol, 0, hb_KeyChar( nKey ) ) ::lChanged := .T. ELSE - ::aText[ ::nRow ]:cText := Stuff( ::aText[ ::nRow ]:cText, ::nCol, 1, Chr( nKey ) ) + ::aText[ ::nRow ]:cText := Stuff( ::aText[ ::nRow ]:cText, ::nCol, 1, hb_KeyChar( nKey ) ) ::lChanged := .T. ENDIF @@ -1778,7 +1776,7 @@ METHOD K_Esc() CLASS XHBEditor // 2006/JUL/21 - E.F - Exit only if "Y" is pressed. // - ::lExitEdit := ( Upper( Chr(nKey ) ) == "Y" ) + ::lExitEdit := ( Upper( hb_KeyChar( nKey ) ) == "Y" ) ENDIF IF ::lExitEdit diff --git a/harbour/examples/hbdoc/genhtml.prg b/harbour/examples/hbdoc/genhtml.prg index 4f69189206..f4193874b0 100644 --- a/harbour/examples/hbdoc/genhtml.prg +++ b/harbour/examples/hbdoc/genhtml.prg @@ -105,12 +105,14 @@ EXPORTED: ENDCLASS METHOD NewFile() CLASS GenerateHTML - FWrite( ::nHandle, '' + hb_eol() ) - ::OpenTag( "html" ) + FWrite( ::nHandle, "" + hb_eol() ) + + ::OpenTag( "html", "xmlns", "http://www.w3.org/1999/xhtml", "lang", "en" ) ::OpenTag( "head" ) ::Append( ::cTitle /* + IIf( Empty( ::cDescription ), "", " - " + ::cDescription ) */, "title" ) + ::OpenTag( "meta", "http-equiv", "content-type", "content", "text/html; charset=UTF-8" ) ::OpenTag( "meta", "name", "generator", "content", "Harbour examples/hbdoc" ) ::OpenTag( "meta", "name", "keywords", "content", "Harbour project, Clipper, xBase, database, Free Software, GNU, compiler, cross platform, 32-bit, FiveWin" ) @@ -141,20 +143,20 @@ METHOD NewIndex( cFolder, cFilename, cTitle ) CLASS GenerateHTML METHOD BeginSection( cSection, cFilename ) CLASS GenerateHTML IF ::IsIndex() If cFilename == ::cFilename - ::OpenTag( "a", "name", cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "a" )//:Newline() + ::OpenTag( "div", "id", cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "div" )//:Newline() ELSE ::OpenTag( "a", "href", cFilename + ::cExtension + "#" + cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "a" )//:Newline() ENDIF ELSE - ::OpenTag( "a", "name", cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "a" )//:Newline() + ::OpenTag( "div", "id", cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "div" )//:Newline() ENDIF ::TargetFilename := cFilename ::Depth++ RETURN self METHOD EndSection( cSection, cFilename ) CLASS GenerateHTML -HB_SYMBOL_UNUSED( cSection ) -HB_SYMBOL_UNUSED( cFilename ) + HB_SYMBOL_UNUSED( cSection ) + HB_SYMBOL_UNUSED( cFilename ) ::Depth-- RETURN self @@ -175,7 +177,7 @@ METHOD AddEntry( oEntry ) CLASS GenerateHTML FOR idx := 1 TO Len( oEntry:Fields ) IF oEntry:Fields[ idx ][ 1 ] == "NAME" - ::OpenTag( "a", "name", oEntry:filename ):OpenTag( "h4" ):Append( oEntry:Name ):CloseTag( "h4" ):CloseTag( "a" ) + ::OpenTag( "div", "id", oEntry:filename ):OpenTag( "h4" ):Append( oEntry:Name ):CloseTag( "h4" ):CloseTag( "div" ) ELSEIF oEntry:IsField( oEntry:Fields[ idx ][ 1 ] ) .AND. oEntry:IsOutput( oEntry:Fields[ idx ][ 1 ] ) .AND. Len( oEntry:&( oEntry:Fields[ idx ][ 1 ] ) ) > 0 ::WriteEntry( oEntry:Fields[ idx ][ 1 ], oEntry, oEntry:IsPreformatted( oEntry:Fields[ idx ][ 1 ] ) ) ENDIF @@ -294,7 +296,7 @@ METHOD Append( cText, cFormat ) CLASS GenerateHTML METHOD RecreateStyleDocument( cStyleFile ) CLASS GenerateHTML IF ! hb_MemoWrit( ::cFolder + hb_ps() + cStyleFile,; - "/* Harbour Documents Stylesheet (" + cStyleFile + ") */" + hb_eol() + ; + "/* Harbour Documents Stylesheet */" + hb_eol() + ; "body {font-family:arial;font-size:14px;line-height:18px;}" + hb_eol() + ; /* ".classtitle {font-weight:bold;font-size:22px;padding-bottom:4px;}" + hb_eol() + */ ; ".name {font-weight:bold;font-size:18px;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + hb_eol() + ; diff --git a/harbour/examples/hbdoc/hbdoc.prg b/harbour/examples/hbdoc/hbdoc.prg index 43849af158..4b0377d70b 100644 --- a/harbour/examples/hbdoc/hbdoc.prg +++ b/harbour/examples/hbdoc/hbdoc.prg @@ -145,9 +145,8 @@ PROCEDURE Main( ... ) // remove formats that have not been implemented yet FOR idx := Len( p_hsSwitches[ "format-list" ] ) TO 1 STEP -1 IF p_hsSwitches[ "format-list" ][ idx ] == "all" - - ELSEIF hb_IsFunction( "Generate" + p_hsSwitches[ "format-list" ][ idx ] ) - ASize( ADel( p_hsSwitches[ "format-list" ], idx), Len( p_hsSwitches[ "format-list" ] ) - 1 ) + ELSEIF ! hb_IsFunction( "Generate" + p_hsSwitches[ "format-list" ][ idx ] ) + hb_ADel( p_hsSwitches[ "format-list" ], idx, .T. ) ENDIF NEXT