fixed writing empty strings to lfm

git-svn-id: trunk@8933 -
This commit is contained in:
mattias 2006-03-13 10:01:43 +00:00
parent 5c372c949e
commit 2ed9fee8a6
4 changed files with 25 additions and 30 deletions

View File

@ -2825,7 +2825,7 @@ begin
if CompilerOptions<>'' then
CmdLine:=CmdLine+CompilerOptions+' ';
CmdLine:=CmdLine+TestPascalFile;
DebugLn('TDefinePool.CreateFPCTemplate CmdLine="',CmdLine,'"');
//DebugLn('TDefinePool.CreateFPCTemplate CmdLine="',CmdLine,'"');
ShortTestFile:=ExtractFileName(TestPascalFile);
TheProcess := TProcess.Create(nil);

View File

@ -173,14 +173,6 @@ begin
end;
end;
{------------------------------------------------------------------------------
procedure TCustomMemo.InitializeWnd;
------------------------------------------------------------------------------}
procedure TCustomMemo.InitializeWnd;
begin
inherited InitializeWnd;
end;
{------------------------------------------------------------------------------
procedure TCustomMemo.Loaded;
------------------------------------------------------------------------------}

View File

@ -1482,31 +1482,35 @@ procedure LRSObjectBinaryToText(Input, Output: TStream);
i: Integer;
InString, NewInString: Boolean;
begin
res := '';
InString := False;
for i := 1 to Length(s) do begin
NewInString := InString;
case s[i] of
#0..#31: begin
NewInString := False;
NewStr := '#' + IntToStr(Ord(s[i]));
end;
'''': begin
if s<>'' then begin
res := '';
InString := False;
for i := 1 to Length(s) do begin
NewInString := InString;
case s[i] of
#0..#31: begin
NewInString := False;
NewStr := '#' + IntToStr(Ord(s[i]));
end;
'''': begin
NewInString := True;
NewStr:=''''''; // write two ticks, so the reader will read one
end;
else begin
NewInString := True;
NewStr:='''''';
NewStr := s[i];
end;
else begin
NewInString := True;
NewStr := s[i];
end;
if NewInString <> InString then begin
NewStr := '''' + NewStr;
InString := NewInString;
end;
res := res + NewStr;
end;
if NewInString <> InString then begin
NewStr := '''' + NewStr;
InString := NewInString;
end;
res := res + NewStr;
if InString then res := res + '''';
end else begin
res:='''''';
end;
if InString then res := res + '''';
OutStr(res);
end;

View File

@ -688,7 +688,6 @@ type
procedure SetLines(const Value: TStrings);
procedure SetWordWrap(const Value: boolean);
procedure SetScrollBars(const Value: TScrollStyle);
procedure InitializeWnd; override;
procedure Loaded; override;
function WordWrapIsStored: boolean; virtual;
procedure ControlKeyDown(var Key: Word; Shift: TShiftState); override;