Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Replace bug fix
thomas:
Ah, now I get it. The issue is that the search/replace starts at the first occurrence after the highlighted one. Yes, that's what it does here too.
oBFusCATed:
The posted patch is committed. If you see any problems don't hesitate to report them. :)
I'm looking for answers about the second problem...
oBFusCATed:
Can you tell me what variations of this patch work or doesn't on your machines (windows other linuxes)?
--- Code: ---diff --git a/src/sdk/findreplacedlg.cpp b/src/sdk/findreplacedlg.cpp
index 50da448..3dd4e38 100644
--- a/src/sdk/findreplacedlg.cpp
+++ b/src/sdk/findreplacedlg.cpp
@@ -229,6 +229,7 @@ FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool h
XRCCTRL(*this, "chkDelOldSearchRes2", wxCheckBox)->Show();
}
+ wxComboBox *findCombo = nullptr;
m_findPage = 0;
if (findReplaceInFilesOnly)
{
@@ -236,16 +237,22 @@ FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool h
XRCCTRL(*this, "nbReplace", wxNotebook)->SetSelection(1);
m_findPage = (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0)); // no active editor, so only replace-in-files
(XRCCTRL(*this, "nbReplace", wxNotebook)->RemovePage(0)); // no active editor, so only replace-in-files
- XRCCTRL(*this, "cmbFind2", wxComboBox)->SetFocus();
+ findCombo = XRCCTRL(*this, "cmbFind2", wxComboBox);
m_findReplaceInFilesActive = true;
}
else if (m_findReplaceInFilesActive)
{
XRCCTRL(*this, "nbReplace", wxNotebook)->SetSelection(1); // Search->Replace in Files was selected
- XRCCTRL(*this, "cmbFind2", wxComboBox)->SetFocus();
+ findCombo = XRCCTRL(*this, "cmbFind2", wxComboBox);
}
else
- XRCCTRL(*this, "cmbFind1", wxComboBox)->SetFocus();
+ findCombo = XRCCTRL(*this, "cmbFind1", wxComboBox);
+
+ if (findCombo)
+ {
+ findCombo->SetFocus();
+// findCombo->SetSelection(0, findCombo->GetValue().length());
+ }
GetSizer()->SetSizeHints(this);
--- End code ---
You have to play with commenting the two lines in the "if (findCombo) " section.
For me the posted version doesn't work.
Commenting both lines works, uncommenting both lines also works.
oBFusCATed:
Have anyone tried the patch?
MortenMacFly:
--- Quote from: oBFusCATed on June 22, 2013, 10:36:55 am ---Have anyone tried the patch?
--- End quote ---
I'm tired of trying GIT patches you know.. ::)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version