From 545777433a65fd90ad3bb18be33d8e741c622853 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 25 Mar 2002 11:04:34 +0000 Subject: [PATCH] Fix export of graphics file with relative path name. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3820 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 8 ++++++++ src/insets/insetgraphics.C | 7 ++++--- src/insets/insetgraphicsParams.C | 8 +++----- src/insets/insetgraphicsParams.h | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 9a69b5a57e..ef7a08ebd5 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,11 @@ +2002-03-25 Angus Leeming + + * insetgraphics.C (prepareFile): ensure that the file has an absolute + path when preparing export. + + * insetgraphicsParams.[Ch] (Write): no longer passed Buffer *, as we + no longer MakeRelPath. + 2002-03-22 Angus Leeming * insetgraphics.[Ch] (c-tor, setParams, updateInset): passed filepath. diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index a76c90baa6..f5f86b8f37 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -382,10 +382,10 @@ Inset::EDITABLE InsetGraphics::editable() const } -void InsetGraphics::write(Buffer const * buf, ostream & os) const +void InsetGraphics::write(Buffer const *, ostream & os) const { os << "Graphics FormatVersion " << VersionNumber << '\n'; - params().Write(buf, os); + params().Write(os); } @@ -403,6 +403,7 @@ void InsetGraphics::read(Buffer const * buf, LyXLex & lex) updateInset(buf->filePath()); } + void InsetGraphics::readInsetGraphics(LyXLex & lex) { bool finished = false; @@ -608,7 +609,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const // return original filename without the extension // // if it's a zipped one, than let LaTeX do the rest!!! - string filename_ = params().filename; + string filename_ = MakeAbsPath(params().filename, buf->filePath()); bool const zipped = zippedFile(filename_); if ((zipped && params().noUnzip) || buf->niceFile) { diff --git a/src/insets/insetgraphicsParams.C b/src/insets/insetgraphicsParams.C index da8f0b1d4d..e4e77d960c 100644 --- a/src/insets/insetgraphicsParams.C +++ b/src/insets/insetgraphicsParams.C @@ -182,13 +182,11 @@ bool operator!=(InsetGraphicsParams const & left, } -void InsetGraphicsParams::Write(Buffer const * buf, ostream & os) const +void InsetGraphicsParams::Write(ostream & os) const { // If there is no filename, write nothing for it. - if (! filename.empty()) { - os << "\tfilename " - << MakeRelPath(filename, buf->filePath()) - << '\n'; + if (!filename.empty()) { + os << "\tfilename " << filename << '\n'; } if (!bb.empty()) // bounding box os << "\tBoundingBox " << bb << '\n'; diff --git a/src/insets/insetgraphicsParams.h b/src/insets/insetgraphicsParams.h index 8361eab369..2b7bdd41c2 100644 --- a/src/insets/insetgraphicsParams.h +++ b/src/insets/insetgraphicsParams.h @@ -88,7 +88,7 @@ struct InsetGraphicsParams /// InsetGraphicsParams & operator=(InsetGraphicsParams const &); /// Save the parameters in the LyX format stream. - void Write(Buffer const * buf, std::ostream & os) const; + void Write(std::ostream & os) const; /// If the token belongs to our parameters, read it. bool Read(LyXLex & lex, string const & token);