#include "support/systemcall.h"
#include "filetools.h"
-#include "format.h"
+//#include "format.h"
#include "lstrings.h"
#include "FileInfo.h"
#include "forkedcontr.h"
}
+#if 0
namespace {
class FormatExtensionsEqual : public std::unary_function<Format, bool> {
};
} // namespace anon
+#endif
// the different filetypes and what they contain in one of the first lines
if (filename.empty() || !IsFileReadable(filename))
return string();
-
ifstream ifs(filename.c_str());
if (!ifs)
// Couldn't open file...
int const max_count = 50;
int count = 0;
- string str, format;
+ string str;
+ string format;
bool firstLine = true;
while ((count++ < max_count) && format.empty()) {
if (ifs.eof()) {
lyxerr[Debug::GRAPHICS]
<< "filetools(getFormatFromContents)\n"
<< "\tCouldn't find a known format!\n";
+#if 0
+ // This just cannot be here. It is a blatant violation of interfaces.
+ // Nothing in support should have any knowledge of internal structures
+ // in the rest of lyx. This case needs to be explictly checked for
+ // in the places where this function is called. Also it makes the
+ // function name a lie. (Lgb)
if (!ext.empty()) {
// this is ambigous if two formats have the same extension,
// but better than nothing
return cit->name();
}
}
+#endif
lyxerr[Debug::GRAPHICS]
<< "\twill use a \"user\" defined format" << endl;
return "user";