IDE: disallow setting floating point propertis to +/-Inf or NaN. Issue #39793.

This commit is contained in:
Bart 2022-10-02 15:12:11 +02:00
parent 62cb85cb4b
commit 8f00090a13
23 changed files with 175 additions and 0 deletions

View File

@ -652,6 +652,10 @@ msgstr ""
msgid "Incompatible Method"
msgstr ""
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Màscara d'entrada:"
@ -738,6 +742,10 @@ msgstr "Mou dalt"
msgid "Move field up"
msgstr ""
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr ""

View File

@ -629,6 +629,10 @@ msgstr "Nekompatibilní identifikátor"
msgid "Incompatible Method"
msgstr "Nekompatibilní metoda"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Vstupní maska:"
@ -714,6 +718,10 @@ msgstr "Přesunout &nahoru"
msgid "Move field up"
msgstr "Posunout pole výše"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nový"

View File

@ -628,6 +628,10 @@ msgstr "Inkompatibler Bezeichner"
msgid "Incompatible Method"
msgstr "Inkompatible Methode"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Eingabemaske:"
@ -712,6 +716,10 @@ msgstr "Nach oben"
msgid "Move field up"
msgstr "Feld nach oben"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Neu"

View File

@ -631,6 +631,10 @@ msgstr "Identificador no compatible"
msgid "Incompatible Method"
msgstr "Método no compatible"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Máscara de entrada:"
@ -715,6 +719,10 @@ msgstr "Mover Arriba"
msgid "Move field up"
msgstr "Mover el campo hacia arriba"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nuevo"

View File

@ -622,6 +622,10 @@ msgstr "Sopimaton tunniste"
msgid "Incompatible Method"
msgstr "Sopimaton metodi"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Syöttö maski:"
@ -706,6 +710,10 @@ msgstr "Siirrä &ylös"
msgid "Move field up"
msgstr "Siirrä kenttä ylös"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Uusi"

View File

@ -626,6 +626,10 @@ msgstr "Identificateur incompatible"
msgid "Incompatible Method"
msgstr "Méthode incompatible"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Masque de saisie :"
@ -710,6 +714,10 @@ msgstr "Déplacer vers le &haut"
msgid "Move field up"
msgstr "Déplacer le champ vers le haut"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nouveau"

View File

@ -651,6 +651,10 @@ msgstr "מזהה לא תואם"
msgid "Incompatible Method"
msgstr "מתודה לא תואמת"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "הכנס מסכה:"
@ -738,6 +742,10 @@ msgstr "הזז למעלה"
msgid "Move field up"
msgstr "הזז שדה למעלה"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "חדש"

View File

@ -629,6 +629,10 @@ msgstr "Nem kompatibilis azonosító"
msgid "Incompatible Method"
msgstr "Nem kompatibilis metódus"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Beviteli maszk:"
@ -713,6 +717,10 @@ msgstr "Mozgatás &fel"
msgid "Move field up"
msgstr "Mező mozgatása fel"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Új"

View File

@ -652,6 +652,10 @@ msgstr ""
msgid "Incompatible Method"
msgstr ""
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Input Mask:"
@ -740,6 +744,10 @@ msgstr "Naikan"
msgid "Move field up"
msgstr ""
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr ""

View File

@ -632,6 +632,10 @@ msgstr "Identificatore incompatibile"
msgid "Incompatible Method"
msgstr "Metodo incompatibile"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Maschera di input:"
@ -716,6 +720,10 @@ msgstr "&Sposta sopra"
msgid "Move field up"
msgstr "Muovi il campo su"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nuovo"

View File

@ -632,6 +632,10 @@ msgstr "互換性のない識別子"
msgid "Incompatible Method"
msgstr "互換性のないメソッド"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "入力マスク"
@ -717,6 +721,10 @@ msgstr "上に移動(&U)"
msgid "Move field up"
msgstr "フィールドを上に移動"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "新規(&N)"

View File

@ -630,6 +630,10 @@ msgstr "Nesuderinamas identifikatorius"
msgid "Incompatible Method"
msgstr "Nesuderinamas metodas"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Įvedimo kaukė:"
@ -714,6 +718,10 @@ msgstr "Perkelti au&kštyn"
msgid "Move field up"
msgstr "Laukelį perkelti aukštyn"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Naujas"

View File

@ -641,6 +641,10 @@ msgstr ""
msgid "Incompatible Method"
msgstr ""
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Invoer masker"
@ -729,6 +733,10 @@ msgstr "Ga naar boven"
msgid "Move field up"
msgstr ""
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr ""

View File

