From 917785df7132ec51d5df6fe2b7dbb434ecda311e Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Thu, 27 Jan 2011 00:43:25 +0000 Subject: [PATCH] Completing r37335 (apologies). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37336 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 9 ++++++--- src/Cursor.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 075577c783..c641172640 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1337,14 +1337,17 @@ void Cursor::insert(Inset * inset0) } -void Cursor::niceInsert(docstring const & t, Parse::flags f, bool enter) +int Cursor::niceInsert(docstring const & t, Parse::flags f, bool enter) { MathData ar(buffer()); asArray(t, ar, f); - if (ar.size() == 1 && (enter || selection())) + if (ar.size() == 1 && (enter || selection())) { niceInsert(ar[0]); - else + return 1; + } else { insert(ar); + return ar.size(); + } } diff --git a/src/Cursor.h b/src/Cursor.h index 3cfdd009fe..979ffb5c95 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -396,8 +396,8 @@ public: void plainInsert(MathAtom const & at); /// void niceInsert(MathAtom const & at); - /// - void niceInsert(docstring const & str, Parse::flags f = Parse::NORMAL, + /// return the number of inserted array items + int niceInsert(docstring const & str, Parse::flags f = Parse::NORMAL, bool enter = true); /// in pixels from top of screen -- 2.39.5