View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004540 | JEDI VCL | 00 JVCL Components | public | 2008-10-17 08:54 | 2008-10-18 02:55 |
Reporter | n9zle | Assigned To | AHUser | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | 3.36 | |||
Summary | 0004540: Can't use sLineBreak in D2009 for jveditor.pas GetselText | ||||
Description | sLineBreak is a pAnsichar in 2009. (2 bytes) Need a string = 0000013#10 that will work in both d2009 and older version. pChar is unsafe as a pointer because char is now 2 bytes in d2009 | ||||
Additional Information | function TJvCustomEditor.GetSelText: string; var S,slb: string; I,pi: Integer; Len, CLen: Integer; begin with FSelection do begin Len := GetSelLength; // memory size to allocate Result := ''; if Len = 0 then Exit; SetLength(Result, Len); slb := 0000013#10; if SelBlockFormat = bfColumn then begin if Len > 0 then begin pi := 1; for I := SelBegY to SelEndY do begin S := FLines[I]; CLen := Length(S) - SelBegX; if CLen < 0 then CLen := 0; if CLen > SelEndX - SelBegX + 1 then CLen := SelEndX - SelBegX + 1; if CLen <> 0 then begin Move(S[SelBegX + 1],Result[pi], CLen*Sizeof(Char)); Inc(Pi, CLen); end; if I < SelEndY then begin Move(slb[1], result[pi], sLineBreakLen*Sizeof(Char)); Inc(pi, sLineBreakLen); end; end; end; end else begin if SelBegY = SelEndY then Move(FLines[SelEndY][SelBegX + 1], Result[1], Len*Sizeof(Char)) else begin pi := 1; // first line S := FLines[SelBegY]; CLen := (Length(S) - SelBegX); if CLen > 0 then begin Move(S[SelBegX + 1], Result[pi], CLen*Sizeof(Char)); Inc(pi,CLen); end; // line break Move(slb[1], Result[pi], sLineBreakLen*Sizeof(Char)); Inc(pi,sLineBreakLen); // lines between for I := SelBegY + 1 to SelEndY - 1 do begin // line S := FLines[I]; Move(S[1], Result[pi], Length(S)*Sizeof(Char)); Inc(pi, Length(S)); // line break Move(slb[1], Result[pi], sLineBreakLen*Sizeof(Char)); Inc(pi, sLineBreakLen); end; // last line S := FLines[SelEndY]; CLen := SelEndX + Ord(SelBlockFormat = bfInclusive); if CLen > Length(S) then CLen := Length(S); if CLen > 0 then Move(S[1], Result[pi], CLen*Sizeof(Char)); end; end; end; end; | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2008-10-17 08:54 | n9zle | New Issue | |
2008-10-18 02:55 | AHUser | Status | new => resolved |
2008-10-18 02:55 | AHUser | Fixed in Version | => Daily / SVN |
2008-10-18 02:55 | AHUser | Resolution | open => fixed |
2008-10-18 02:55 | AHUser | Assigned To | => AHUser |
2008-10-18 02:55 | AHUser | Note Added: 0014877 |