]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphicsParams.cpp
Change inset label from ": filename" to "Program Listing: filename" for listings...
[lyx.git] / src / insets / InsetGraphicsParams.cpp
index c7419b39eaeae8f77d04c0c342c8feadab7e013c..b2b15f0ad3888187625553bfe6210a58cf94b791 100644 (file)
@@ -78,9 +78,8 @@ void InsetGraphicsParams::init()
 
        rotateAngle = "0";              // angle of rotation in degrees
        rotateOrigin.erase();           // Origin of rotation
-       subcaption = false;             // subfigure
-       subcaptionText.erase();         // subfigure caption
        special.erase();                // additional userdefined stuff
+       groupId.clear();
 }
 
 
@@ -102,9 +101,8 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
 
        rotateAngle = igp.rotateAngle;
        rotateOrigin = igp.rotateOrigin;
-       subcaption = igp.subcaption;
-       subcaptionText = igp.subcaptionText;
        special = igp.special;
+       groupId = igp.groupId;
 }
 
 
@@ -127,9 +125,8 @@ bool operator==(InsetGraphicsParams const & left,
 
            left.rotateAngle == right.rotateAngle &&
            left.rotateOrigin == right.rotateOrigin &&
-           left.subcaption == right.subcaption &&
-           left.subcaptionText == right.subcaptionText &&
-           left.special == right.special;
+           left.special == right.special &&
+           left.groupId == right.groupId;
 }
 
 
@@ -143,10 +140,8 @@ bool operator!=(InsetGraphicsParams const & left,
 void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
 {
        // Do not write the default values
-       if (!filename.empty()) {
+       if (!filename.empty())
                os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n';
-               os << "\tembed " << (filename.embedded() ? filename.inzipName() : "\"\"") << '\n';
-       }
        if (lyxscale != 100)
                os << "\tlyxscale " << lyxscale << '\n';
        if (display != graphics::DefaultDisplay)
@@ -180,12 +175,10 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
                os << "\trotateAngle " << rotateAngle << '\n';
        if (!rotateOrigin.empty())
                os << "\trotateOrigin " << rotateOrigin << '\n';
-       if (subcaption)
-               os << "\tsubcaption\n";
-       if (!subcaptionText.empty())
-               os << "\tsubcaptionText \"" << subcaptionText << '\"' << '\n';
        if (!special.empty())
                os << "\tspecial " << special << '\n';
+       if (!groupId.empty())
+               os << "\tgroupId "<< groupId << '\n';
 }
 
 
@@ -194,16 +187,6 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
        if (token == "filename") {
                lex.eatLine();
                filename.set(lex.getString(), bufpath);
-       } else if (token == "inzipName") {
-               // this option is currently ignored because only files in
-               // or under current document path is embeddable, and their
-               // inzipName is automatically determined.
-               lex.eatLine();
-       } else if (token == "embed") {
-               lex.next();
-               string const name = lex.getString();
-               filename.setInzipName(name);
-               filename.setEmbed(!name.empty());
        } else if (token == "lyxscale") {
                lex.next();
                lyxscale = lex.getInteger();
@@ -246,16 +229,12 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
        } else if (token == "rotateOrigin") {
                lex.next();
                rotateOrigin=lex.getString();
-       } else if (token == "subcaption") {
-               subcaption = true;
-       } else if (token == "subcaptionText") {
-               lex.eatLine();
-               string sub = lex.getString();
-               // strip surrounding " "
-               subcaptionText = sub.substr(1, sub.length() - 2);
        } else if (token == "special") {
                lex.eatLine();
                special = lex.getString();
+       } else if (token == "groupId") {
+               lex.eatLine();
+               groupId = lex.getString();
 
        // catch and ignore following two old-format tokens and their arguments.
        // e.g. "size_kind scale" clashes with the setting of the
@@ -275,8 +254,7 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
 graphics::Params InsetGraphicsParams::as_grfxParams() const
 {
        graphics::Params pars;
-       pars.filename = filename.availableFile();
-       pars.icon = filename.embedded() ? "pin.png" : "";
+       pars.filename = filename;
        pars.scale = lyxscale;
        pars.angle = convert<double>(rotateAngle);