]> git.lyx.org Git - features.git/commitdiff
compile fix in XPM image loader; fix opaque handling; remove warnings; fix turkish...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 16 Jul 2002 21:17:10 +0000 (21:17 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 16 Jul 2002 21:17:10 +0000 (21:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4661 a592a061-630c-0410-9148-cb99ea01b6c8

26 files changed:
src/ChangeLog
src/LColor.C
src/MenuBackend.C
src/ToolbarDefaults.C
src/buffer.C
src/converter.C
src/converter.h
src/debug.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C
src/graphics/ChangeLog
src/graphics/GraphicsImageXPM.C
src/graphics/GraphicsImageXPM.h
src/graphics/PreviewLoader.C
src/insets/ChangeLog
src/insets/insetbib.C
src/insets/insetcite.C
src/lyxfont.C
src/lyxlex.C
src/lyxlex_pimpl.C
src/lyxrc.C
src/lyxrc.h
src/support/ChangeLog
src/support/filetools.C
src/support/lstrings.C
src/support/lstrings.h

index 49ae057572fa8fee4cb0b7af68e37a7b8b67a9f8..eaba748c4d71de745b3166bb196cc4cbf426d20b 100644 (file)
@@ -1,3 +1,36 @@
+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
index 44e3004dac90ebd50f04a5f7441d605a22990e4e..c213c79fe8d85b3e79c5e34c667415b889d995fe 100644 (file)
@@ -185,7 +185,7 @@ LColor::color LColor::getFromGUIName(string const & guiname) const
        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;
@@ -198,7 +198,7 @@ LColor::color LColor::getFromLyXName(string const & lyxname) const
        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;
index e3c76877775b27f266dbec01c1f82b9ed7499639..0bb7f4c975038f8cda4ea51af6da1685fd45305f 100644 (file)
@@ -237,7 +237,7 @@ void Menu::checkShortcuts() const
                               << "\" 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()
@@ -296,14 +296,17 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                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));
                        }
@@ -451,7 +454,7 @@ void MenuBackend::read(LyXLex & lex)
        };
 
        //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;
        }
index 8930ae982a3b827be2f02ee4308fc2622483270c..19c025217c96da2c91bd487b5db6616e6a73b613 100644 (file)
@@ -98,7 +98,7 @@ void ToolbarDefaults::init()
 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;
        }
index d51ac5c27a0760728518963cf0c89f1f6e116cd6..03f5c042ac8901a8334cc1a02e7dfdf840967bf8 100644 (file)
@@ -548,7 +548,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                        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;
@@ -569,7 +569,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 #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
@@ -1581,7 +1581,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
 
                // 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");
@@ -1958,22 +1958,22 @@ string const Buffer::asciiParagraph(Paragraph const * par,
        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 {
index f91c85f6077e552e167a7e28cea6c181ac3fc4f3..b36c0c9a34e8c44c08cbca8780d76eef827f7d63 100644 (file)
@@ -264,10 +264,13 @@ void Converter::readFlags()
 
 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;
index 0f507af1ac66fde8c46f878cb98d21dff8b7f0d2..77dc9723d031568d49a624a5c390119ebf5dd3a4 100644 (file)
@@ -77,7 +77,11 @@ private:
 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;
 }
 
 
index b629f57a0d0646c51a0edf880c4fdeb51deb6cc1..8506660b23eec94add1689103ad05999c222a1ae 100644 (file)
@@ -80,7 +80,7 @@ Debug::type Debug::value(string const & val)
        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?
index 6afca5d7da631d1453b5319c6a3d9c9f129bc243..4f49ba5e43aa44350756ad390227f0d0e3288966 100644 (file)
@@ -1,3 +1,13 @@
+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
index ab83d4ed1b95a7b5262220ad1545810134166853..7ae01ac0fa2751fde2021a33a15a407d09d48d2b 100644 (file)
@@ -266,7 +266,7 @@ string const getYear(InfoMap const & map, string const & key)
 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;
        }
 };
 
@@ -424,9 +424,9 @@ string const parseBibTeX(string data, string const & findkey)
        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());
index cf8d110466747a826a5980db1038e06964ed9706..4b75a6b3e7b3355594bc8bfa9b0baf0dde3bfb81 100644 (file)
@@ -1,3 +1,15 @@
+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>
index ee4dc49e6d721b68aea185b42643f1493c67a25d..726a56b62c649c46ca606ec2d78a344f75db508b 100644 (file)
@@ -95,6 +95,12 @@ unsigned int ImageXPM::getHeight() const
 }
 
 
