]> 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 8cc205223393e907077306823e262554f24c6cc9..b2b15f0ad3888187625553bfe6210a58cf94b791 100644 (file)
@@ -79,6 +79,7 @@ void InsetGraphicsParams::init()
        rotateAngle = "0";              // angle of rotation in degrees
        rotateOrigin.erase();           // Origin of rotation
        special.erase();                // additional userdefined stuff
+       groupId.clear();
 }
 
 
@@ -101,6 +102,7 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
        rotateAngle = igp.rotateAngle;
        rotateOrigin = igp.rotateOrigin;
        special = igp.special;
+       groupId = igp.groupId;
 }
 
 
@@ -123,7 +125,8 @@ bool operator==(InsetGraphicsParams const & left,
 
            left.rotateAngle == right.rotateAngle &&
            left.rotateOrigin == right.rotateOrigin &&
-           left.special == right.special;
+           left.special == right.special &&
+           left.groupId == right.groupId;
 }
 
 
@@ -174,6 +177,8 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
                os << "\trotateOrigin " << rotateOrigin << '\n';
        if (!special.empty())
                os << "\tspecial " << special << '\n';
+       if (!groupId.empty())
+               os << "\tgroupId "<< groupId << '\n';
 }
 
 
@@ -182,11 +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 == "embed") {
-               lex.next();
-               string const name = lex.getString();
-               filename.setInzipName(name);
-               filename.setEmbed(!name.empty());
        } else if (token == "lyxscale") {
                lex.next();
                lyxscale = lex.getInteger();
@@ -232,6 +232,9 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
        } 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
@@ -251,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);