2 * \file BufferView_pimpl.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Asger Alstrup
7 * \author Alfredo Braunstein
8 * \author Lars Gullik Bjønnes
9 * \author Jean-Marc Lasgouttes
10 * \author Angus Leeming
12 * \author André Pönitz
14 * \author Jürgen Vigna
16 * Full author contact details are available in file CREDITS.
21 #include "BufferView_pimpl.h"
23 #include "buffer_funcs.h"
24 #include "bufferlist.h"
25 #include "bufferparams.h"
28 #include "dispatchresult.h"
30 #include "FloatList.h"
31 #include "funcrequest.h"
34 #include "insetiterator.h"
35 #include "lyx_cb.h" // added for Dispatch functions
41 #include "lastfiles.h"
42 #include "paragraph.h"
43 #include "paragraph_funcs.h"
44 #include "ParagraphParameters.h"
45 #include "pariterator.h"
49 #include "insets/insetref.h"
50 #include "insets/insettext.h"
52 #include "frontends/Alert.h"
53 #include "frontends/Dialogs.h"
54 #include "frontends/FileDialog.h"
55 #include "frontends/LyXView.h"
56 #include "frontends/LyXScreenFactory.h"
57 #include "frontends/screen.h"
58 #include "frontends/WorkArea.h"
59 #include "frontends/WorkAreaFactory.h"
61 #include "graphics/Previews.h"
63 #include "support/filetools.h"
64 #include "support/forkedcontr.h"
65 #include "support/globbing.h"
66 #include "support/path_defines.h"
67 #include "support/tostr.h"
69 #include <boost/bind.hpp>
73 using lyx::support::AddPath;
74 using lyx::support::bformat;
75 using lyx::support::FileFilterList;
76 using lyx::support::FileSearch;
77 using lyx::support::ForkedcallsController;
78 using lyx::support::IsDirWriteable;
79 using lyx::support::MakeDisplayPath;
80 using lyx::support::strToUnsignedInt;
81 using lyx::support::system_lyxdir;
84 using std::istringstream;
90 extern BufferList bufferlist;
95 unsigned int const saved_positions_num = 20;
97 // All the below connection objects are needed because of a bug in some
98 // versions of GCC (<=2.96 are on the suspects list.) By having and assigning
99 // to these connections we avoid a segfault upon startup, and also at exit.
102 boost::signals::connection dispatchcon;
103 boost::signals::connection timecon;
104 boost::signals::connection doccon;
105 boost::signals::connection resizecon;
106 boost::signals::connection kpresscon;
107 boost::signals::connection selectioncon;
108 boost::signals::connection lostcon;
114 BufferView::Pimpl::Pimpl(BufferView & bv, LyXView * owner,
115 int xpos, int ypos, int width, int height)
116 : bv_(&bv), owner_(owner), buffer_(0), cursor_timeout(400),
117 using_xterm_cursor(false), cursor_(bv)
119 xsel_cache_.set = false;
121 workarea_.reset(WorkAreaFactory::create(xpos, ypos, width, height));
122 screen_.reset(LyXScreenFactory::create(workarea()));
125 doccon = workarea().scrollDocView
126 .connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
127 resizecon = workarea().workAreaResize
128 .connect(boost::bind(&BufferView::Pimpl::workAreaResize, this));
129 dispatchcon = workarea().dispatch
130 .connect(boost::bind(&BufferView::Pimpl::workAreaDispatch, this, _1));
131 kpresscon = workarea().workAreaKeyPress
132 .connect(boost::bind(&BufferView::Pimpl::workAreaKeyPress, this, _1, _2));
133 selectioncon = workarea().selectionRequested
134 .connect(boost::bind(&BufferView::Pimpl::selectionRequested, this));
135 lostcon = workarea().selectionLost
136 .connect(boost::bind(&BufferView::Pimpl::selectionLost, this));
138 timecon = cursor_timeout.timeout
139 .connect(boost::bind(&BufferView::Pimpl::cursorToggle, this));
140 cursor_timeout.start();
141 saved_positions.resize(saved_positions_num);
145 void BufferView::Pimpl::addError(ErrorItem const & ei)
147 errorlist_.push_back(ei);
151 void BufferView::Pimpl::showReadonly(bool)
153 owner_->updateWindowTitle();
154 owner_->getDialogs().updateBufferDependent(false);
158 void BufferView::Pimpl::connectBuffer(Buffer & buf)
160 if (errorConnection_.connected())
165 boost::bind(&BufferView::Pimpl::addError, this, _1));
169 boost::bind(&LyXView::message, owner_, _1));
173 boost::bind(&LyXView::busy, owner_, _1));
176 buf.updateTitles.connect(
177 boost::bind(&LyXView::updateWindowTitle, owner_));
180 buf.resetAutosaveTimers.connect(
181 boost::bind(&LyXView::resetAutosaveTimer, owner_));
183 readonlyConnection_ =
184 buf.readonly.connect(
185 boost::bind(&BufferView::Pimpl::showReadonly, this, _1));
189 boost::bind(&BufferView::Pimpl::setBuffer, this, (Buffer *)0));
193 void BufferView::Pimpl::disconnectBuffer()
195 errorConnection_.disconnect();
196 messageConnection_.disconnect();
197 busyConnection_.disconnect();
198 titleConnection_.disconnect();
199 timerConnection_.disconnect();
200 readonlyConnection_.disconnect();
201 closingConnection_.disconnect();
205 void BufferView::Pimpl::newFile(string const & filename, string const & tname,
208 setBuffer(::newFile(filename, tname, isNamed));
212 bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles)
214 // get absolute path of file and add ".lyx" to the filename if
216 string s = FileSearch(string(), filename, "lyx");
218 bool const found = !s.empty();
223 // file already open?
224 if (bufferlist.exists(s)) {
225 string const file = MakeDisplayPath(s, 20);
226 string text = bformat(_("The document %1$s is already "
227 "loaded.\n\nDo you want to revert "
228 "to the saved version?"), file);
229 int const ret = Alert::prompt(_("Revert to saved document?"),
230 text, 0, 1, _("&Revert"), _("&Switch to document"));
233 setBuffer(bufferlist.getBuffer(s));
236 // FIXME: should be LFUN_REVERT
237 if (!bufferlist.close(bufferlist.getBuffer(s), false))
239 // Fall through to new load. (Asger)
245 b = bufferlist.newBuffer(s);
247 if (!::loadLyXFile(b, s)) {
248 bufferlist.release(b);
252 string text = bformat(_("The document %1$s does not yet "
253 "exist.\n\nDo you want to create "
254 "a new document?"), s);
255 int const ret = Alert::prompt(_("Create new document?"),
256 text, 0, 1, _("&Create"), _("Cancel"));
259 b = ::newFile(s, string(), true);
265 bv_->showErrorList(_("Parse"));
268 LyX::ref().lastfiles().newFile(b->fileName());
274 WorkArea & BufferView::Pimpl::workarea() const
276 return *workarea_.get();
280 LyXScreen & BufferView::Pimpl::screen() const
282 return *screen_.get();
286 Painter & BufferView::Pimpl::painter() const
288 return workarea().getPainter();
292 void BufferView::Pimpl::top_y(int y)
298 int BufferView::Pimpl::top_y() const
304 void BufferView::Pimpl::setBuffer(Buffer * b)
306 lyxerr[Debug::INFO] << "Setting buffer in BufferView ("
311 // set current buffer
316 cursor_ = LCursor(*bv_);
318 // if we're quitting lyx, don't bother updating stuff
323 lyxerr[Debug::INFO] << "Buffer addr: " << buffer_ << endl;
324 connectBuffer(*buffer_);
326 cursor_.push(buffer_->inset());
327 cursor_.resetAnchor();
328 buffer_->text().init(bv_);
330 // If we don't have a text object for this, we make one
331 //if (bv_->text() == 0)
332 // resizeCurrentBuffer();
334 // Buffer-dependent dialogs should be updated or
335 // hidden. This should go here because some dialogs (eg ToC)
336 // require bv_->text.
337 owner_->getDialogs().updateBufferDependent(true);
338 owner_->setLayout(bv_->text()->getPar(0).layout()->name());
340 lyxerr[Debug::INFO] << " No Buffer!" << endl;
341 // we are closing the buffer, use the first buffer as current
342 buffer_ = bufferlist.first();
343 owner_->getDialogs().hideBufferDependent();
348 owner_->updateMenubar();
349 owner_->updateToolbar();
350 owner_->updateLayoutChoice();
351 owner_->updateWindowTitle();
353 if (lyx::graphics::Previews::activated() && buffer_)
354 lyx::graphics::Previews::get().generateBufferPreviews(*buffer_);
358 bool BufferView::Pimpl::fitCursor()
360 if (!screen().fitCursor(bv_))
367 void BufferView::Pimpl::redoCurrentBuffer()
369 lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl;
370 if (buffer_ && bv_->text()) {
371 resizeCurrentBuffer();
373 owner_->updateLayoutChoice();
378 void BufferView::Pimpl::resizeCurrentBuffer()
380 lyxerr[Debug::INFO] << "resizeCurrentBuffer" << endl;
382 owner_->message(_("Formatting document..."));
384 LyXText * text = bv_->text();
390 bv_->cursor().updatePos();
396 // reset the "Formatting..." message
397 owner_->clearMessage();
403 void BufferView::Pimpl::updateScrollbar()
406 lyxerr[Debug::GUI] << "no text in updateScrollbar" << endl;
407 lyxerr << "no text in updateScrollbar" << endl;
408 workarea().setScrollbarParams(0, 0, 0);
412 LyXText const & t = *bv_->text();
415 << "Updating scrollbar: height: " << t.height()
416 << " top_y: " << top_y()
417 << " default height " << defaultRowHeight() << endl;
419 workarea().setScrollbarParams(t.height(), top_y(), defaultRowHeight());
423 void BufferView::Pimpl::scrollDocView(int value)
425 lyxerr[Debug::GUI] << "scrollDocView of " << value << endl;
430 screen().hideCursor();
433 screen().redraw(*bv_);
435 if (!lyxrc.cursor_follows_scrollbar)
438 int const height = defaultRowHeight();
439 int const first = top_y() + height;
440 int const last = top_y() + workarea().workHeight() - height;
442 bv_->cursor().reset(bv_->buffer()->inset());
443 LyXText * text = bv_->text();
444 int y = text->cursorY(bv_->cursor().front());
449 text->setCursorFromCoordinates(bv_->cursor(), 0, y);
451 owner_->updateLayoutChoice();
455 void BufferView::Pimpl::scroll(int lines)
460 LyXText const * t = bv_->text();
461 int const line_height = defaultRowHeight();
463 // The new absolute coordinate
464 int new_top_y = top_y() + lines * line_height;
466 // Restrict to a valid value
467 new_top_y = std::min(t->height() - 4 * line_height, new_top_y);
468 new_top_y = std::max(0, new_top_y);
470 scrollDocView(new_top_y);
472 // Update the scrollbar.
473 workarea().setScrollbarParams(t->height(), top_y(), defaultRowHeight());
477 void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
478 key_modifier::state state)
480 bv_->owner()->getLyXFunc().processKeySym(key, state);
482 /* This is perhaps a bit of a hack. When we move
483 * around, or type, it's nice to be able to see
484 * the cursor immediately after the keypress. So
485 * we reset the toggle timeout and force the visibility
486 * of the cursor. Note we cannot do this inside
487 * dispatch() itself, because that's called recursively.
490 cursor_timeout.restart();
491 screen().showCursor(*bv_);
496 void BufferView::Pimpl::selectionRequested()
503 LCursor & cur = bv_->cursor();
505 if (!cur.selection()) {
506 xsel_cache_.set = false;
510 if (!xsel_cache_.set ||
511 cur.back() != xsel_cache_.cursor ||
512 cur.anchor_.back() != xsel_cache_.anchor)
514 xsel_cache_.cursor = cur.back();
515 xsel_cache_.anchor = cur.anchor_.back();
516 xsel_cache_.set = cur.selection();
517 sel = cur.selectionAsString(false);
519 workarea().putClipboard(sel);
524 void BufferView::Pimpl::selectionLost()
527 screen().hideCursor();
528 bv_->cursor().clearSelection();
529 xsel_cache_.set = false;
534 void BufferView::Pimpl::workAreaResize()
536 static int work_area_width;
537 static int work_area_height;
539 bool const widthChange = workarea().workWidth() != work_area_width;
540 bool const heightChange = workarea().workHeight() != work_area_height;
542 // update from work area
543 work_area_width = workarea().workWidth();
544 work_area_height = workarea().workHeight();
546 if (buffer_ && widthChange) {
547 // The visible LyXView need a resize
548 resizeCurrentBuffer();
551 if (widthChange || heightChange)
554 // always make sure that the scrollbar is sane.
556 owner_->updateLayoutChoice();
560 void BufferView::Pimpl::update()
562 //lyxerr << "BufferView::Pimpl::update(), buffer: " << buffer_ << endl;
563 // fix cursor coordinate cache in case something went wrong
565 // check needed to survive LyX startup
567 // update all 'visible' paragraphs
568 lyx::par_type beg, end;
569 getParsInRange(buffer_->paragraphs(),
570 top_y(), top_y() + workarea().workHeight(),
572 bv_->text()->redoParagraphs(beg, end);
575 screen().redraw(*bv_);
576 bv_->owner()->view_state_changed();
580 // Callback for cursor timer
581 void BufferView::Pimpl::cursorToggle()
584 screen().toggleCursor(*bv_);
586 // Use this opportunity to deal with any child processes that
587 // have finished but are waiting to communicate this fact
588 // to the rest of LyX.
589 ForkedcallsController & fcc = ForkedcallsController::get();
590 if (fcc.processesCompleted())
591 fcc.handleCompletedProcesses();
594 cursor_timeout.restart();
598 bool BufferView::Pimpl::available() const
600 return buffer_ && bv_->text();
604 Change const BufferView::Pimpl::getCurrentChange()
606 if (!bv_->buffer()->params().tracking_changes)
607 return Change(Change::UNCHANGED);
609 LyXText * text = bv_->getLyXText();
610 LCursor & cur = bv_->cursor();
612 if (!cur.selection())
613 return Change(Change::UNCHANGED);
615 return text->getPar(cur.selBegin().par()).
616 lookupChangeFull(cur.selBegin().pos());
620 void BufferView::Pimpl::savePosition(unsigned int i)
622 if (i >= saved_positions_num)
624 BOOST_ASSERT(bv_->cursor().inTexted());
625 saved_positions[i] = Position(buffer_->fileName(),
626 bv_->cursor().paragraph().id(),
627 bv_->cursor().pos());
629 owner_->message(bformat(_("Saved bookmark %1$s"), tostr(i)));
633 void BufferView::Pimpl::restorePosition(unsigned int i)
635 if (i >= saved_positions_num)
638 string const fname = saved_positions[i].filename;
640 bv_->cursor().clearSelection();
642 if (fname != buffer_->fileName()) {
644 if (bufferlist.exists(fname))
645 b = bufferlist.getBuffer(fname);
647 b = bufferlist.newBuffer(fname);
648 ::loadLyXFile(b, fname); // don't ask, just load it
654 ParIterator par = buffer_->getParFromID(saved_positions[i].par_id);
655 if (par == buffer_->par_iterator_end())
658 bv_->text()->setCursor(bv_->cursor(), par.pit(),
659 min(par->size(), saved_positions[i].par_pos));
662 owner_->message(bformat(_("Moved to bookmark %1$s"), tostr(i)));
666 bool BufferView::Pimpl::isSavedPosition(unsigned int i)
668 return i < saved_positions_num && !saved_positions[i].filename.empty();
672 void BufferView::Pimpl::switchKeyMap()
674 if (!lyxrc.rtl_support)
677 Intl & intl = owner_->getIntl();
678 if (bv_->getLyXText()->real_current_font.isRightToLeft()) {
679 if (intl.keymap == Intl::PRIMARY)
682 if (intl.keymap == Intl::SECONDARY)
688 void BufferView::Pimpl::center()
690 LyXText * text = bv_->text();
692 bv_->cursor().clearSelection();
693 int const half_height = workarea().workHeight() / 2;
694 int new_y = text->cursorY(bv_->cursor().front()) - half_height;
698 // FIXME: look at this comment again ...
699 // This updates top_y() but means the fitCursor() call
700 // from the update(FITCUR) doesn't realise that we might
701 // have moved (e.g. from GOTOPARAGRAPH), so doesn't cause
702 // the scrollbar to be updated as it should, so we have
703 // to do it manually. Any operation that does a center()
704 // and also might have moved top_y() must make sure to call
705 // updateScrollbar() currently. Never mind that this is a
706 // pretty obfuscated way of updating text->top_y()
711 void BufferView::Pimpl::stuffClipboard(string const & stuff) const
713 workarea().putClipboard(stuff);
717 InsetBase * BufferView::Pimpl::getInsetByCode(InsetBase::Code /*code*/)
719 #warning Does not work for mathed
720 // Ok, this is a little bit too brute force but it
721 // should work for now. Better infrastructure is coming. (Lgb)
725 Buffer * buf = bv_->buffer();
726 InsetIterator beg = inset_iterator_begin(buf->inset());
728 bool cursor_par_seen = false;
730 LCursor & cur = bv_->cursor();
731 LyXText * = bv_->getLyXText();
732 ParagraphList::iterator pit = text->getPar(cur.par());
735 if (beg.par() == pit)
736 cursor_par_seen = true;
737 if (cursor_par_seen) {
738 if (beg.par() == pit && beg.pos() >= cur.pos())
740 if (beg.getPar() != pit)
745 // Now find the first inset that matches code.
747 if (beg->lyxCode() == code)
756 void BufferView::Pimpl::MenuInsertLyXFile(string const & filenm)
758 string filename = filenm;
760 if (filename.empty()) {
761 // Launch a file browser
762 string initpath = lyxrc.document_path;
765 string const trypath = owner_->buffer()->filePath();
766 // If directory is writeable, use this as default.
767 if (IsDirWriteable(trypath))
771 FileDialog fileDlg(_("Select LyX document to insert"),
773 make_pair(string(_("Documents|#o#O")),
774 string(lyxrc.document_path)),
775 make_pair(string(_("Examples|#E#e")),
776 string(AddPath(system_lyxdir(), "examples"))));
778 FileDialog::Result result =
779 fileDlg.open(initpath,
780 FileFilterList(_("LyX Documents (*.lyx)")),
783 if (result.first == FileDialog::Later)
786 filename = result.second;
788 // check selected filename
789 if (filename.empty()) {
790 owner_->message(_("Canceled."));
795 // get absolute path of file and add ".lyx" to the filename if
797 filename = FileSearch(string(), filename, "lyx");
799 string const disp_fn = MakeDisplayPath(filename);
800 owner_->message(bformat(_("Inserting document %1$s..."), disp_fn));
801 if (bv_->insertLyXFile(filename))
802 owner_->message(bformat(_("Document %1$s inserted."),
805 owner_->message(bformat(_("Could not insert document %1$s"),
810 void BufferView::Pimpl::trackChanges()
812 Buffer * buf = bv_->buffer();
813 bool const tracking = buf->params().tracking_changes;
816 ParIterator const end = buf->par_iterator_end();
817 for (ParIterator it = buf->par_iterator_begin(); it != end; ++it)
819 buf->params().tracking_changes = true;
821 // we cannot allow undos beyond the freeze point
822 buf->undostack().clear();
825 bv_->text()->setCursor(bv_->cursor(), 0, 0);
826 #warning changes FIXME
827 bool found = lyx::find::findNextChange(bv_);
829 owner_->getDialogs().show("changes");
833 ParIterator const end = buf->par_iterator_end();
834 for (ParIterator it = buf->par_iterator_begin(); it != end; ++it)
835 it->untrackChanges();
836 buf->params().tracking_changes = false;
839 buf->redostack().clear();
843 bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
845 // this is only called for mouse related events including
846 // LFUN_FILE_OPEN generated by drag-and-drop.
847 FuncRequest cmd = cmd0;
850 if (cmd.action == LFUN_FILE_OPEN) {
851 owner_->dispatch(cmd);
855 cmd.y += bv_->top_y();
856 //lyxerr << "*** workAreaDispatch: request: " << cmd << std::endl;
858 cur.push(bv_->buffer()->inset());
860 cur.selection() = bv_->cursor().selection();
862 // Doesn't go through lyxfunc, so we need to update
863 // the layout choice etc. ourselves
865 // e.g. Qt mouse press when no buffer
869 screen().hideCursor();
871 // either the inset under the cursor or the
872 // surrounding LyXText will handle this event.
874 // built temporary path to inset
875 InsetBase * inset = bv_->text()->editXY(cur, cmd.x, cmd.y);
876 lyxerr << "hit inset at tip: " << inset << endl;
877 lyxerr << "created temp cursor:\n" << cur << endl;
879 // Try to dispatch to an non-editable inset near this position
880 // via the temp cursor. If the inset wishes to change the real
881 // cursor it has to do so explicitly by using
882 // cur.bv().cursor() = cur; (or similar)'
885 inset->dispatch(cur, cmd);
887 // Now dispatch to the real cursor. Any change to the cursor
889 if (!res.dispatched())
890 res = cur.dispatch(cmd);
892 // If the request was dispatched the temp cursor should have been
893 // in a way to be used as new 'real' cursor.
894 if (res.dispatched())
897 // Redraw if requested or necessary.
903 // see workAreaKeyPress
904 cursor_timeout.restart();
905 screen().showCursor(*bv_);
907 // skip these when selecting
908 if (cmd.action != LFUN_MOUSE_MOTION) {
909 owner_->updateLayoutChoice();
910 owner_->updateToolbar();
913 // slight hack: this is only called currently when we
914 // clicked somewhere, so we force through the display
915 // of the new status here.
916 owner_->clearMessage();
921 bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
923 //lyxerr << "BufferView::Pimpl::dispatch cmd: " << cmd << std::endl;
924 // Make sure that the cached BufferView is correct.
925 lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
926 << " action[" << cmd.action << ']'
927 << " arg[" << cmd.argument << ']'
928 << " x[" << cmd.x << ']'
929 << " y[" << cmd.y << ']'
930 << " button[" << cmd.button() << ']'
933 LCursor & cur = bv_->cursor();
935 switch (cmd.action) {
939 cur.message(_("Undo"));
940 cur.clearSelection();
942 cur.message(_("No further undo information"));
950 cur.message(_("Redo"));
951 cur.clearSelection();
953 cur.message(_("No further redo information"));
959 case LFUN_FILE_INSERT:
960 MenuInsertLyXFile(cmd.argument);
963 case LFUN_FILE_INSERT_ASCII_PARA:
964 InsertAsciiFile(bv_, cmd.argument, true);
967 case LFUN_FILE_INSERT_ASCII:
968 InsertAsciiFile(bv_, cmd.argument, false);
971 case LFUN_FONT_STATE:
972 cur.message(cur.currentState());
975 case LFUN_INSERT_LABEL: {
976 // Try and generate a valid label
977 string const contents = cmd.argument.empty() ?
978 cur.getPossibleLabel() : cmd.argument;
979 InsetCommandParams icp("label", contents);
980 string data = InsetCommandMailer::params2string("label", icp);
981 owner_->getDialogs().show("label", data, 0);
985 case LFUN_BOOKMARK_SAVE:
986 savePosition(strToUnsignedInt(cmd.argument));
989 case LFUN_BOOKMARK_GOTO:
990 restorePosition(strToUnsignedInt(cmd.argument));
993 case LFUN_REF_GOTO: {
994 string label = cmd.argument;
997 static_cast<InsetRef*>(getInsetByCode(InsetBase::REF_CODE));
999 label = inset->getContents();
1005 bv_->gotoLabel(label);
1009 case LFUN_TRACK_CHANGES:
1013 case LFUN_MERGE_CHANGES:
1014 owner_->getDialogs().show("changes");
1017 case LFUN_ACCEPT_ALL_CHANGES: {
1018 bv_->cursor().reset(bv_->buffer()->inset());
1019 #warning FIXME changes
1020 while (lyx::find::findNextChange(bv_))
1021 bv_->getLyXText()->acceptChange(bv_->cursor());
1026 case LFUN_REJECT_ALL_CHANGES: {
1027 bv_->cursor().reset(bv_->buffer()->inset());
1028 #warning FIXME changes
1029 while (lyx::find::findNextChange(bv_))
1030 bv_->getLyXText()->rejectChange(bv_->cursor());
1035 case LFUN_WORD_FIND:
1036 lyx::find::find(bv_, cmd);
1039 case LFUN_WORD_REPLACE:
1040 lyx::find::replace(bv_, cmd);
1044 cur.clearSelection();
1047 cur.message(N_("Mark off"));
1051 cur.clearSelection();
1055 cur.message(N_("Mark on"));
1059 cur.clearSelection();
1062 cur.message(N_("Mark removed"));
1065 cur.message(N_("Mark set"));
1071 case LFUN_UNKNOWN_ACTION:
1072 cur.errorMessage(N_("Unknown function!"));
1079 case LFUN_BEGINNINGBUFSEL:
1080 bv_->cursor().reset(bv_->buffer()->inset());
1081 if (!cur.selection())
1083 bv_->text()->cursorTop(cur);
1087 case LFUN_ENDBUFSEL:
1088 bv_->cursor().reset(bv_->buffer()->inset());
1089 if (!cur.selection())
1091 bv_->text()->cursorBottom(cur);