X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetGraphicsParams.cpp;h=b7ea377f4208a40d35c308bd2a57fe06f47519f4;hb=b73879691f816b0874d9dec0c09e2db7889c4e8e;hp=15d6cad7a4a1324173a414e0ce4a71df4e9d8c0b;hpb=dc6d201f8fca2110e81617020f00b31692bde004;p=lyx.git diff --git a/src/insets/InsetGraphicsParams.cpp b/src/insets/InsetGraphicsParams.cpp index 15d6cad7a4..b7ea377f42 100644 --- a/src/insets/InsetGraphicsParams.cpp +++ b/src/insets/InsetGraphicsParams.cpp @@ -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 == ¶ms) - 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();