]> git.lyx.org Git - lyx.git/commitdiff
Also copying the document language to the find/replace WA cursors' current language...
authorTommaso Cucinotta <tommaso@lyx.org>
Fri, 31 Dec 2010 15:07:03 +0000 (15:07 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Fri, 31 Dec 2010 15:07:03 +0000 (15:07 +0000)
This addresses (and hopefully closes) #6171.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37058 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/FindAndReplace.cpp

index 5c7fc40a1031217e511a015ea2738f7830684692..402b18b9c1d78813416e4a26e8296f18593867c6 100644 (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));