Bug: 1074

Fix some insertion of empty insets stuff.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6847 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-04-24 20:02:49 +00:00
parent 2dc2d989a9
commit 265327763d
10 changed files with 46 additions and 9 deletions

View File

@ -1,3 +1,15 @@
2003-04-24 Lars Gullik Bjønnes <larsbj@gullik.net>
* insetexternal.C (string2params): dont do anything if the string
is empty.
* insetgraphics.C (string2params): ditto
* insetcommand.C (string2params): ditto
* insetert.C (string2params): ditto
* insetfloat.C (string2params): ditto
* insetinclude.C (string2params): ditto
* insetminipage.C (string2params): ditto
* insettabular.C (string2params): ditto
* insetwrap.C (string2params): ditto
2003-04-24 André Pönitz <poenitz@gmx.net>

View File

@ -121,6 +121,9 @@ void InsetCommandMailer::string2params(string const & in,
params.setContents(string());
params.setOptions(string());
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);

View File

@ -382,6 +382,9 @@ void InsetExternalMailer::string2params(string const & in,
{
params = InsetExternal::Params();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);
@ -403,7 +406,7 @@ void InsetExternalMailer::string2params(string const & in,
}
if (lex.isOK()) {
InsetExternal inset;
InsetExternal inset;
inset.read(0, lex);
params = inset.params();
}

View File

@ -401,6 +401,9 @@ void InsetFloatMailer::string2params(string const & in,
{
params = InsetFloatParams();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);

View File

@ -896,6 +896,9 @@ void InsetGraphicsMailer::string2params(string const & in,
{
params = InsetGraphicsParams();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);
@ -908,7 +911,7 @@ void InsetGraphicsMailer::string2params(string const & in,
}
if (lex.isOK()) {
InsetGraphics inset;
InsetGraphics inset;
inset.readInsetGraphics(lex);
params = inset.params();
}

View File

@ -35,7 +35,7 @@ public:
///
~InsetGraphics();
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
int ascent(BufferView *, LyXFont const &) const;
///

View File

@ -177,7 +177,7 @@ void InsetInclude::set(Params const & p)
params_ = p;
string command;
switch (params_.flag) {
case INCLUDE:
command="include";
@ -192,9 +192,9 @@ void InsetInclude::set(Params const & p)
command="verbatiminput*";
break;
}
params_.cparams.setCmdName(command);
params_.cparams.setCmdName(command);
if (preview_->monitoring())
preview_->stopMonitoring();
@ -306,7 +306,7 @@ bool InsetInclude::loadIfNeeded() const
if (!finfo.isOK())
return false;
return bufferlist.loadLyXFile(getFileName(), false) != 0;
return bufferlist.loadLyXFile(getFileName(), false) != 0;
}
@ -641,6 +641,9 @@ void InsetIncludeMailer::string2params(string const & in,
{
params = InsetInclude::Params();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);
@ -662,7 +665,7 @@ void InsetIncludeMailer::string2params(string const & in,
}
if (lex.isOK()) {
InsetInclude inset(params);
InsetInclude inset(params);
inset.read(0, lex);
params = inset.params();
}

View File

@ -375,6 +375,9 @@ void InsetMinipageMailer::string2params(string const & in,
{
params = InsetMinipage::Params();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);

View File

@ -2927,6 +2927,10 @@ int InsetTabularMailer::string2params(string const & in, InsetTabular & inset)
LyXLex lex(0,0);
lex.setStream(data);
#warning CHECK verify that this is a sane value to return.
if (in.empty())
return -1;
if (lex.isOK()) {
lex.next();
string const token = lex.getString();

View File

@ -301,6 +301,9 @@ void InsetWrapMailer::string2params(string const & in,
{
params = InsetWrapParams();
if (in.empty())
return;
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);