Page 1 of 1

TRLine:Del

Posted: Thu Apr 23, 2015 10:58 am
by AntoninoP
Hello,
I have a crash in TRLine:Del at line 187:

Code: Select all

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

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