From c6d6f8c7a69168149bd9a0255282b2efc91c2bee Mon Sep 17 00:00:00 2001 From: jesus Date: Wed, 29 Apr 2015 06:20:16 +0000 Subject: [PATCH] IDEIntf, dbpropedits: check when retrieving fields definitions, issue #27962 git-svn-id: trunk@48889 - --- components/ideintf/dbpropedits.pas | 18 ++++++++++++++---- .../ideintf/languages/objinspstrconsts.ca.po | 4 ++++ .../ideintf/languages/objinspstrconsts.cs.po | 4 ++++ .../ideintf/languages/objinspstrconsts.de.po | 4 ++++ .../ideintf/languages/objinspstrconsts.es.po | 4 ++++ .../ideintf/languages/objinspstrconsts.fi.po | 4 ++++ .../ideintf/languages/objinspstrconsts.fr.po | 5 +++++ .../ideintf/languages/objinspstrconsts.he.po | 4 ++++ .../ideintf/languages/objinspstrconsts.hu.po | 4 ++++ .../ideintf/languages/objinspstrconsts.id.po | 4 ++++ .../ideintf/languages/objinspstrconsts.it.po | 4 ++++ .../ideintf/languages/objinspstrconsts.ja.po | 4 ++++ .../ideintf/languages/objinspstrconsts.lt.po | 4 ++++ .../ideintf/languages/objinspstrconsts.nl.po | 4 ++++ .../ideintf/languages/objinspstrconsts.pl.po | 4 ++++ .../ideintf/languages/objinspstrconsts.po | 4 ++++ .../languages/objinspstrconsts.pt_BR.po | 4 ++++ .../ideintf/languages/objinspstrconsts.ru.po | 4 ++++ .../ideintf/languages/objinspstrconsts.sk.po | 4 ++++ .../ideintf/languages/objinspstrconsts.uk.po | 4 ++++ .../languages/objinspstrconsts.zh_CN.po | 4 ++++ components/ideintf/objinspstrconsts.pas | 3 +++ 22 files changed, 98 insertions(+), 4 deletions(-) diff --git a/components/ideintf/dbpropedits.pas b/components/ideintf/dbpropedits.pas index f627cdab4d..195ee0c21c 100644 --- a/components/ideintf/dbpropedits.pas +++ b/components/ideintf/dbpropedits.pas @@ -17,9 +17,9 @@ unit DBPropEdits; interface uses - Classes, SysUtils, ObjInspStrConsts, PropEdits, PropEditUtils, - ComponentEditors, - TypInfo, DB, DbCtrls, DBGrids, Forms, DBGridColumnsPropEditForm; + Classes, SysUtils, ObjInspStrConsts, Dialogs, PropEdits, PropEditUtils, + ComponentEditors, TypInfo, DB, DbCtrls, DBGrids, Forms, + DBGridColumnsPropEditForm; type TFieldProperty = class(TStringPropertyEditor) @@ -78,7 +78,17 @@ begin DataSet.GetFieldNames(List) else begin - DataSet.FieldDefs.Update; + try + DataSet.FieldDefs.Update; + except + // some FPC versions will fail here, but having persistent fields should + // actually work or else present an empty list of fields... but not crash/freeze + if Dataset.FieldDefs.Count=0 then begin + List.Clear; + ShowMessage(dpeUnableToRetrieveFieldsDefinitions); + exit; + end; + end; for i := 0 to DataSet.FieldDefs.Count - 1 do List.Add(DataSet.FieldDefs[i].Name); end; diff --git a/components/ideintf/languages/objinspstrconsts.ca.po b/components/ideintf/languages/objinspstrconsts.ca.po index 0b5616f0ae..84ae2be0fb 100644 --- a/components/ideintf/languages/objinspstrconsts.ca.po +++ b/components/ideintf/languages/objinspstrconsts.ca.po @@ -153,6 +153,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.cs.po b/components/ideintf/languages/objinspstrconsts.cs.po index c15f5dde8f..1db9953973 100644 --- a/components/ideintf/languages/objinspstrconsts.cs.po +++ b/components/ideintf/languages/objinspstrconsts.cs.po @@ -155,6 +155,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Spočítáno" diff --git a/components/ideintf/languages/objinspstrconsts.de.po b/components/ideintf/languages/objinspstrconsts.de.po index f5785f8d67..17aebdb785 100644 --- a/components/ideintf/languages/objinspstrconsts.de.po +++ b/components/ideintf/languages/objinspstrconsts.de.po @@ -156,6 +156,10 @@ msgstr "Dies wird alle Spalten löschen. Fortfahren?" msgid "This will replace all captions from dataset. Continue?" msgstr "Dies wird alle Titel aus dem Dataset ersetzen. Fortfahren?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "Bere&chnet" diff --git a/components/ideintf/languages/objinspstrconsts.es.po b/components/ideintf/languages/objinspstrconsts.es.po index 964fe704f7..4c680c521a 100644 --- a/components/ideintf/languages/objinspstrconsts.es.po +++ b/components/ideintf/languages/objinspstrconsts.es.po @@ -155,6 +155,10 @@ msgstr "Esto borrará todas las columnas. ¿Desea continuar?" msgid "This will replace all captions from dataset. Continue?" msgstr "Esto reemplazará los títulos (captions) de columna actuales por los originales del dataset. ¿Desea continuar?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Calculados" diff --git a/components/ideintf/languages/objinspstrconsts.fi.po b/components/ideintf/languages/objinspstrconsts.fi.po index c49c520f9c..198d276ba0 100644 --- a/components/ideintf/languages/objinspstrconsts.fi.po +++ b/components/ideintf/languages/objinspstrconsts.fi.po @@ -148,6 +148,10 @@ msgstr "Tämä tuhoaa kaikki sarakkeet. Jatka?" msgid "This will replace all captions from dataset. Continue?" msgstr "Tämä hakee ja korvaa kaikki otsikot tietokannasta. Jatka?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Laskettu" diff --git a/components/ideintf/languages/objinspstrconsts.fr.po b/components/ideintf/languages/objinspstrconsts.fr.po index 450d15dda2..2b8d49f055 100644 --- a/components/ideintf/languages/objinspstrconsts.fr.po +++ b/components/ideintf/languages/objinspstrconsts.fr.po @@ -156,6 +156,10 @@ msgstr "Toutes les colonnes vont être supprimées. Voulez-vous continuer ?" msgid "This will replace all captions from dataset. Continue?" msgstr "Toutes les légendes vont être remplacées depuis l'ensemble de données. Voulez-vous continuer ?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Calculé" @@ -1563,3 +1567,4 @@ msgstr "Déplacer l'onglet vers la gauche" #: objinspstrconsts.tccesmovetabright msgid "Move tab right" msgstr "Déplacer l'onglet vers la droite" + diff --git a/components/ideintf/languages/objinspstrconsts.he.po b/components/ideintf/languages/objinspstrconsts.he.po index c9670bf5d9..512d8284a8 100644 --- a/components/ideintf/languages/objinspstrconsts.he.po +++ b/components/ideintf/languages/objinspstrconsts.he.po @@ -152,6 +152,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "מחושב" diff --git a/components/ideintf/languages/objinspstrconsts.hu.po b/components/ideintf/languages/objinspstrconsts.hu.po index b70a0d61da..560101ed9b 100644 --- a/components/ideintf/languages/objinspstrconsts.hu.po +++ b/components/ideintf/languages/objinspstrconsts.hu.po @@ -155,6 +155,10 @@ msgstr "Ez a művelet törli az összes oszlopot. Folytatás?" msgid "This will replace all captions from dataset. Continue?" msgstr "Ez a művelet lecseréli az összes feliratot az adatkészletben találhatókra. Folytatás?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "Számított" diff --git a/components/ideintf/languages/objinspstrconsts.id.po b/components/ideintf/languages/objinspstrconsts.id.po index a46addd217..eeee02535f 100644 --- a/components/ideintf/languages/objinspstrconsts.id.po +++ b/components/ideintf/languages/objinspstrconsts.id.po @@ -153,6 +153,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.it.po b/components/ideintf/languages/objinspstrconsts.it.po index 8e5e9cac97..92de875595 100644 --- a/components/ideintf/languages/objinspstrconsts.it.po +++ b/components/ideintf/languages/objinspstrconsts.it.po @@ -156,6 +156,10 @@ msgstr "Verranno cancellate tutte le colonne. Continuare?" msgid "This will replace all captions from dataset. Continue?" msgstr "Questo sostituirà tutte le intestazioni dal dataset. Continuare?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Calcolato" diff --git a/components/ideintf/languages/objinspstrconsts.ja.po b/components/ideintf/languages/objinspstrconsts.ja.po index b770e742bb..64c7c9fcfc 100644 --- a/components/ideintf/languages/objinspstrconsts.ja.po +++ b/components/ideintf/languages/objinspstrconsts.ja.po @@ -153,6 +153,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "計算済み(&C)" diff --git a/components/ideintf/languages/objinspstrconsts.lt.po b/components/ideintf/languages/objinspstrconsts.lt.po index 1148d7ff79..453fc6710b 100644 --- a/components/ideintf/languages/objinspstrconsts.lt.po +++ b/components/ideintf/languages/objinspstrconsts.lt.po @@ -155,6 +155,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "Ap&skaičiuota" diff --git a/components/ideintf/languages/objinspstrconsts.nl.po b/components/ideintf/languages/objinspstrconsts.nl.po index bfc509dadb..64c64c9527 100644 --- a/components/ideintf/languages/objinspstrconsts.nl.po +++ b/components/ideintf/languages/objinspstrconsts.nl.po @@ -148,6 +148,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.pl.po b/components/ideintf/languages/objinspstrconsts.pl.po index 8e97974372..12cbaacf01 100644 --- a/components/ideintf/languages/objinspstrconsts.pl.po +++ b/components/ideintf/languages/objinspstrconsts.pl.po @@ -156,6 +156,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.po b/components/ideintf/languages/objinspstrconsts.po index 6b14ec6162..2148c156eb 100644 --- a/components/ideintf/languages/objinspstrconsts.po +++ b/components/ideintf/languages/objinspstrconsts.po @@ -148,6 +148,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.pt_BR.po b/components/ideintf/languages/objinspstrconsts.pt_BR.po index aaa0c4a03f..53f5e3704e 100644 --- a/components/ideintf/languages/objinspstrconsts.pt_BR.po +++ b/components/ideintf/languages/objinspstrconsts.pt_BR.po @@ -154,6 +154,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Calculado" diff --git a/components/ideintf/languages/objinspstrconsts.ru.po b/components/ideintf/languages/objinspstrconsts.ru.po index 946d0b3156..d7c633ae8e 100644 --- a/components/ideintf/languages/objinspstrconsts.ru.po +++ b/components/ideintf/languages/objinspstrconsts.ru.po @@ -153,6 +153,10 @@ msgstr "Это действие приведёт к удалению всех с msgid "This will replace all captions from dataset. Continue?" msgstr "Это действие приведёт к замене всех заголовков набора данных. Продолжить?" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "&Вычисляемое" diff --git a/components/ideintf/languages/objinspstrconsts.sk.po b/components/ideintf/languages/objinspstrconsts.sk.po index a5dc0542b0..0dd0215490 100644 --- a/components/ideintf/languages/objinspstrconsts.sk.po +++ b/components/ideintf/languages/objinspstrconsts.sk.po @@ -155,6 +155,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/languages/objinspstrconsts.uk.po b/components/ideintf/languages/objinspstrconsts.uk.po index 0ac0bbf093..caca2da16f 100644 --- a/components/ideintf/languages/objinspstrconsts.uk.po +++ b/components/ideintf/languages/objinspstrconsts.uk.po @@ -156,6 +156,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "Об&числено" diff --git a/components/ideintf/languages/objinspstrconsts.zh_CN.po b/components/ideintf/languages/objinspstrconsts.zh_CN.po index e7e34613b8..02c9d45182 100644 --- a/components/ideintf/languages/objinspstrconsts.zh_CN.po +++ b/components/ideintf/languages/objinspstrconsts.zh_CN.po @@ -156,6 +156,10 @@ msgstr "" msgid "This will replace all captions from dataset. Continue?" msgstr "" +#: objinspstrconsts.dpeunabletoretrievefieldsdefinitions +msgid "Unable to retrieve fields definition from dataset" +msgstr "" + #: objinspstrconsts.fescalculated msgid "&Calculated" msgstr "" diff --git a/components/ideintf/objinspstrconsts.pas b/components/ideintf/objinspstrconsts.pas index a4f5e6fbf9..23eb4e8046 100644 --- a/components/ideintf/objinspstrconsts.pas +++ b/components/ideintf/objinspstrconsts.pas @@ -448,6 +448,9 @@ resourcestring // IDE Text Converter itcsSearchAndReplace = 'Search and replace'; + // DBPropedits + dpeUnableToRetrieveFieldsDefinitions = 'Unable to retrieve fields definition from dataset'; + implementation end.