Squash a bug spotted by Udo M��ller in the XForms find & replace dialog.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10348 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-07-22 16:51:54 +00:00
parent 85eed78238
commit 792636617d
2 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2005-07-22 Angus Leeming <leeming@lyx.org>
* FormSearch.C (input): do not trim the find and replace strings.
2005-07-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de> 2005-07-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FormDocument.C: * FormDocument.C:
@ -15,7 +19,7 @@
"List" "List"
* forms/form_preferences.fd: remove spaces from messages * forms/form_preferences.fd: remove spaces from messages
* FormPreferences.C: simplify/clarify messages * FormPreferences.C: simplify/clarify messages
2005-07-18 José Matos <jamatos@fc.up.pt> 2005-07-18 José Matos <jamatos@fc.up.pt>
* FormDocument.C: new file format, remove support for a4.sty, * FormDocument.C: new file format, remove support for a4.sty,

View File

@ -15,7 +15,6 @@
#include "forms/form_search.h" #include "forms/form_search.h"
#include "Tooltips.h" #include "Tooltips.h"
#include "xforms_helpers.h"
#include "xformsBC.h" #include "xformsBC.h"
#include "lyx_forms.h" #include "lyx_forms.h"
@ -71,10 +70,24 @@ void FormSearch::update()
} }
namespace {
string const getUntrimmedString(FL_OBJECT * ob)
{
BOOST_ASSERT(ob->objclass == FL_INPUT);
char const * const tmp = fl_get_input(ob);
return tmp ? tmp : string();
}
} // namespace anon
ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long) ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long)
{ {
if (ob == dialog_->button_findnext) { if (ob == dialog_->button_findnext) {
controller().find(getString(dialog_->input_search), controller().find(getUntrimmedString(dialog_->input_search),
fl_get_button(dialog_->check_casesensitive), fl_get_button(dialog_->check_casesensitive),
fl_get_button(dialog_->check_matchword), fl_get_button(dialog_->check_matchword),
!fl_get_button(dialog_->check_searchbackwards)); !fl_get_button(dialog_->check_searchbackwards));
@ -82,8 +95,8 @@ ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long)
} else if (ob == dialog_->button_replace || ob == dialog_->button_replaceall) { } else if (ob == dialog_->button_replace || ob == dialog_->button_replaceall) {
bool const all = (ob == dialog_->button_replaceall); bool const all = (ob == dialog_->button_replaceall);
controller().replace(getString(dialog_->input_search), controller().replace(getUntrimmedString(dialog_->input_search),
getString(dialog_->input_replace), getUntrimmedString(dialog_->input_replace),
fl_get_button(dialog_->check_casesensitive), fl_get_button(dialog_->check_casesensitive),
fl_get_button(dialog_->check_matchword), fl_get_button(dialog_->check_matchword),
!fl_get_button(dialog_->check_searchbackwards), !fl_get_button(dialog_->check_searchbackwards),