787 |
|
|
788 |
|
implementation |
789 |
|
|
790 |
< |
uses IBIntf, Variants, FmtBCD, LCLProc, LazUTF8; |
790 |
> |
uses IBIntf, Variants, FmtBCD, LazUTF8; |
791 |
|
|
792 |
|
const FILE_BEGIN = 0; |
793 |
|
FILE_CURRENT = 1; |
823 |
|
property CharacterSetSize: integer read FCharacterSetSize write FCharacterSetSize; |
824 |
|
end; |
825 |
|
|
826 |
+ |
|
827 |
+ |
{ Copied from LCLProc in order to avoid LCL dependency |
828 |
+ |
|
829 |
+ |
Ensures the covenient look of multiline string |
830 |
+ |
when displaying it in the single line |
831 |
+ |
* Replaces CR and LF with spaces |
832 |
+ |
* Removes duplicate spaces |
833 |
+ |
} |
834 |
+ |
function TextToSingleLine(const AText: string): string; |
835 |
+ |
var |
836 |
+ |
str: string; |
837 |
+ |
i, wstart, wlen: Integer; |
838 |
+ |
begin |
839 |
+ |
str := Trim(AText); |
840 |
+ |
wstart := 0; |
841 |
+ |
wlen := 0; |
842 |
+ |
i := 1; |
843 |
+ |
while i < Length(str) - 1 do |
844 |
+ |
begin |
845 |
+ |
if (str[i] in [' ', #13, #10]) then |
846 |
+ |
begin |
847 |
+ |
if (wstart = 0) then |
848 |
+ |
begin |
849 |
+ |
wstart := i; |
850 |
+ |
wlen := 1; |
851 |
+ |
end else |
852 |
+ |
Inc(wlen); |
853 |
+ |
end else |
854 |
+ |
begin |
855 |
+ |
if wstart > 0 then |
856 |
+ |
begin |
857 |
+ |
str[wstart] := ' '; |
858 |
+ |
Delete(str, wstart+1, wlen-1); |
859 |
+ |
Dec(i, wlen-1); |
860 |
+ |
wstart := 0; |
861 |
+ |
end; |
862 |
+ |
end; |
863 |
+ |
Inc(i); |
864 |
+ |
end; |
865 |
+ |
Result := str; |
866 |
+ |
end; |
867 |
+ |
|
868 |
|
{ TIBWideMemoField } |
869 |
|
|
870 |
|
function TIBWideMemoField.GetTruncatedText: string; |
934 |
|
|
935 |
|
function TIBMemoField.GetDefaultWidth: Longint; |
936 |
|
begin |
937 |
< |
Result := 128; |
937 |
> |
if DisplayTextAsClassName then |
938 |
> |
Result := inherited |
939 |
> |
else |
940 |
> |
Result := 128; |
941 |
|
end; |
942 |
|
|
943 |
|
procedure TIBMemoField.GetText(var AText: string; ADisplayText: Boolean); |