]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphicsParams.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetGraphicsParams.cpp
index b80e10fbf0d89d46fce21175e1dab095de4221ea..73060d027c213835e51e00707694066c040383c7 100644 (file)
@@ -17,6 +17,7 @@
 #include "LyX.h" // for use_gui
 #include "Lexer.h"
 #include "LyXRC.h"
+#include "Buffer.h"
 
 #include "graphics/GraphicsParams.h"
 
@@ -32,6 +33,7 @@ namespace lyx {
 using support::float_equal;
 using support::readBB_from_PSFile;
 using support::token;
+using support::DocFileName;
 
 using std::string;
 using std::ostream;
@@ -148,12 +150,13 @@ bool operator!=(InsetGraphicsParams const & left,
 }
 
 
-void InsetGraphicsParams::Write(ostream & os, string const & bufpath) const
+void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
 {
        // Do not write the default values
-
        if (!filename.empty()) {
-               os << "\tfilename " << filename.outputFilename(bufpath) << '\n';
+               os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n';
+               os << "\tinzipName " << filename.inzipName() << '\n';
+               os << "\tembed " << (filename.embedded() ? "true" : "false") << '\n';
        }
        if (lyxscale != 100)
                os << "\tlyxscale " << lyxscale << '\n';
@@ -202,6 +205,12 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
        if (token == "filename") {
                lex.eatLine();
                filename.set(lex.getString(), bufpath);
+       } else if (token == "inzipName") {
+               lex.eatLine();
+               filename.setInzipName(lex.getString());
+       } else if (token == "embed") {
+               lex.next();
+               filename.setEmbed(lex.getBool());               
        } else if (token == "lyxscale") {
                lex.next();
                lyxscale = lex.getInteger();