]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphicsParams.cpp
Merge branch 'master' into biblatex2
[lyx.git] / src / insets / InsetGraphicsParams.cpp
index 15d6cad7a4a1324173a414e0ce4a71df4e9d8c0b..b7ea377f4208a40d35c308bd2a57fe06f47519f4 100644 (file)
@@ -50,12 +50,13 @@ InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
 }
 
 
-void InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
+InsetGraphicsParams & InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
 {
        // Are we assigning the object into itself?
        if (this == &params)
-               return;
+               return *this;
        copy(params);
+       return *this;
 }
 
 
@@ -176,17 +177,20 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
 }
 
 
-bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const & bufpath)
+bool InsetGraphicsParams::Read(Lexer & lex, string const & token,
+                               Buffer const & buf, bool allowOrigin)
 {
        if (token == "filename") {
                lex.eatLine();
-               filename.set(lex.getString(), bufpath);
+               if (allowOrigin)
+                       filename = buf.getReferencedFileName(lex.getString());
+               else
+                       filename.set(lex.getString(), buf.filePath());
        } else if (token == "lyxscale") {
                lex.next();
                lyxscale = lex.getInteger();
        } else if (token == "display") {
                lex.next();
-               string const type = lex.getString();
                display = lex.getString() != "false";
        } else if (token == "scale") {
                lex.next();