+bool ImageXPM::isDrawable() const
+{
+       return pixmap_;
+}
+
 Pixmap ImageXPM::getPixmap() const
 {
        if (!pixmap_status_ == PIXMAP_SUCCESS)
@@ -207,7 +213,7 @@ bool ImageXPM::setPixmap(Params const & params)
        // 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;
@@ -552,7 +558,7 @@ unsigned int ImageXPM::Data::color_none_id() const
        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;
@@ -699,7 +705,7 @@ bool contains_color_none(XpmImage const & image)
 {
        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;
index 6d16019bd8b268dd06623cec7139e0c5de694658..01b720d40b36cab4cfd1e97967b5857c39d68102 100644 (file)
@@ -48,6 +48,8 @@ public:
        /// 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.
         */
index 9344e69e79e917271e10adaf2fff4e63c73c8b0b..4685d5239230b14f5a3773269c676c179a31b56b 100644 (file)
@@ -605,8 +605,6 @@ string const unique_filename(string const bufferpath)
 
 Converter const * setConverter()
 {
-       Converter const * converter = 0;
-
        string const from = "lyxpreview";
 
        Formats::FormatList::const_iterator it  = formats.begin();
index a6afe99da00c94fc7579e166f70d531ec17d021b..5f5f03f60dd2841a2cf2aaf3acd40d5895f7e8c4 100644 (file)
@@ -1,3 +1,8 @@
+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()
index 53b7a89d5ba936de8df3d01f3edef4a021efe35a..2799dad562c65dfd5fd80685f9f1686784e8738c 100644 (file)
@@ -259,7 +259,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                                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, ',');
index c5cc7f21ff6b3532e5b430c534bf76d072cbe030..ecd9aa77055d8c58be22305cfb1d212e182f8ff8 100644 (file)
@@ -93,8 +93,8 @@ string const getNatbibLabel(Buffer const * buffer,
        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()) {
index 8cd660eed0561da8b487b1240abdbf760913f4e4..362253b678e817bef473543bb955557cccea2248 100644 (file)
@@ -580,7 +580,7 @@ string const LyXFont::stateText(BufferParams * params) const
 // 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;
@@ -596,7 +596,7 @@ LyXFont & LyXFont::setLyXFamily(string const & fam)
 // 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;
@@ -612,7 +612,7 @@ LyXFont & LyXFont::setLyXSeries(string const & ser)
 // 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;
@@ -628,7 +628,7 @@ LyXFont & LyXFont::setLyXShape(string const & sha)
 // 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]) {
@@ -643,7 +643,7 @@ LyXFont & LyXFont::setLyXSize(string const & siz)
 // 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])
@@ -677,7 +677,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
        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;
@@ -701,7 +701,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
                        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);
index 04c4b23c7eb6fe7661ce6c6f5e1888106eafa539..2e8e8e32f1b510245e37236b1adfa1e5eb88d3dc 100644 (file)
@@ -168,7 +168,7 @@ string const LyXLex::getLongString(string const & endtoken)
 
                // 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;
index 3156c864da197cfffcf1ccd40fb8dfcf0fad0fff..918513a49753e93a942809424c7a9ba487d075f1 100644 (file)
@@ -379,8 +379,11 @@ int LyXLex::Pimpl::search_kw(char const * const tag) const
        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;
 }
index 7ad40b5f08d40bba5050fd4e70844d5fc0ac2439..f782571ee196bee2b18fce6e9feec11f61c38cf6 100644 (file)
@@ -501,7 +501,7 @@ int LyXRC::read(string const & filename)
                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;
@@ -2003,10 +2003,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
        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;
index 96d243e53d5681cd5a338ae22ef699728679a255..2c206d2ff67b7251f77667051901534ad58ec4bd 100644 (file)
@@ -116,7 +116,6 @@ enum LyXRCTags {
        RC_CONVERTER,
        RC_VIEWER,
        RC_FORMAT,
-       RC_NEW_ASK_FILENAME,
        RC_DEFAULT_LANGUAGE,
        RC_LABEL_INIT_LENGTH,
        RC_DISPLAY_GRAPHICS,
index d1541f5ddea808d59e937c5c85b84b9d687457fd..eb4e94c52d4597ff0481a85e2c8a05ae7b6823ef 100644 (file)
@@ -1,4 +1,10 @@
+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
index 0a398e98fef3e20e126c3d70e4b94fc55457f340..278bb797c76042db3a99ce89e44031c8d6855752 100644 (file)
@@ -85,13 +85,13 @@ extern string system_packageList;
 
 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");
 }
 
 
index bcbfb48917cd80440924ab892170e4ef24fce506..d5af3d18c11987d1a52965df6bdfdb5bb8e1d0b2 100644 (file)
@@ -248,6 +248,12 @@ struct local_uppercase {
        }
 };
 
+struct local_ascii_lowercase {
+       char operator()(char c) const {
+               return ascii_tolower(c);
+       }
+};
+
 } // end of anon namespace
 
 string const lowercase(string const & a)
@@ -265,6 +271,15 @@ string const uppercase(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);
index eccfcc9ebdbb866a2420051f85a62be8e78baed6..4e2627f85b4c9b2c56c12c109cf482e5bcf9d53e 100644 (file)
@@ -80,6 +80,9 @@ char lowercase(char c);
 ///
 char uppercase(char c);
 
+/// same as lowercase(), but ignores locale
+string const ascii_lowercase(string const &);
+
 ///
 string const lowercase(string const &);