X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fimporter.C;h=b37c9f0cfa89e3db9c5ff4c051f277025e01a982;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=f9f9f7843fe2d1240a7e7bb4c952cd33f24f8112;hpb=1396c7326234f0ee41488e8b8e3d9c57c6a0a2d0;p=lyx.git diff --git a/src/importer.C b/src/importer.C index f9f9f7843f..b37c9f0cfa 100644 --- a/src/importer.C +++ b/src/importer.C @@ -27,10 +27,12 @@ #include "BufferView.h" #include "buffer_funcs.h" -using lyx::docstring; -using lyx::support::bformat; -using lyx::support::changeExtension; -using lyx::support::makeDisplayPath; + +namespace lyx { + +using support::bformat; +using support::changeExtension; +using support::makeDisplayPath; using std::find; using std::string; @@ -51,21 +53,25 @@ bool Importer::Import(LyXView * lv, string const & filename, for (vector::const_iterator it = loaders.begin(); it != loaders.end(); ++it) { if (converters.isReachable(format, *it)) { - if (!converters.convert(0, filename, filename, - format, *it, errorList)) + string const tofile = + changeExtension(filename, + formats.extension(*it)); + if (!converters.convert(0, filename, tofile, + filename, format, *it, errorList)) return false; loader_format = *it; break; } } if (loader_format.empty()) { - Alert::error(_("Couldn't import file"), + frontend::Alert::error(_("Couldn't import file"), bformat(_("No information for importing the format %1$s."), formats.prettyName(format))); return false; } - } else + } else { loader_format = format; + } if (loader_format == "lyx") { @@ -113,3 +119,6 @@ vector const Importer::Loaders() v.push_back("textparagraph"); return v; } + + +} // namespace lyx