From 2d85046fd704376ab2c3a592d86f506a606cbafa Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 20 Feb 2007 20:48:23 +0000 Subject: [PATCH] Fix crash after inset-insert ert, from Bernhard Roider Extend this to some other cases by me. * src/insets/insetert.C (void InsetERTMailer::string2params): Test for lex.isOK rather than lex, since the latter is also true if there was nothing to read. * src/insets/insetvspace.C (InsetVSpace::read): ditto (InsetVSpaceMailer::string2params): ditto * src/insets/insetnote.C (InsetNoteParams::read): ditto git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17284 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insetert.C | 2 +- src/insets/insetnote.C | 2 +- src/insets/insetvspace.C | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/insets/insetert.C b/src/insets/insetert.C index cb62a2579b..091a2427f1 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -466,7 +466,7 @@ void InsetERTMailer::string2params(string const & in, int s; lex >> s; - if (lex) + if (lex.isOK()) status = static_cast(s); } diff --git a/src/insets/insetnote.C b/src/insets/insetnote.C index d0b9365c67..2e3bfd0460 100644 --- a/src/insets/insetnote.C +++ b/src/insets/insetnote.C @@ -105,7 +105,7 @@ void InsetNoteParams::read(LyXLex & lex) { string label; lex >> label; - if (lex) + if (lex.isOK()) type = notetranslator().find(label); } diff --git a/src/insets/insetvspace.C b/src/insets/insetvspace.C index 454ba829ba..58b49a33f4 100644 --- a/src/insets/insetvspace.C +++ b/src/insets/insetvspace.C @@ -88,7 +88,7 @@ void InsetVSpace::read(Buffer const &, LyXLex & lex) BOOST_ASSERT(lex.isOK()); string vsp; lex >> vsp; - if (lex) + if (lex.isOK()) space_ = VSpace(vsp); string end_token; @@ -257,7 +257,7 @@ void InsetVSpaceMailer::string2params(string const & in, VSpace & vspace) string vsp; lex >> vsp; - if (lex) + if (lex.isOK()) vspace = VSpace(vsp); }