TRLine:Del

TRLine:Del

Postby AntoninoP » Thu Apr 23, 2015 10:58 am

Hello,
I have a crash in TRLine:Del at line 187:
Code: Select all  Expand view
Adel(::aRow,nLinIni)

This is because ::aRow is Inited on Stabilize.

I see that TRLine if first line is empty does not write nothing, but I think that a better behaviour is that skip every empty line, so I changed Stabilize in this way:
Code: Select all  Expand view
METHOD Stabilize(nFirstRow,nFirstCol) CLASS TRLine

     LOCAL nFor, nTmpRow, cLine, oFont

     DEFAULT nFirstRow := 0 ,;
             nFirstCol := 0

     nTmpRow := nFirstRow

     ::aRow   := array(len(::aLine ))
     ::nCol   := nFirstCol
     ::nWidth := 0

     FOR nFor := 1 TO len(::aRow)
          cLine := ALLTRIM(eval(::aLine [nFor]))
          oFont := ::oReport:aFont[eval(::aFont[nFor])]
          ::aRow[nFor]   := nTmpRow
          if ALLTRIM(cLine) == ""
            ::aWidth[nFor] := 0
          else
             nTmpRow        += ::oReport:oDevice:GetTextHeight(cLine,oFont)
             ::aWidth[nFor] := ::oReport:oDevice:GetTextWidth(cLine,oFont)
          endif
          ::nWidth       := Max(::nWidth,::aWidth[nFor])
     NEXT

     ::nHeight := nTmpRow - nFirstRow

RETURN NIL


Regars
Antonino Perricone
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 5 guests