Fix bug #6160 and #6182: Assertion when viewing master document.

Set Buffer to Insets when reading a document. InsetSpecialChar and InsetLine are the only Insets that are instantiated in readParToken.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31238 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-08-29 23:14:38 +00:00
parent d6f7945761
commit f733221747

View File

@ -397,8 +397,8 @@ void Text::readParToken(Paragraph & par, Lexer & lex,
auto_ptr<Inset> inset;
inset.reset(new InsetSpecialChar);
inset->read(lex);
par.insertInset(par.size(), inset.release(),
font, change);
inset->setBuffer(const_cast<Buffer &>(buf));
par.insertInset(par.size(), inset.release(), font, change);
} else if (token == "\\backslash") {
par.appendChar('\\', font, change);
} else if (token == "\\LyXTable") {
@ -406,7 +406,10 @@ void Text::readParToken(Paragraph & par, Lexer & lex,
inset->read(lex);
par.insertInset(par.size(), inset.release(), font, change);
} else if (token == "\\lyxline") {
par.insertInset(par.size(), new InsetLine, font, change);
auto_ptr<Inset> inset;
inset.reset(new InsetLine);
inset->setBuffer(const_cast<Buffer &>(buf));
par.insertInset(par.size(), inset.release(), font, change);
} else if (token == "\\change_unchanged") {
change = Change(Change::UNCHANGED);
} else if (token == "\\change_inserted" || token == "\\change_deleted") {