]> git.lyx.org Git - lyx.git/commitdiff
Completing r37335 (apologies).
authorTommaso Cucinotta <tommaso@lyx.org>
Thu, 27 Jan 2011 00:43:25 +0000 (00:43 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Thu, 27 Jan 2011 00:43:25 +0000 (00:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37336 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp
src/Cursor.h

index 075577c783cc69eb792c66ea59ea15ef3c84c12d..c641172640d487787cb039e1f573d8cf4e2a0268 100644 (file)
@@ -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();
+       }
 }
 
 
index 3cfdd009fe8c54ce6ce34d36afdd04d34b7ba1b5..979ffb5c95bb793d0cd797faaa7515691cd62f56 100644 (file)
@@ -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