From 4a22a9061106edfaad1faa7c2233597145b5da28 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 14 Feb 2002 13:49:41 +0000 Subject: [PATCH] I forgot to commit Herbert's patch to support the TGIF-format in getExtFromContents, so here it is. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3538 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 5 +++++ src/support/filetools.C | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 467a66570d..3e5c6baded 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2002-02-08 Herbert Voss + + * filetools.C: (getExtFromContents) adding TGIF-format + and return type "user" when no type is detected + 2002-02-13 Jean-Marc Lasgouttes * textutils.h: remove IsLineSeparatorChar(char, Inset *) diff --git a/src/support/filetools.C b/src/support/filetools.C index fe1689aaf2..a31cb981c0 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -967,6 +967,7 @@ string const GetExtension(string const & name) // the different filetypes and what they contain in one of the first lines // (dots are any characters). (Herbert 20020131) // EPS %!PS-Adobe-3.0 EPSF... +// TGIF %TGIF... // GIF GIF... // JPG JFIF // PDF %PDF-... @@ -1012,6 +1013,8 @@ string const getExtFromContents(string const & filename) { } if (contains(str,"EPSF")) // dummy, if we have wrong file return "eps"; // description like "%!PS-Adobe-2.0EPSF" + else if (contains(str,"TGIF")) + return "tgif"; else if (contains(str,"GIF")) return "gif"; else if (contains(str,"JFIF")) @@ -1032,9 +1035,10 @@ string const getExtFromContents(string const & filename) { else if (contains(str,"XPM")) return "xpm"; } - lyxerr[Debug::INFO] << "filetools(getExtFromContents)" - " Couldn't find a known Type!" << endl; - return string(); + lyxerr[Debug::INFO] << "filetools(getExtFromContents)\n" + "\tCouldn't find a known Type!" + "\twill use a \"user\" defined format (based on file extension)" << endl; + return "user"; } -- 2.39.2