LadyOfWood
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору AlexCoRu Модуль cxSSheet, а конечно основательно в свое время ее правил, так что может быть и мой код. Код: procedure TcxSSCellObject.SetTextEx(const Value: string; IsFormula: Boolean = False; Analyze: Boolean = True); var DT: TDateTime; DValue: double; C: Currency; begin if CellReadOnly(OwnerSheet.Owner, OwnerSheet, Col, Row) then Exit; if Assigned(Style.Format) and (Style.Format.AllowDateTime) and cxTryStrToDateTime(Value, DT) and not cxTryStrToFloat(Value) then SetDateTime(DT) else if Assigned(Style.Format) and (Style.Format.FormatType = ftDateTime) and cxTryStrToFloat(Value, DValue) then begin SetDateTime(DValue) end else if Assigned(Style.Format) and ((Style.Format.FormatType = ftGeneral) or (Style.Format.FormatType = ftCurrency)) and cxTryStrToCurr(Value, C) and not cxTryStrToFloat(Value) then begin FOwner.CellText[FCol, FRow] := FloatToStr(C); end else TcxDataStorageAccess(FOwner).SetCellTextEx(FCol, FRow, Value, IsFormula, Analyze); CheckCellWordBreak; TcxCustomSpreadSheetBook(Owner.ParentBook).UpdateControl; end; |
|