Author: tommaso
Date: Thu Jan 27 01:43:25 2011
New Revision: 37336
URL: http://www.lyx.org/trac/changeset/37336
Log:
Completing r37335 (apologies).
Modified:
lyx-devel/trunk/src/Cursor.cpp
lyx-devel/trunk/src/Cursor.h
Modified: lyx-devel/trunk/src/Cursor.cpp
==============================================================================
--- lyx-devel/trunk/src/Cursor.cpp Thu Jan 27 00:54:12 2011 (r37335)
+++ lyx-devel/trunk/src/Cursor.cpp Thu Jan 27 01:43:25 2011 (r37336)
@@ -1337,14 +1337,17 @@
}
-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();
+ }
}
Modified: lyx-devel/trunk/src/Cursor.h
==============================================================================
--- lyx-devel/trunk/src/Cursor.h Thu Jan 27 00:54:12 2011 (r37335)
+++ lyx-devel/trunk/src/Cursor.h Thu Jan 27 01:43:25 2011 (r37336)
@@ -396,8 +396,8 @@
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