Patch #2010 2007-05-16 22:41

pauliusz

Patch for Bug #10992
Download
2010-Patch_for_Bug.patch (1.6 KB)
Category
Application::Bugfix
Status
Rejected
Close date
2007-05-20 13:31
Assigned to
biplab
Index: src/sdk/finddlg.cpp
===================================================================
--- src/sdk/finddlg.cpp    (revision 3968)
+++ src/sdk/finddlg.cpp    (working copy)
@@ -88,7 +88,7 @@
     XRCCTRL(*this, "rbDirection", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/direction"), 1));
     XRCCTRL(*this, "rbDirection", wxRadioBox)->Enable(!XRCCTRL(*this, "chkRegEx1", wxCheckBox)->GetValue()); // if regex, only forward searches
     XRCCTRL(*this, "rbOrigin", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/origin"), 0));
-    XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(hasSelection);
+    XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(0);
     XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
 
     // find in files options
Index: src/sdk/replacedlg.cpp
===================================================================
--- src/sdk/replacedlg.cpp    (revision 3968)
+++ src/sdk/replacedlg.cpp    (working copy)
@@ -71,7 +71,7 @@
     XRCCTRL(*this, "rbDirection", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/direction"), 1));
     XRCCTRL(*this, "rbDirection", wxRadioBox)->Enable(!XRCCTRL(*this, "chkRegEx1", wxCheckBox)->GetValue()); // if regex, only forward searches
     XRCCTRL(*this, "rbOrigin", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/origin"), 0));
-    XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(hasSelection);
+    XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(0);
     XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
     // special key, uses same config for both find & replace options
     XRCCTRL(*this, "chkAutoWrapSearch", wxCheckBox)->SetValue(cfg->ReadBool(_T("/find_options/auto_wrap_search"), true));
pauliusz 2007-05-16 22:48

The problem was that if user selects text with more than one word, then in Find dialog "Scope->Selected text" is checked by default. I think 99% of the Find cases needs "Scope->Global". If user wants to search only in selected text, than he can make this scope selection by himself.