@ -624,6 +624,10 @@ msgstr "Niekompatybilny identyfikator"
msgid "Incompatible Method"
msgstr "Niekompatybilna metoda"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Maska wejściowa:"
@ -708,6 +712,10 @@ msgstr "Przenieś w &górę"
msgid "Move field up"
msgstr "Przesuń pole w górę"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nowy"

View File

@ -616,6 +616,10 @@ msgstr ""
msgid "Incompatible Method"
msgstr ""
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr ""
@ -700,6 +704,10 @@ msgstr ""
msgid "Move field up"
msgstr ""
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr ""

View File

@ -625,6 +625,10 @@ msgstr "Identificador incompatível"
msgid "Incompatible Method"
msgstr "Método incompatível"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Entrar Máscara:"
@ -709,6 +713,10 @@ msgstr "Mover Ac&ima"
msgid "Move field up"
msgstr "Mover campo acima"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Novo"

View File

@ -625,6 +625,10 @@ msgstr "Несовместимый идентификатор"
msgid "Incompatible Method"
msgstr "Несовместимый метод"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Маска ввода:"
@ -709,6 +713,10 @@ msgstr "Переместить &вверх"
msgid "Move field up"
msgstr "Переместить поле вверх"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Новое"

View File

@ -639,6 +639,10 @@ msgstr "Nekompatibilný identifikátor"
msgid "Incompatible Method"
msgstr "Nekompatibilná metóda"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Vstupná maska:"
@ -723,6 +727,10 @@ msgstr "Pres&unúť hore"
msgid "Move field up"
msgstr "Posunúť pole hore"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Nový"

View File

@ -629,6 +629,10 @@ msgstr "Uyumsuz Tanımlayıcı"
msgid "Incompatible Method"
msgstr "Uyumsuz Yöntem"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Maske gir:"
@ -713,6 +717,10 @@ msgstr "Yukarı &Taşı"
msgid "Move field up"
msgstr "Alanı yukarı taşı"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Yeni"

View File

@ -632,6 +632,10 @@ msgstr "Несумісний ідентифікатор"
msgid "Incompatible Method"
msgstr "Несумісний метод"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "Маска введення:"
@ -716,6 +720,10 @@ msgstr "Перемістити вг&ору"
msgid "Move field up"
msgstr "Перемістити поле вгору"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "&Новий"

View File

@ -626,6 +626,10 @@ msgstr "标识符不兼容"
msgid "Incompatible Method"
msgstr "方法不兼容"
#: objinspstrconsts.oisinfinitenotsupported
msgid "Setting a floating point property to positive or negative Infinity at design time is not supported"
msgstr ""
#: objinspstrconsts.oisinputmask
msgid "Input Mask:"
msgstr "输入掩码:"
@ -710,6 +714,10 @@ msgstr "向上移动(&U)"
msgid "Move field up"
msgstr "上移字段"
#: objinspstrconsts.oisnannotsupported
msgid "Setting a floating point property to NaN at design time is not supported"
msgstr ""
#: objinspstrconsts.oisnew
msgid "&New"
msgstr "新建(&N)"

View File

@ -373,6 +373,8 @@ resourcestring
oisStringsEditorDialog = 'Strings Editor Dialog';
ois0Lines0Chars = '0 lines, 0 chars';
oisInvalidPropertyValue = 'Invalid property value';
oisInfiniteNotSupported = 'Setting a floating point property to positive or negative Infinity at design time is not supported';
oisNaNNotSupported = 'Setting a floating point property to NaN at design time is not supported';
oisNone = '(none)';
oisPressAKey = 'Press a key ...';
oisPressAKeyEGCtrlP = 'You can press e.g. Ctrl+P ...';

View File

@ -24,6 +24,7 @@ interface
uses
// RTL / FCL
Classes, TypInfo, SysUtils, types, RtlConsts, variants, Contnrs, strutils, FGL,
Math,
// LCL
LCLType, LCLIntf, LCLProc, Forms, Controls, ButtonPanel, Graphics,
StdCtrls, Buttons, Menus, ExtCtrls, ComCtrls, Dialogs, EditBtn, Grids, ValEdit,
@ -3983,6 +3984,10 @@ begin
if not TryStrToFloat(NewValue, NewFloat, FS) then
//if this failed, assume the user entered DS from his current locale
NewFloat := StrToFloat(NewValue, DefaultFormatSettings);
if IsInfinite(NewFloat) then
raise EPropertyError.Create(oisInfiniteNotSupported);
if IsNan(NewFloat) then
raise EPropertyError.Create(oisNaNNotSupported);
SetFloatValue(NewFloat);
//writeln('TFloatPropertyEditor.SetValue B ',GetValue);
end;