diff --git a/Packages/SVGIconImageListEditorUnit.pas b/Packages/SVGIconImageListEditorUnit.pas index b38c4c2f..0f0c05f3 100644 --- a/Packages/SVGIconImageListEditorUnit.pas +++ b/Packages/SVGIconImageListEditorUnit.pas @@ -691,11 +691,11 @@ procedure TSVGIconImageListEditor.BuildList(Selected: Integer); procedure TSVGIconImageListEditor.DeleteSelectedItems; var LIndex: Integer; - Selected: Integer; + LSelectedImageIndex: Integer; begin Screen.Cursor := crHourGlass; try - Selected := ImageView.ItemIndex; + LSelectedImageIndex := ImageView.Items[ImageView.ItemIndex].ImageIndex; FEditingList.BeginUpdate; try for LIndex := ImageView.Items.Count - 1 downto 0 do @@ -705,7 +705,7 @@ procedure TSVGIconImageListEditor.DeleteSelectedItems; FEditingList.EndUpdate; end; FChanged := True; - BuildList(Selected); + BuildList(LSelectedImageIndex); finally Screen.Cursor := crDefault; end; @@ -718,18 +718,17 @@ procedure TSVGIconImageListEditor.DeleteAllButtonClick(Sender: TObject); procedure TSVGIconImageListEditor.DeleteButtonClick(Sender: TObject); var - LIndex: Integer; + LSelectedImageIndex: Integer; begin FEditingList.BeginUpdate; try - LIndex := ImageView.ItemIndex; - FEditingList.SVGIconItems.Delete(ImageView.Items[LIndex].ImageIndex); + LSelectedImageIndex := ImageView.Items[ImageView.ItemIndex].ImageIndex; + FEditingList.SVGIconItems.Delete(ImageView.Items[ImageView.ItemIndex].ImageIndex); finally FEditingList.EndUpdate; end; FChanged := True; - if ImageView.Items.Count > 1 then - BuildList(ImageView.Items[LIndex-1].ImageIndex); + BuildList(LSelectedImageIndex); end; procedure TSVGIconImageListEditor.FixedColorComboBoxSelect(Sender: TObject); diff --git a/Source/D2DSVGFactory.pas b/Source/D2DSVGFactory.pas index 1fa15310..7e574ca5 100644 --- a/Source/D2DSVGFactory.pas +++ b/Source/D2DSVGFactory.pas @@ -346,7 +346,7 @@ procedure TD2DSVG.SetFixedColor(const Color: TColor); fFixedColor := Color; fGrayScale := False; - if FFixedColor <> TColors.SysDefault then + if (FFixedColor <> TColors.SysDefault) and Assigned(fSvgDoc) then begin fSvgDoc.GetRoot(Root); diff --git a/Source/SVGIconImageListBase.pas b/Source/SVGIconImageListBase.pas index 65fb003e..bf8027d4 100644 --- a/Source/SVGIconImageListBase.pas +++ b/Source/SVGIconImageListBase.pas @@ -48,7 +48,7 @@ interface SvgInterfaces; const - SVGIconImageListVersion = '2.1.0'; + SVGIconImageListVersion = '2.1.1'; DEFAULT_SIZE = 16; type