Also copying the document language to the find/replace WA cursors' current language. This avoids typing in the replace WA results in underscored text while editing non-English documents.

This addresses (and hopefully closes) #6171.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37058 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2010-12-31 15:07:03 +00:00
parent 426c5671d5
commit dbb3f12aa5

View File

@ -17,6 +17,7 @@
#include "GuiView.h"
#include "GuiWorkArea.h"
#include "qt_helpers.h"
#include "Language.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
@ -529,6 +530,12 @@ void FindAndReplaceWidget::showEvent(QShowEvent * /* ev */)
LYXERR(Debug::FIND, "Applying document params to replace buffer");
ApplyParams(replace_buf, doc_bp);
string lang = doc_bp.language->lang();
LYXERR(Debug::FIND, "Setting current editing language to " << lang << endl);
FuncRequest cmd(LFUN_LANGUAGE, lang);
find_buf.text().dispatch(find_work_area_->bufferView().cursor(), cmd);
replace_buf.text().dispatch(replace_work_area_->bufferView().cursor(), cmd);
view_.setCurrentWorkArea(find_work_area_);
LYXERR(Debug::FIND, "Selecting entire find buffer");
dispatch(FuncRequest(LFUN_BUFFER_BEGIN));