+2002-07-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * MenuBackend.C (expand): add numeric shortcuts to document menu
+
+ * lyxrc.C (getDescription): remove RC_NEW_ASK_FILENAME
+
+2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * lyxfont.C (setLyXFamily):
+ (setLyXSeries):
+ (setLyXShape):
+ (setLyXSize):
+ (setLyXMisc):
+ (lyxRead):
+ * debug.C (value):
+ * buffer.C (asciiParagraph): use ascii_lowercase
+
+2002-07-15 Mike Fabian <mfabian@suse.de>
+
+ * lyxlex_pimpl.C (search_kw):
+ * lyxlex.C (getLongString):
+ * converter.h (operator<):
+ * converter.C (operator<):
+ * buffer.C (parseSingleLyXformat2Token):
+ (asciiParagraph):
+ * ToolbarDefaults.C (read):
+ * MenuBackend.C (checkShortcuts):
+ (read):
+ * LColor.C (getFromGUIName):
+ (getFromLyXName): use the compare_ascii_no_case instead of
+ compare_no_case, because in turkish, 'i' is not the lowercase
+ version of 'I', and thus turkish locale breaks parsing of tags.
+
2002-07-16 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C (buffer): Previews::generateBufferPreviews
InfoTab::const_iterator ici = infotab.begin();
InfoTab::const_iterator end = infotab.end();
for (; ici != end; ++ici) {
- if (!compare_no_case(_(ici->second.guiname), guiname))
+ if (!compare_ascii_no_case(_(ici->second.guiname), guiname))
return ici->first;
}
return LColor::inherit;
InfoTab::const_iterator ici = infotab.begin();
InfoTab::const_iterator end = infotab.end();
for (; ici != end; ++ici) {
- if (!compare_no_case(ici->second.lyxname, lyxname))
+ if (!compare_ascii_no_case(ici->second.lyxname, lyxname))
return ici->first;
}
return LColor::inherit;
<< "\" does not contain shortcut `"
<< shortcut << '\'' << endl;
for (const_iterator it2 = begin(); it2 != it1 ; ++it2) {
- if (!compare_no_case(it2->shortcut(), shortcut)) {
+ if (!compare_ascii_no_case(it2->shortcut(), shortcut)) {
lyxerr << "Menu warning: menu entries "
<< '"' << it1->fulllabel()
<< "\" and \"" << it2->fulllabel()
break;
}
+ int ii = 1;
Strings::const_iterator docit = names.begin();
Strings::const_iterator end = names.end();
- for (; docit != end ; ++docit) {
+ for (; docit != end; ++docit, ++ii) {
int const action = lyxaction
.getPseudoAction(LFUN_SWITCHBUFFER,
*docit);
- string const label =
- MakeDisplayPath(*docit, 30);
+ string label = MakeDisplayPath(*docit, 30);
+ if (ii < 10)
+ label = tostr(ii) + ". "
+ + label + '|' + tostr(ii);
tomenu.add(MenuItem(MenuItem::Command,
label, action));
}
};
//consistency check
- if (compare_no_case(lex.getString(), "menuset")) {
+ if (compare_ascii_no_case(lex.getString(), "menuset")) {
lyxerr << "Menubackend::read: ERROR wrong token:`"
<< lex.getString() << '\'' << endl;
}
void ToolbarDefaults::read(LyXLex & lex)
{
//consistency check
- if (compare_no_case(lex.getString(), "toolbar")) {
+ if (compare_ascii_no_case(lex.getString(), "toolbar")) {
lyxerr << "Toolbar::read: ERROR wrong token:`"
<< lex.getString() << '\'' << endl;
}
layoutname = tclass.defaultLayoutName();
}
#ifndef NO_COMPABILITY
- if (compare_no_case(layoutname, "latex") == 0) {
+ if (compare_ascii_no_case(layoutname, "latex") == 0) {
ert_comp.active = true;
ert_comp.fromlayout = true;
ert_comp.font = font;
#ifdef USE_CAPTION
// The is the compability reading of layout caption.
// It can be removed in LyX version 1.3.0. (Lgb)
- if (compare_no_case(layoutname, "caption") == 0) {
+ if (compare_ascii_no_case(layoutname, "caption") == 0) {
// We expect that the par we are now working on is
// really inside a InsetText inside a InsetFloat.
// We also know that captions can only be
// This strange command allows LyX to recognize "natbib" style
// citations: citet, citep, Citet etc.
- if (compare_no_case(cmdName, "cite", 4) == 0) {
+ if (compare_ascii_no_case(cmdName.substr(0,4), "cite") == 0) {
inset = new InsetCitation(inscmd);
} else if (cmdName == "bibitem") {
lex.printError("Wrong place for bibitem");
if (compare_no_case(tmp, "itemize") == 0) {
ltype = 1;
ltype_depth = depth + 1;
- } else if (compare_no_case(tmp, "enumerate") == 0) {
+ } else if (compare_ascii_no_case(tmp, "enumerate") == 0) {
ltype = 2;
ltype_depth = depth + 1;
- } else if (contains(lowercase(tmp), "ection")) {
+ } else if (contains(ascii_lowercase(tmp), "ection")) {
ltype = 3;
ltype_depth = depth + 1;
- } else if (contains(lowercase(tmp), "aragraph")) {
+ } else if (contains(ascii_lowercase(tmp), "aragraph")) {
ltype = 4;
ltype_depth = depth + 1;
- } else if (compare_no_case(tmp, "description") == 0) {
+ } else if (compare_ascii_no_case(tmp, "description") == 0) {
ltype = 5;
ltype_depth = depth + 1;
- } else if (compare_no_case(tmp, "abstract") == 0) {
+ } else if (compare_ascii_no_case(tmp, "abstract") == 0) {
ltype = 6;
ltype_depth = 0;
- } else if (compare_no_case(tmp, "bibliography") == 0) {
+ } else if (compare_ascii_no_case(tmp, "bibliography") == 0) {
ltype = 7;
ltype_depth = 0;
} else {
bool operator<(Converter const & a, Converter const & b)
{
- int const i = compare_no_case(a.From->prettyname(),
- b.From->prettyname());
+ // use the compare_ascii_no_case instead of compare_no_case,
+ // because in turkish, 'i' is not the lowercase version of 'I',
+ // and thus turkish locale breaks parsing of tags.
+ int const i = compare_ascii_no_case(a.From->prettyname(),
+ b.From->prettyname());
if (i == 0)
- return compare_no_case(a.To->prettyname(), b.To->prettyname())
+ return compare_ascii_no_case(a.To->prettyname(), b.To->prettyname())
< 0;
else
return i < 0;
inline
bool operator<(Format const & a, Format const & b)
{
- return compare_no_case(a.prettyname(), b.prettyname()) < 0;
+ // use the compare_ascii_no_case instead of compare_no_case,
+ // because in turkish, 'i' is not the lowercase version of 'I',
+ // and thus turkish locale breaks parsing of tags.
+
+ return compare_ascii_no_case(a.prettyname(), b.prettyname()) < 0;
}
string v(val);
while (!v.empty()) {
string::size_type st = v.find(',');
- string tmp(lowercase(v.substr(0, st)));
+ string tmp(ascii_lowercase(v.substr(0, st)));
if (tmp.empty())
break;
// Is it a number?
+2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * biblio.C (parseBibTeX): use ascii_lowercase instead of lowercase
+
+2002-07-15 Mike Fabian <mfabian@suse.de>
+
+ * biblio.C (compareNoCase): use the compare_ascii_no_case instead
+ of compare_no_case, because in turkish, 'i' is not the lowercase
+ version of 'I', and thus turkish locale breaks parsing of tags.
+
2002-07-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
* ControlBibtex.C (applyParamsToInset): ws change
struct compareNoCase: public std::binary_function<string, string, bool>
{
bool operator()(string const & s1, string const & s2) const {
- return compare_no_case(s1, s2) < 0;
+ return compare_ascii_no_case(s1, s2) < 0;
}
};
do {
dummy = token(data, ',', Entries++);
if (!dummy.empty()) {
- found = contains(lowercase(dummy), findkey);
+ found = contains(ascii_lowercase(dummy), findkey);
if (findkey == "title" &&
- contains(lowercase(dummy), "booktitle"))
+ contains(ascii_lowercase(dummy), "booktitle"))
found = false;
}
} while (!found && !dummy.empty());
+2002-07-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * PreviewLoader.C (setConverter): remove unused variable
+
+ * GraphicsImageXPM.C (isDrawable): implement
+ (setPixmap): the opaque color is black, not white
+
+2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * GraphicsImageXPM.C (color_none_id):
+ (contains_color_none): use ascii_lowercase instead of lowercase
+
2002-07-16 Angus Leeming <leeming@lyx.org>
* PreviewLoader.C: greater use of STL algorithms.
pretty temperamemtal at the moment.
2002-04-16 Rob Lahaye <lahaye@users.sourceforge.net>
+
* GraphicsImageXPM.C: fix clipping for boundingbox y-coordinates
2002-04-08 Angus Leeming <a.leeming@ic.ac.uk>
}
+bool ImageXPM::isDrawable() const
+{
+ return pixmap_;
+}
+
+
Pixmap ImageXPM::getPixmap() const
{
if (!pixmap_status_ == PIXMAP_SUCCESS)
// some image magick versions use this
xpm_col[1].name = 0;
xpm_col[1].value = "opaque";
- xpm_col[1].pixel = lyxColorHandler->colorPixel(LColor::white);
+ xpm_col[1].pixel = lyxColorHandler->colorPixel(LColor::black);
attrib.numsymbols = 2;
attrib.colorsymbols = xpm_col;
XpmColor * table = colorTable_.get();
for (size_t i = 0; i < ncolors_; ++i) {
char const * const color = table[i].c_color;
- if (color && lowercase(color) == "none")
+ if (color && ascii_lowercase(color) == "none")
return uint(i);
}
return 0;
{
for (size_t i = 0; i < image.ncolors; ++i) {
char const * const color = image.colorTable[i].c_color;
- if (color && lowercase(color) == "none")
+ if (color && ascii_lowercase(color) == "none")
return true;
}
return false;
/// Get the image height
unsigned int getHeight() const;
+ bool isDrawable() const;
+
/** Load the image file into memory.
* In this case (ImageXPM), the process is blocking.
*/
Converter const * setConverter()
{
- Converter const * converter = 0;
-
string const from = "lyxpreview";
Formats::FormatList::const_iterator it = formats.begin();
+2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * insetcite.C (getNatbibLabel):
+ * insetbib.C (getKeys): use ascii_lowercase instead of lowercase
+
2002-07-15 John Levon <moz@compsoc.man.ac.uk>
* insetgraphics.C: use ->isDrawable()
linebuf = subst(linebuf, '{', '(');
string tmp;
linebuf = split(linebuf, tmp, '(');
- tmp = lowercase(tmp);
+ tmp = ascii_lowercase(tmp);
if (!prefixIs(tmp, "@string")
&& !prefixIs(tmp, "@preamble")) {
linebuf = split(linebuf, tmp, ',');
bool const full = citeType[citeType.size()-1] == '*';
string const cite_type = full ?
- lowercase(citeType.substr(0,citeType.size()-1)) :
- lowercase(citeType);
+ ascii_lowercase(citeType.substr(0,citeType.size()-1)) :
+ ascii_lowercase(citeType);
string before_str;
if (!before.empty()) {
// Set family according to lyx format string
LyXFont & LyXFont::setLyXFamily(string const & fam)
{
- string const s = lowercase(fam);
+ string const s = ascii_lowercase(fam);
int i = 0;
while (s != LyXFamilyNames[i] && LyXFamilyNames[i] != "error") ++i;
// Set series according to lyx format string
LyXFont & LyXFont::setLyXSeries(string const & ser)
{
- string const s = lowercase(ser);
+ string const s = ascii_lowercase(ser);
int i = 0;
while (s != LyXSeriesNames[i] && LyXSeriesNames[i] != "error") ++i;
// Set shape according to lyx format string
LyXFont & LyXFont::setLyXShape(string const & sha)
{
- string const s = lowercase(sha);
+ string const s = ascii_lowercase(sha);
int i = 0;
while (s != LyXShapeNames[i] && LyXShapeNames[i] != "error") ++i;
// Set size according to lyx format string
LyXFont & LyXFont::setLyXSize(string const & siz)
{
- string const s = lowercase(siz);
+ string const s = ascii_lowercase(siz);
int i = 0;
while (s != LyXSizeNames[i] && LyXSizeNames[i] != "error") ++i;
if (s == LyXSizeNames[i]) {
// Set size according to lyx format string
LyXFont::FONT_MISC_STATE LyXFont::setLyXMisc(string const & siz)
{
- string const s = lowercase(siz);
+ string const s = ascii_lowercase(siz);
int i = 0;
while (s != LyXMiscNames[i] && LyXMiscNames[i] != "error") ++i;
if (s == LyXMiscNames[i])
bool finished = false;
while (!finished && lex.isOK() && !error) {
lex.next();
- string const tok = lowercase(lex.getString());
+ string const tok = ascii_lowercase(lex.getString());
if (tok.empty()) {
continue;
setLyXSize(ttok);
} else if (tok == "misc") {
lex.next();
- string const ttok = lowercase(lex.getString());
+ string const ttok = ascii_lowercase(lex.getString());
if (ttok == "no_bar") {
setUnderbar(OFF);
// We do a case independent comparison, like search_kw
// does.
- if (compare_no_case(token, endtoken) != 0) {
+ if (compare_ascii_no_case(token, endtoken) != 0) {
string tmpstr = getString();
if (firstline) {
unsigned int i = 0;
keyword_item * res =
lower_bound(table, table + no_items,
search_tag, compare_tags());
+ // use the compare_ascii_no_case instead of compare_no_case,
+ // because in turkish, 'i' is not the lowercase version of 'I',
+ // and thus turkish locale breaks parsing of tags.
if (res != table + no_items
- && !compare_no_case(res->tag, tag))
+ && !compare_ascii_no_case(res->tag, tag))
return res->code;
return LEX_UNDEF;
}
case RC_DEFAULT_PAPERSIZE:
if (lexrc.next()) {
string const size =
- lowercase(lexrc.getString());
+ ascii_lowercase(lexrc.getString());
if (size == "usletter")
default_papersize =
BufferParams::PAPER_USLETTER;
case RC_FORMAT:
break;
- case RC_NEW_ASK_FILENAME:
- str = _("This sets the behaviour if you want to be asked for a filename when creating a new document or wait until you save it and be asked then.");
- break;
-
case RC_DEFAULT_LANGUAGE:
str = _("New documents will be assigned this language.");
break;
RC_CONVERTER,
RC_VIEWER,
RC_FORMAT,
- RC_NEW_ASK_FILENAME,
RC_DEFAULT_LANGUAGE,
RC_LABEL_INIT_LENGTH,
RC_DISPLAY_GRAPHICS,
+2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+ * filetools.C (IsLyXFilename):
+ (IsSGMLFilename): use ascii_lowercase instead of lowercase
+
+ * lstrings.[Ch] (ascii_lowercase): new function
+
2002-07-16 André Pönitz <poenitz@gmx.net>
* FileInfo.Ch: remove unneeded code
bool IsLyXFilename(string const & filename)
{
- return suffixIs(lowercase(filename), ".lyx");
+ return suffixIs(ascii_lowercase(filename), ".lyx");
}
bool IsSGMLFilename(string const & filename)
{
- return suffixIs(lowercase(filename), ".sgml");
+ return suffixIs(ascii_lowercase(filename), ".sgml");
}
}
};
+struct local_ascii_lowercase {
+ char operator()(char c) const {
+ return ascii_tolower(c);
+ }
+};
+
} // end of anon namespace
string const lowercase(string const & a)
}
+string const ascii_lowercase(string const & a)
+{
+ string tmp(a);
+ transform(tmp.begin(), tmp.end(), tmp.begin(),
+ local_ascii_lowercase());
+ return tmp;
+}
+
+
bool prefixIs(string const & a, char const * pre)
{
lyx::Assert(pre);
///
char uppercase(char c);
+/// same as lowercase(), but ignores locale
+string const ascii_lowercase(string const &);
+
///
string const lowercase(string const &);