From: Angus Leeming Date: Mon, 10 Mar 2003 03:11:54 +0000 (+0000) Subject: Cure warning message about a missing '\end_inset' when passing data between X-Git-Tag: 1.6.10~17305 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ce20b638ed067f7a3a167ec86d56afa4829ea78e;p=lyx.git Cure warning message about a missing '\end_inset' when passing data between the core and the dialogs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6409 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c817811036..10233ff6ee 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,15 @@ +2003-03-10 Angus Leeming + + * insetcommand.C (string2params): + * insetexternal.C (string2params): + * insetfloat.C (string2params): + * insetgraphics.C (string2params): + * insetinclude.C (string2params): + * insetminipage.C (string2params): + * insettabular.C (string2params): + * insetwrap.C (string2params): cure warning message about missing + '\end_inset'. + 2003-03-09 Angus Leeming * insettabular.[Ch]: define a new class InsetTabularMailer and use diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index 2759492a44..70676127b9 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -127,7 +127,17 @@ void InsetCommandMailer::string2params(string const & in, string const name = lex.getString(); } - params.read(lex); + // This is part of the inset proper that is usually swallowed + // by Buffer::readInset + if (lex.isOK()) { + lex.next(); + string const token = lex.getString(); + if (token != "LatexCommand") + return; + } + if (lex.isOK()) { + params.read(lex); + } } diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index c377a7780c..9b8ffe451c 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -401,9 +401,11 @@ void InsetExternalMailer::string2params(string const & in, return; } - InsetExternal inset; - inset.read(0, lex); - params = inset.params(); + if (lex.isOK()) { + InsetExternal inset; + inset.read(0, lex); + params = inset.params(); + } } diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 7565a0d526..27ae97c90c 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -440,7 +440,9 @@ void InsetFloatMailer::string2params(string const & in, return; } - params.read(lex); + if (lex.isOK()) { + params.read(lex); + } } diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index ab60e9ba70..c03c06a6ac 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -907,9 +907,11 @@ void InsetGraphicsMailer::string2params(string const & in, return; } - InsetGraphics inset; - inset.readInsetGraphics(lex); - params = inset.params(); + if (lex.isOK()) { + InsetGraphics inset; + inset.readInsetGraphics(lex); + params = inset.params(); + } } diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 2057a751f9..b03f939202 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -667,9 +667,11 @@ void InsetIncludeMailer::string2params(string const & in, return; } - InsetInclude inset(params); - inset.read(0, lex); - params = inset.params(); + if (lex.isOK()) { + InsetInclude inset(params); + inset.read(0, lex); + params = inset.params(); + } } diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index ba8327fe6d..7586407a7d 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -445,7 +445,9 @@ void InsetMinipageMailer::string2params(string const & in, return; } - params.read(lex); + if (lex.isOK()) { + params.read(lex); + } } diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index edfdcfad6e..e43c89c79b 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -3085,6 +3085,9 @@ int InsetTabularMailer::string2params(string const & in, InsetTabular & inset) return -1; } + if (!lex.isOK()) + return -1; + BufferView * const bv = inset.view(); Buffer const * const buffer = bv ? bv->buffer() : 0; if (buffer) diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 72e20512cf..3851bfcc32 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -355,7 +355,9 @@ void InsetWrapMailer::string2params(string const & in, return; } - params.read(lex); + if (lex.isOK()) { + params.read(lex); + } }