Fix bug #6014: Assertion when pasting "\def" into 2.0svn

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30870 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-08-06 09:53:06 +00:00
parent 3a8121ddee
commit d53c2ec215

View File

@ -670,8 +670,10 @@ void MathMacroTemplate::shiftArguments(size_t from, int by)
int MathMacroTemplate::maxArgumentInDefinition() const
{
// We don't have a buffer when pasting from the clipboard (bug 6014).
Buffer const * macro_buffer = this->isBufferValid() ? &buffer() : 0;
int maxArg = 0;
DocIterator it = doc_iterator_begin(&buffer(), this);
DocIterator it = doc_iterator_begin(macro_buffer, this);
it.idx() = defIdx();
for (; it; it.forwardChar()) {
if (!it.nextInset())