X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView_pimpl.C;h=4890ac972e91bbf4aa2a8a6715b722d3bd5d5023;hb=77639efa94ce5c071cf47bfd3ba0026f157a1e6a;hp=ca9cea4c94725b671f7f9ec377d268dcf6baa5eb;hpb=3de10d0174eb3859b0080026fbf39e9467da8b26;p=lyx.git diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index ca9cea4c94..4890ac972e 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -80,14 +80,15 @@ extern int bibitemMaxWidth(BufferView *, LyXFont const &); const unsigned int saved_positions_num = 20; -static inline +namespace { + +inline void waitForX() { XSync(fl_get_display(), 0); } -static void SetXtermCursor(Window win) { static Cursor cursor; @@ -101,6 +102,8 @@ void SetXtermCursor(Window win) XFlush(fl_get_display()); } +} // anon namespace + BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o, int xpos, int ypos, int width, int height) @@ -918,6 +921,8 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y, LyXCursor cursor; text->SetCursorFromCoordinates(bv_, cursor, x, y_tmp); + text->SetCursor(bv_, cursor, cursor.par(),cursor.pos(),true); + #ifndef NEW_INSETS if (cursor.pos() < cursor.par()->Last() @@ -940,7 +945,8 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y, if (x > start_x && x < end_x && y_tmp > cursor.y() - tmpinset->ascent(bv_, font) - && y_tmp < cursor.y() + tmpinset->descent(bv_, font)) { + && y_tmp < cursor.y() + tmpinset->descent(bv_, font)) + { text->SetCursor(bv_, cursor.par(),cursor.pos(),true); x = x - start_x; // The origin of an inset is on the baseline @@ -2925,13 +2931,14 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) if (!bv_->insertInset(inset, "Standard", true)) delete inset; } + break; case LFUN_CHILD_INSERT: { - InsetInclude::InsetIncludeParams p; + InsetInclude::Params p; p.cparams.setFromString(argument); - p.buffer = buffer_; + p.masterFilename_ = buffer_->fileName(); InsetInclude * inset = new InsetInclude(p); if (!bv_->insertInset(inset)) @@ -3042,7 +3049,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) } else { // if we don't have an argument there was something // strange going on so we just tell this to someone! - owner_->getLyXFunc()->setErrorMessage(N_("No argument givven")); + owner_->getLyXFunc()->setErrorMessage(N_("No argument given")); } break; }