]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphicsParams.C
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetgraphicsParams.C
index af7cba0a1e3e72cfdfd725de20ce0b62c9b69ee4..1b8963802b99885e520ed91a2da988e00bcd9975 100644 (file)
 #include "lyxrc.h"
 #include "debug.h"
 #include "lyxlex.h"
+#include "frontends/lyx_gui.h"
 
 using std::ostream;
 
+
 InsetGraphicsParams::InsetGraphicsParams()
 {
        init();
 }
 
+
 InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
 {
        // I decided to skip the initialization since the copy will overwrite
@@ -40,6 +43,7 @@ InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
        copy(igp);
 }
 
+
 InsetGraphicsParams &
 InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
 {
@@ -50,6 +54,7 @@ InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
        return *this;
 }
 
+
 void InsetGraphicsParams::init()
 {
        filename.erase();
@@ -72,6 +77,7 @@ void InsetGraphicsParams::init()
        special.erase();                // additional userdefined stuff
 }
 
+
 void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
 {
        filename = igp.filename;
@@ -94,6 +100,7 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
        special = igp.special;
 }
 
+
 bool operator==(InsetGraphicsParams const & left,
                InsetGraphicsParams const & right)
 {
@@ -122,12 +129,14 @@ bool operator==(InsetGraphicsParams const & left,
        return false;
 }
 
+
 bool operator!=(InsetGraphicsParams const & left,
                InsetGraphicsParams const & right)
 {
        return  !(left == right);
 }
 
+
 void InsetGraphicsParams::Write(ostream & os) const
 {
        // Do not write the default values
@@ -222,8 +231,10 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
        } else if (token == "subcaption") {
                subcaption = true;
        } else if (token == "subcaptionText") {
-               lex.next();
-               subcaptionText = lex.getString();
+               lex.eatLine();
+               string sub = lex.getString();
+               // strip surrounding " "
+               subcaptionText = sub.substr(1, sub.length() - 2);
        } else if (token == "special") {
                lex.eatLine();
                special = lex.getString();
@@ -304,7 +315,7 @@ grfx::Params InsetGraphicsParams::as_grfxParams(string const & filepath) const
        }
 
        // Override the above if we're not using a gui
-       if (!lyxrc.use_gui) {
+       if (!lyx_gui::use_gui) {
                pars.display = grfx::NoDisplay;
        }