View Issue Details

IDProjectCategoryView StatusLast Update
0000548Double CommanderDefaultpublic2017-09-04 08:25
Reporterpktfag Assigned Tocobines  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
ProjectionnoneETAnone 
OSlinux,windows 
Product Version0.6.0 (trunk)Product Build4944 
Fixed in Version0.5.5 
Summary0000548: Error occurs when delete only one element in search templates
DescriptionPatch in onlyone.diff
Steps To ReproduceTry to delete only one element in search dialog in "Load/Save"
Error:
TListBox Index 0 out of bounds 0 .. -1
TagsNo tags attached.
Attached Files
onlyone.diff (880 bytes)   
# HG changeset patch
# User Oleg Khlystov <pktfag@gmail.com>
# Date 1345964682 -14400
# Node ID a7c47c58b39ad7265e66f1b1d3e25350cf8ab391
# Parent  4e2972c576048ab6857c65fb6f962485f8eb8f6a
FIX: error occurs when delete last element in search templates

diff -r 4e2972c57604 -r a7c47c58b39a src/fFindDlg.pas
--- a/src/fFindDlg.pas	Sun Aug 26 10:31:06 2012 +0400
+++ b/src/fFindDlg.pas	Sun Aug 26 11:04:42 2012 +0400
@@ -1326,8 +1326,12 @@
 begin
   OldIndex := lbSearchTemplates.ItemIndex;
   gSearchTemplateList.LoadToStringList(lbSearchTemplates.Items);
-  if OldIndex <> -1 then
-    lbSearchTemplates.ItemIndex := OldIndex;
+  if lbSearchTemplates.Count > 0 then begin
+    if OldIndex = 0 then
+      lbSearchTemplates.ItemIndex := OldIndex
+    else
+      lbSearchTemplates.ItemIndex := OldIndex - 1;
+  end;
 end;
 
 procedure TfrmFindDlg.ZVDateFromChange(Sender: TObject);
onlyone.diff (880 bytes)   
Fixed in Revision4990
Operating systemWindows, Linux
WidgetsetWin32, GTK2
Architecture32-bit, 64-bit

Activities

vitaliyg

2012-08-27 15:20

developer   ~0000867

Currently selected template should be restored by template name and not by index.

Because some completely different template can be loaded instead of required when restored by index.

pktfag

2012-08-31 12:44

reporter   ~0000868

Different template can be loaded instead of required by clicking button "Load".

cobines

2012-10-07 11:05

administrator   ~0000944

I did it differently, so that it only affects deleting.

Issue History

Date Modified Username Field Change
2012-08-26 11:23 pktfag New Issue
2012-08-26 11:23 pktfag File Added: onlyone.diff
2012-08-27 15:20 vitaliyg Note Added: 0000867
2012-08-31 12:44 pktfag Note Added: 0000868
2012-10-07 11:05 cobines Fixed in Revision => 4990
2012-10-07 11:05 cobines Note Added: 0000944
2012-10-07 11:05 cobines Status new => resolved
2012-10-07 11:05 cobines Fixed in Version => 0.5.5
2012-10-07 11:05 cobines Resolution open => fixed
2012-10-07 11:05 cobines Assigned To => cobines
2017-09-04 08:25 Alexx2000 Status resolved => closed