- Timestamp:
- Jan 29, 2010, 1:37:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/Templates/uTemplateFields.pas
r654 r694 5 5 6 6 uses 7 Forms, SysUtils, Classes, Dialogs, StdCtrls, ExtCtrls, Controls, Contnrs,7 Forms, SysUtils, StrUtils, Classes, Dialogs, StdCtrls, ExtCtrls, Controls, Contnrs, 8 8 Graphics, ORClasses, ComCtrls, ORDtTm; 9 9 … … 454 454 end; 455 455 456 procedure WordWrapText(var Txt: string );456 procedure WordWrapText(var Txt: string; HTMLMode : boolean); 457 457 var 458 458 TmpSL: TStringList; 459 459 i: integer; 460 460 461 function WrappedText(const Str: string ): string;461 function WrappedText(const Str: string; boolHTMLMode : boolean): string; 462 462 var 463 i, i2, j, k: integer; 464 Temp: string; 463 i, i2, j, k, m: integer; 464 HTMLStrLen : integer; 465 Temp, Temp1, Temp2: string; 465 466 466 467 begin … … 508 509 509 510 Result := Result + Temp; 510 Result := WrapText(Result, #13#10, [' '], MAX_ENTRY_WIDTH); 511 512 //Count the HTML tag length and add to MAX_ENTRY WIDTH elh 1-29-10 513 HTMLStrLen := 0; 514 if boolHTMLMode = True then begin 515 temp1 := Result; 516 while (pos('<',temp1)>0) and (pos('>',temp1)>0) do 517 begin 518 temp2 := MidStr(temp1,pos('<',temp1),pos('>',temp1)-pos('<',temp1)+1); 519 HTMLStrLen := HTMLStrLen + strlen(PChar(temp2)); 520 temp1 := Rightstr(temp1,strlen(PChar(temp1))-pos('>',temp1)); 521 end; 522 end; 523 524 Result := WrapText(Result, #13#10, [' '], MAX_ENTRY_WIDTH+HTMLStrLen); //added +HTMLStrLen elh 1-29-10 511 525 repeat 512 526 i := pos(#1, Result); … … 527 541 if Txt <> '' then 528 542 Txt := Txt + CRLF; 529 Txt := Txt + WrappedText(TmpSL[i] );543 Txt := Txt + WrappedText(TmpSL[i],HTMLMode); 530 544 end; 531 545 finally … … 635 649 until(i = 0); 636 650 if not AutoWrap then 637 WordWrapText(Result );651 WordWrapText(Result,HTMLMode); 638 652 639 653 end;
Note:
See TracChangeset
for help on using the changeset viewer.