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
|
var
|
||||||
LRes, RRes: TsExpressionResult;
|
LRes, RRes: TsExpressionResult;
|
||||||
begin
|
begin
|
||||||
if HasError(AResult) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
Left.GetNodeValue(LRes);
|
Left.GetNodeValue(LRes);
|
||||||
Right.GetNodeValue(RRes);
|
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
|
if IsString(LRes) and IsString(RRes) then
|
||||||
AResult := BooleanResult(ArgToString(LRes) = ArgToString(RRes))
|
AResult := BooleanResult(ArgToString(LRes) = ArgToString(RRes))
|
||||||
else
|
else
|
||||||
|
@ -3782,6 +3782,8 @@ begin
|
|||||||
isPercent := Pos('%', AValue) = Length(AValue);
|
isPercent := Pos('%', AValue) = Length(AValue);
|
||||||
if isPercent then Delete(AValue, Length(AValue), 1);
|
if isPercent then Delete(AValue, Length(AValue), 1);
|
||||||
|
|
||||||
|
ACell^.FormulaValue := '';
|
||||||
|
|
||||||
if TryStrToCurrency(AValue, number, currSym, FWorkbook.FormatSettings) then
|
if TryStrToCurrency(AValue, number, currSym, FWorkbook.FormatSettings) then
|
||||||
begin
|
begin
|
||||||
WriteCurrency(ACell, number, nfCurrencyRed, -1, currSym);
|
WriteCurrency(ACell, number, nfCurrencyRed, -1, currSym);
|
||||||
@ -4322,7 +4324,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Store formula in cell
|
// Store formula in cell
|
||||||
ACell^.ContentType := cctFormula;
|
if AFormula <> '' then
|
||||||
|
ACell^.ContentType := cctFormula;
|
||||||
ACell^.FormulaValue := AFormula;
|
ACell^.FormulaValue := AFormula;
|
||||||
ChangedCell(ACell^.Row, ACell^.Col);
|
ChangedCell(ACell^.Row, ACell^.Col);
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user