]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Small fix.
[lyx.git] / src / buffer.C
index 3cfdc03ece4ccdd76b829f33d582063361770ba7..5a67d1e9bb1bd483ae0bcebcf984d96bc24177bb 100644 (file)
@@ -948,16 +948,17 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                        inset->Read(this, lex);
                        par->InsertInset(pos, inset, font);
                        ++pos;
-               } else if (tmptok == "GRAPHICS") {
+               } else if (tmptok == "Graphics") {
                        Inset * inset = new InsetGraphics;
-                               //inset->Read(this, lex);
+            inset->Read(this, lex);
                        par->InsertInset(pos, inset, font);
+            ++pos;
                } else if (tmptok == "LatexCommand") {
                        InsetCommand inscmd;
                        inscmd.Read(this, lex);
                        Inset * inset = 0;
                        if (inscmd.getCmdName() == "cite") {
-                               inset = new InsetCitation(inscmd.getContents(), inscmd.getOptions());
+                               inset = new InsetCitation(inscmd.params());
                        } else if (inscmd.getCmdName() == "bibitem") {
                                lex.printError("Wrong place for bibitem");
                                inset = inscmd.Clone();
@@ -971,7 +972,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                                inset = new InsetLabel(inscmd.getCommand());
                        } else if (inscmd.getCmdName() == "url"
                                   || inscmd.getCmdName() == "htmlurl") {
-                               inset = new InsetUrl(inscmd.getCommand());
+                               inset = new InsetUrl(inscmd.params());
                        } else if (inscmd.getCmdName() == "ref"
                                   || inscmd.getCmdName() == "pageref"
                                   || inscmd.getCmdName() == "vref"
@@ -1190,8 +1191,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
                inscmd.Read(this, lex);
                Inset * inset = 0;
                if (inscmd.getCmdName() == "cite") {
-                       inset = new InsetCitation(inscmd.getContents(),
-                                                 inscmd.getOptions());
+                       inset = new InsetCitation(inscmd.params());
                } else if (inscmd.getCmdName() == "bibitem") {
                        lex.printError("Wrong place for bibitem");
                        inset = inscmd.Clone();
@@ -1206,7 +1206,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
                        inset = new InsetLabel(inscmd.getCommand());
                } else if (inscmd.getCmdName() == "url"
                           || inscmd.getCmdName() == "htmlurl") {
-                       inset = new InsetUrl(inscmd.getCommand());
+                       inset = new InsetUrl(inscmd.params());
                } else if (inscmd.getCmdName() == "ref"
                           || inscmd.getCmdName() == "pageref"
                           || inscmd.getCmdName() == "vref"
@@ -3564,7 +3564,7 @@ int Buffer::runLiterate()
        users->owner()->getMiniBuffer()->Set(_("Running Literate..."));   
 
        // Remove all error insets
-       bool a = users->removeAutoInsets();
+       bool removedErrorInsets = users->removeAutoInsets();
 
        // generate the Literate file if necessary
        makeLaTeXFile(lit_name, org_path, false);
@@ -3597,7 +3597,7 @@ int Buffer::runLiterate()
 
        // if we removed error insets before we ran LaTeX or if we inserted
        // error insets after we ran LaTeX this must be run:
-        if (a || (res & Literate::ERRORS)){
+        if (removedErrorInsets || (res & Literate::ERRORS)){
                 users->redraw();
                 users->fitCursor();
                 //users->updateScrollbar();
@@ -3631,10 +3631,10 @@ int Buffer::buildProgram()
         users->owner()->getMiniBuffer()->Set(_("Building Program..."));   
  
         // Remove all error insets
-        bool a = users->removeAutoInsets();
+        bool removedErrorInsets = users->removeAutoInsets();
  
         // generate the LaTeX file if necessary
-        if (!isNwClean() || a) {
+        if (!isNwClean() || removedErrorInsets) {
                 makeLaTeXFile(lit_name, org_path, false);
                 markNwDirty();
         }
@@ -3668,7 +3668,7 @@ int Buffer::buildProgram()
         // if we removed error insets before we ran Literate/Build or
        // if we inserted error insets after we ran Literate/Build this
        // must be run:
-       if (a || (res & Literate::ERRORS)){
+       if (removedErrorInsets || (res & Literate::ERRORS)){
                users->redraw();
                users->fitCursor();
                //users->updateScrollbar();