mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
Fix the drawing of an inset with a relative file path subdir/fig.eps
when pasting it into a buffer in a different directory. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5457 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
855235a028
commit
dde4494e66
@ -1,3 +1,9 @@
|
||||
2002-10-21 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* insetgraphics.C (draw): Fix the drawing of an inset with a relative
|
||||
file path subdir/fig.eps when pasting it into a buffer in a different
|
||||
directory.
|
||||
|
||||
2002-10-16 John Levon <levon@movementarian.org>
|
||||
|
||||
* insetspecialchar.C: remove \\protected_separator parsing
|
||||
|
@ -294,6 +294,18 @@ int InsetGraphics::width(BufferView *, LyXFont const & font) const
|
||||
void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
|
||||
int baseline, float & x, bool) const
|
||||
{
|
||||
// MakeAbsPath returns params().filename unchanged if it absolute
|
||||
// already.
|
||||
string const file_with_path =
|
||||
MakeAbsPath(params().filename, bv->buffer()->filePath());
|
||||
|
||||
// A 'paste' operation creates a new inset with the correct filepath,
|
||||
// but then the 'old' inset stored in the 'copy' operation is actually
|
||||
// added to the buffer.
|
||||
// Thus, we should ensure that the filepath is correct.
|
||||
if (file_with_path != cache_->loader.filename())
|
||||
cache_->update(file_with_path);
|
||||
|
||||
cache_->view = bv->owner()->view();
|
||||
int oasc = cache_->old_ascent;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user