From ba23bf17056afd91d80a246fcfe4bcf45f1d78d5 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Wed, 13 Feb 2013 15:08:52 +0000 Subject: [PATCH] ValEdit: do not store '=' in Strings is "key" and "value" cell is empty. git-svn-id: trunk@40297 - --- lcl/valedit.pas | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lcl/valedit.pas b/lcl/valedit.pas index 1b666ee7e0..2f1a61b383 100644 --- a/lcl/valedit.pas +++ b/lcl/valedit.pas @@ -932,7 +932,7 @@ end; procedure TValueListEditor.SetCells(ACol, ARow: Integer; const AValue: string); var I: Integer; - Line: string; + Key, KeyValue, Line: string; begin if (ARow = 0) and (doColumnTitles in DisplayOptions) then begin @@ -942,11 +942,22 @@ begin begin I:=ARow-FixedRows; if ACol=0 then - Line:=AValue+'='+Cells[1,ARow] + begin + Key := AValue; + KeyValue := Cells[1,ARow] + end else - Line:=Cells[0,ARow]+'='+AValue; - // Empty grid: don't add a the line '=' to Strings! - if (Strings.Count = 0) and (Line = '=') and (AValue = '') then Exit; + begin + KeyValue := AValue; + Key := Cells[0,ARow]; + end; + //If cells are empty don't store '=' in Strings + if (Key = '') and (KeyValue = '') then + Line := '' + else + Line := Key + '=' + KeyValue; + // Empty grid: don't add a the line '' to Strings! + if (Strings.Count = 0) and (Line = '') then Exit; if I>=Strings.Count then Strings.Insert(I,Line) else