Changeset 34 for trunk/UAcronym.pas
- Timestamp:
- Jul 13, 2016, 3:24:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UAcronym.pas
r33 r34 218 218 procedure FilterList(AName: string; Items: TAcronymMeanings); 219 219 function AddAcronym(AcronymName, MeaningName: string): TAcronymMeaning; 220 procedure RemoveMeaning(Meaning: TAcronymMeaning); 220 221 procedure RemoveAcronym(AcronymName, MeaningName: string); 221 222 procedure AssignToList(List: TListObject); … … 772 773 LastId := 0; 773 774 for I := 0 to Count - 1 do begin 774 if TAcronym Category(Items[I]).Id > LastId then LastId := TAcronymCategory(Items[I]).Id;775 if TAcronymMeaning(Items[I]).Id > LastId then LastId := TAcronymMeaning(Items[I]).Id; 775 776 end; 776 777 // Add ID to new items without ID 777 778 for I := 0 to Count - 1 do begin 778 if TAcronym Category(Items[I]).Id = 0 then begin779 if TAcronymMeaning(Items[I]).Id = 0 then begin 779 780 Inc(LastId); 780 TAcronym Category(Items[I]).Id := LastId;781 TAcronymMeaning(Items[I]).Id := LastId; 781 782 end; 782 783 end; … … 875 876 I: Integer; 876 877 begin 877 if Assigned(Acronym) then878 Acronym.Meanings.Remove(Self);879 878 for I := 0 to Categories.Count - 1 do 880 879 TAcronymCategory(Categories[I]).AcronymMeanings.Remove(Self); … … 1370 1369 end; 1371 1370 1371 procedure TAcronymDb.RemoveMeaning(Meaning: TAcronymMeaning); 1372 var 1373 Acronym: TAcronym; 1374 begin 1375 Acronym := Meaning.Acronym; 1376 Acronym.Meanings.Remove(Meaning); 1377 if Acronym.Meanings.Count = 0 then 1378 Acronyms.Remove(Acronym); 1379 Modified := True; 1380 end; 1381 1372 1382 procedure TAcronymDb.RemoveAcronym(AcronymName, MeaningName: string); 1373 1383 var … … 1378 1388 if Assigned(Acronym) then begin 1379 1389 Meaning := Acronym.Meanings.SearchByName(MeaningName); 1380 if Assigned(Meaning) then begin 1381 Acronym.Meanings.Remove(Meaning); 1382 if Acronym.Meanings.Count = 0 then 1383 Acronyms.Remove(Acronym); 1384 end; 1385 end; 1386 Modified := True; 1390 if Assigned(Meaning) then RemoveMeaning(Meaning); 1391 end; 1387 1392 end; 1388 1393
Note:
See TracChangeset
for help on using the changeset viewer.