Changeset 227 for trunk/Forms/FormAcronyms.pas
- Timestamp:
- Jan 20, 2025, 11:38:55 AM (42 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormAcronyms.pas
r219 r227 50 50 FAcronyms: TAcronyms; 51 51 MeaningCount: Integer; 52 function CompareStrings(Strings1, Strings2: TStrings): Boolean; 52 53 function AcronymComparer(constref Item1, Item2: TAcronym): Integer; 53 54 procedure FilterList(List: TObjectList<TObject>); … … 55 56 procedure UpdateAcronymsList; 56 57 public 58 AcronymDb: TAcronymDb; 57 59 FocusAcronym: TAcronymMeaning; 58 60 property Acronyms: TAcronyms read FAcronyms write SetAcronyms; … … 66 68 67 69 uses 68 Core,FormAcronym;70 FormAcronym; 69 71 70 72 resourcestring … … 116 118 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 117 119 UpdateAcronymsList; 118 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);120 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 119 121 120 122 // Focus line with acronym … … 131 133 end; 132 134 135 function TFormAcronyms.CompareStrings(Strings1, Strings2: TStrings): Boolean; 136 var 137 I: Integer; 138 begin 139 Result := Strings1.Count = Strings2.Count; 140 if not Result then Exit; 141 for I := 0 to Strings1.Count - 1 do 142 if (Strings1[I] <> Strings2[I]) or (Strings1.Objects[I] <> Strings2.Objects[I]) then begin 143 Result := False; 144 Exit; 145 end; 146 end; 147 133 148 procedure TFormAcronyms.AAddExecute(Sender: TObject); 134 149 var … … 144 159 FormAcronym := TFormAcronym.Create(Self); 145 160 try 161 FormAcronym.AcronymDb := AcronymDb; 146 162 FormAcronym.Load(TempEntry); 147 163 if FormAcronym.ShowModal = mrOk then begin … … 186 202 FormAcronym := TFormAcronym.Create(Self); 187 203 try 204 FormAcronym.AcronymDb := AcronymDb; 188 205 FormAcronym.Load(TempEntry); 189 206 if FormAcronym.ShowModal = mrOk then begin … … 192 209 (TempEntry.Meaning <> Name) or 193 210 (TempEntry.Description <> Description) or 194 not Co re.Core.CompareStrings(TempEntry.Categories, TempCategories) then begin211 not CompareStrings(TempEntry.Categories, TempCategories) then begin 195 212 // TODO: Update item inplace if possible 196 213 Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data)); … … 201 218 // Update reverse references 202 219 for I := 0 to Meaning.Categories.Count - 1 do 203 if TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.IndexOf(Meaning) = -1 then204 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);220 if Meaning.Categories.Items[I].AcronymMeanings.IndexOf(Meaning) = -1 then 221 Meaning.Categories.Items[I].AcronymMeanings.Add(Meaning); 205 222 Acronyms.Db.Update; 206 223 UpdateAcronymsList;
Note:
See TracChangeset
for help on using the changeset viewer.