]> git.lyx.org Git - features.git/commitdiff
I forgot to commit Herbert's patch to support the TGIF-format in
authorAngus Leeming <leeming@lyx.org>
Thu, 14 Feb 2002 13:49:41 +0000 (13:49 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 14 Feb 2002 13:49:41 +0000 (13:49 +0000)
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
src/support/filetools.C

index 467a66570d35fa193f7147c48f6b4dc8337610b4..3e5c6badeda2f16af20688a86276f5668bbf2317 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Herbert Voss  <voss@perce.de>
+
+       * filetools.C: (getExtFromContents) adding TGIF-format
+       and return type "user" when no type is detected
+
 2002-02-13  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * textutils.h: remove IsLineSeparatorChar(char, Inset *)
index fe1689aaf254778e4dba34a0acb3f585b8413194..a31cb981c0e3225fe017fad77d31b002f8e60ccb 100644 (file)
@@ -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";
 }