]> git.lyx.org Git - features.git/commitdiff
Bug: 1074
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 24 Apr 2003 20:02:49 +0000 (20:02 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 24 Apr 2003 20:02:49 +0000 (20:02 +0000)
Fix some insertion of empty insets stuff.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6847 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcommand.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insetinclude.C
src/insets/insetminipage.C
src/insets/insettabular.C
src/insets/insetwrap.C

index 39e07ca3716c8cce6bd3e46496738d163f4bf119..24d2d9fa5eb7357d0481069947f8e7fb27dd5136 100644 (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>
 
index a92eb06e6d644a2ce184979393ee28579372cc11..debea3f0a4faa0511eb9a31b57135a0860852361 100644 (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);
index 54107b1501a97e43b01f4fb58020fa702040f45a..82db5c2ce48a71551e866c7e7ea46cec9fc26b5c 100644 (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();
        }
index 841b41943a63ad75c57e66e4a4a184e103666706..4b4e8202ba035d36a03a4ed10ad42430b445e557 100644 (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);
index 0f4d367bb08dc69506ded844fd113237a1dca724..4582781cfe1a804dd870a5638d5b7083ae9b5620 100644 (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();
        }
index 03a1884bccec79bcca40f013cb34ef9a565a1c7f..868f6d623e4451da847a42eb7e44196443fc1dac 100644 (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;
        ///
index a69245f07deb8f642ffb3c8ac135c3df6e9672fe..90ed386307fe34a2871ed650d723084021360a02 100644 (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();
        }
index 892473647d078755fb0f72166d36c5851f6c2763..a5046430b6d360260d1011c3f4941be7ac362cb9 100644 (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);
index 3c41f351873472b76f9a6a2a018c7ff585d243a8..f4a46d717781d104579d78dcdb010b5e4cfde21b 100644 (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();
index 5fd53c41d628bc29a6e8db19a8152e837fb06f05..11c3417182ae9d14bfd15df9541182c712d157b9 100644 (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);