X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetExternal.cpp;h=5e04597b3a8eb355ce315a7bb14d71ee6b6becc8;hb=06254d11dfdf670fab3548dc2a2674e7a261262c;hp=ff4e19c9906643a6dc151d7be05d66e2146b0ddd;hpb=9abb7db46800e554f57e865a3e768602ffd9d6f1;p=lyx.git diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index ff4e19c990..5e04597b3a 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -65,11 +65,11 @@ namespace external { TempName::TempName() { - support::FileName const tempname(support::tempName(support::FileName(), "lyxext")); + FileName const tempname = FileName::tempName("lyxext"); // FIXME: This is unsafe tempname.removeFile(); // must have an extension for the converter code to work correctly. - tempname_ = support::FileName(tempname.absFilename() + ".tmp"); + tempname_ = FileName(tempname.absFilename() + ".tmp"); } @@ -182,15 +182,8 @@ void InsetExternalParams::write(Buffer const & buffer, ostream & os) const os << "External\n" << "\ttemplate " << templatename() << '\n'; - if (!filename.empty()) { - // when we save, we still use the original filename - EmbeddedFiles::EmbeddedFileList::const_iterator it = - buffer.embeddedFiles().find(filename.toFilesystemEncoding()); - if (it != buffer.embeddedFiles().end()) - os << "\tfilename " << DocFileName(it->absFilename()).outputFilename(buffer.filePath()) << '\n'; - else - os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n'; - } + if (!filename.empty()) + os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n'; if (display != defaultDisplayType) os << "\tdisplay " @@ -224,7 +217,6 @@ void InsetExternalParams::write(Buffer const & buffer, ostream & os) const } if (!resizedata.no_resize()) { - using support::float_equal; double const scl = convert(resizedata.scale); if (!float_equal(scl, 0.0, 0.05)) { if (!float_equal(scl, 100.0, 0.05)) @@ -298,12 +290,6 @@ bool InsetExternalParams::read(Buffer const & buffer, Lexer & lex) lex.eatLine(); string const name = lex.getString(); filename.set(name, buffer.filePath()); - // maybe this file is embedded - EmbeddedFiles::EmbeddedFileList::const_iterator it = buffer.embeddedFiles().find(filename.toFilesystemEncoding()); - if (it != buffer.embeddedFiles().end()) - // using available file, embedded or external, depending on file availability and - // embedding status. - filename = DocFileName(it->availableFile(&buffer)); break; } @@ -490,7 +476,8 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetExternal::registerEmbeddedFiles(Buffer const &, EmbeddedFiles & files) const { - files.registerFile(params_.filename.absFilename(), false, this); + // temporarily disable embedding for this inset + /* files.registerFile(params_.filename, this); */ } @@ -587,7 +574,7 @@ docstring const getScreenLabel(InsetExternalParams const & params, external::getTemplatePtr(params); if (!ptr) // FIXME UNICODE - return support::bformat((_("External template %1$s is not installed")), + return bformat((_("External template %1$s is not installed")), from_utf8(params.templatename())); // FIXME UNICODE docstring gui = _(ptr->guiName);