X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetgraphics.C;h=56d990bda04622110fd3bbeac131ce8b7aee81cb;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=f5067fc64fe8f137fbf52b54ba5765ff3f7e1d78;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index f5067fc64f..56d990bda0 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -64,7 +64,6 @@ TODO #include "FuncStatus.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "lyx_main.h" #include "lyxlength.h" #include "lyxlex.h" #include "metricsinfo.h" @@ -234,10 +233,12 @@ void InsetGraphics::edit(LCursor & cur, bool) } -void InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const +bool InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const { graphic_->metrics(mi, dim); + bool const changed = dim_ != dim; dim_ = dim; + return changed; } @@ -463,7 +464,7 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out) // Nothing to do... return std::make_pair(IDENTICAL_CONTENTS, file_out); - Mover const & mover = movers(formats.getFormatFromFile(file_in)); + Mover const & mover = getMover(formats.getFormatFromFile(file_in)); bool const success = mover.copy(file_in, file_out); if (!success) { // FIXME UNICODE @@ -501,9 +502,9 @@ copyToDirIfNeeded(DocFileName const & file, string const & dir) string::size_type const ext_len = file_in.length() - base.length(); mangled[mangled.length() - ext_len] = '.'; } - string const file_out = support::makeAbsPath(mangled, dir); + FileName const file_out(support::makeAbsPath(mangled, dir)); - return copyFileIfNeeded(file, FileName(file_out)); + return copyFileIfNeeded(file, file_out); } @@ -720,7 +721,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf, // FIXME (Abdel 12/08/06): Is there a need to show these errors? ErrorList el; - if (converters.convert(&buf, temp_file, to_file, params().filename, + if (theConverters().convert(&buf, temp_file, to_file, params().filename, from, to, el, Converters::try_default | Converters::try_cache)) { runparams.exportdata->addExternalFile(tex_format,