You've already forked lazarus-ccr
fpspreadsheet: Erase formula if a new value is entered into cell
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4183 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3057,12 +3057,18 @@ procedure TsEqualExprNode.GetNodeValue(out AResult: TsExpressionResult);
|
||||
var
|
||||
LRes, RRes: TsExpressionResult;
|
||||
begin
|
||||
if HasError(AResult) then
|
||||
exit;
|
||||
|
||||
Left.GetNodeValue(LRes);
|
||||
Right.GetNodeValue(RRes);
|
||||
|
||||
if Left.HasError(AResult) and Right.HasError(AResult) then
|
||||
begin
|
||||
AResult := BooleanResult(LRes.ResError = RRes.ResError);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if HasError(AResult) then
|
||||
exit;
|
||||
|
||||
if IsString(LRes) and IsString(RRes) then
|
||||
AResult := BooleanResult(ArgToString(LRes) = ArgToString(RRes))
|
||||
else
|
||||
|
@ -3782,6 +3782,8 @@ begin
|
||||
isPercent := Pos('%', AValue) = Length(AValue);
|
||||
if isPercent then Delete(AValue, Length(AValue), 1);
|
||||
|
||||
ACell^.FormulaValue := '';
|
||||
|
||||
if TryStrToCurrency(AValue, number, currSym, FWorkbook.FormatSettings) then
|
||||
begin
|
||||
WriteCurrency(ACell, number, nfCurrencyRed, -1, currSym);
|
||||
@ -4322,7 +4324,8 @@ begin
|
||||
end;
|
||||
|
||||
// Store formula in cell
|
||||
ACell^.ContentType := cctFormula;
|
||||
if AFormula <> '' then
|
||||
ACell^.ContentType := cctFormula;
|
||||
ACell^.FormulaValue := AFormula;
|
||||
ChangedCell(ACell^.Row, ACell^.Col);
|
||||
end;
|
||||
|
Reference in New Issue
Block a user