- Add support for ae package

- Fix for compilers with broken string::find_last_not_of


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1370 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-01-23 12:53:05 +00:00
parent c8bcf27608
commit 75f555e7c0
6 changed files with 33 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2001-01-23 Dekel Tsur <dekelts@tau.ac.il>
* buffer.C (makeLaTeXFile): Do not load the ae package when using
OT1 font encoding. Also, load the aecompl package if the ae
package is loaded.
* tex-strings.C: Add "ae" to tex_fonts[] (from Matej Cepl).
2001-01-22 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* texrow.C (increasePos): turn two error messages into debug

View File

@ -1744,9 +1744,15 @@ void Buffer::makeLaTeXFile(string const & fname,
// end of \documentclass defs
// font selection must be done before loading fontenc.sty
if (params.fonts != "default") {
// The ae package is not needed when using OT1 font encoding.
if (params.fonts != "default" &&
(params.fonts != "ae" || lyxrc.fontenc != "default")) {
ofs << "\\usepackage{" << params.fonts << "}\n";
texrow.newline();
if (params.fonts == "ae") {
ofs << "\\usepackage{aecompl}\n";
texrow.newline();
}
}
// this one is not per buffer
if (lyxrc.fontenc != "default") {

View File

@ -1,3 +1,10 @@
2001-01-23 Dekel Tsur <dekelts@tau.ac.il>
* lstrings.C (strip): Add a fix for compilers with broken
string::find_last_not_of.
* filetools.C (AddPath): Simplify by using strip and frontStrip.
2001-01-20 Dekel Tsur <dekelts@tau.ac.il>
* lyxstring.C (rfind): Fix broken functions.

View File

@ -942,12 +942,9 @@ string const AddPath(string const & path, string const & path_2)
buf += '/';
}
if (!path2.empty()) {
string::size_type const p2start = path2.find_first_not_of('/');
string::size_type const p2end = path2.find_last_not_of('/');
string const tmp = path2.substr(p2start, p2end - p2start + 1);
buf += tmp + '/';
}
if (!path2.empty())
buf += frontStrip(strip(path2, '/'), '/') + '/';
return buf;
}

View File

@ -512,6 +512,13 @@ string const strip(string const & a, char c)
if (i == a.length() - 1) return tmp; // no c's at end of a
if (i != string::npos)
tmp.erase(i + 1, string::npos);
#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
/// Needed for broken string::find_last_not_of
else if (tmp[0] != c) {
if (a.length() == 1) return tmp;
tmp.erase(1, string::npos);
}
#endif
else
tmp.erase(); // only c in the whole string
return tmp;

View File

@ -62,7 +62,7 @@ char const * tex_graphics[] = {"default", "dvips", "dvitops", "emtex",
"ln", "oztex", "textures", "none", ""};
char const * tex_fonts[] = {"default", "pslatex", "times", "palatino",
char const * tex_fonts[] = {"default", "ae", "pslatex", "times", "palatino",
"helvet", "avant", "newcent", "bookman", ""};