IDEIntf, dbpropedits: check when retrieving fields definitions, issue #27962

git-svn-id: trunk@48889 -
This commit is contained in:
jesus 2015-04-29 06:20:16 +00:00
parent bfe307d647
commit c6d6f8c7a6
22 changed files with 98 additions and 4 deletions

View File

@ -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;

View File

@ -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 ""

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 "מחושב"

View File

@ -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"

View File

@ -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 ""

View File

@ -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"

View File

@ -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)"

View File

@ -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"

View File

@ -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 ""

View File

@ -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 ""

View File

@ -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 ""

View File

@ -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"

View File

@ -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 "&Вычисляемое"

View File

@ -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 ""

View File

@ -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 "Об&числено"

View File

@ -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 ""

View File

@ -448,6 +448,9 @@ resourcestring
// IDE Text Converter
itcsSearchAndReplace = 'Search and replace';
// DBPropedits
dpeUnableToRetrieveFieldsDefinitions = 'Unable to retrieve fields definition from dataset';
implementation
end.