]> git.lyx.org Git - features.git/commitdiff
add "ansinew" as a synonym of LaTeX encoding "cp1252" (second part of #6142)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 22 Sep 2009 13:05:43 +0000 (13:05 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 22 Sep 2009 13:05:43 +0000 (13:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31439 a592a061-630c-0410-9148-cb99ea01b6c8

lib/encodings
src/Encoding.cpp

index 7335e39e97451fe206d781e7ecfe1f798d174403..b0a001baa9610d8528f081f756b0debfa5f05fff 100644 (file)
@@ -98,6 +98,7 @@ End
 Encoding cp1251 cp1251 "Cyrillic (CP 1251)" CP1251 fixed inputenc
 End
 
+# "ansinew" is harcoded as a synonym of this (see Encodings::fromLaTeXName)
 Encoding cp1252 cp1252 "Western European (CP 1252)" CP1252 fixed inputenc
 End
 
index 6a59fe695c7240bceaaa889261f9577bae961628..2aece9a25c3127b258855ee0fd3938d42b668ce9 100644 (file)
@@ -696,8 +696,14 @@ Encoding const * Encodings::fromLyXName(string const & name) const
 }
 
 
-Encoding const * Encodings::fromLaTeXName(string const & name) const
+Encoding const * Encodings::fromLaTeXName(string const & n) const
 {
+       string name = n;
+       // FIXME: if we have to test for too many of these synonyms,
+       // we should instead extend the format of lib/encodings
+       if (n == "ansinew")
+               name = "cp1252";
+
        // We don't use find_if because it makes copies of the pairs in
        // the map.
        // This linear search is OK since we don't have many encodings.