]> git.lyx.org Git - features.git/commitdiff
STRCONV
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 4 Nov 2002 02:12:42 +0000 (02:12 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 4 Nov 2002 02:12:42 +0000 (02:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5573 a592a061-630c-0410-9148-cb99ea01b6c8

60 files changed:
po/POTFILES.in
src/BufferView_pimpl.C
src/ChangeLog
src/LString.h
src/LaTeX.C
src/LaTeXFeatures.C
src/Spacing.C
src/buffer.C
src/bufferview_funcs.C
src/chset.C
src/counters.C
src/frontends/ChangeLog
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/biblio.C
src/frontends/gnome/GAbout.C
src/frontends/lyx_gui.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QAbout.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/lyx_gui.C
src/graphics/ChangeLog
src/graphics/GraphicsConverter.C
src/graphics/GraphicsImageXPM.C
src/graphics/PreviewLoader.C
src/importer.C
src/insets/ChangeLog
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insettabular.C
src/lyx_main.C
src/lyxfont.C
src/lyxfunc.C
src/lyxgluelength.C
src/lyxlength.C
src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/formulamacro.C
src/mathed/math_autocorrect.C
src/mathed/math_cursor.C
src/mathed/math_diminset.C
src/mathed/math_extern.C
src/mathed/math_factory.C
src/mathed/math_hullinset.C
src/mathed/math_inset.C
src/paragraph.C
src/sgml.C
src/support/ChangeLog
src/support/filetools.C
src/support/lstrings.C
src/support/lstrings.h
src/support/lyxstring.C
src/text2.C
src/vc-backend.C

index 1b8b9ab6739fb80da97802cf75c2013ba9775339..4ca32d60c31cdd833b4e3ab505a4b65e11dd65e1 100644 (file)
@@ -52,13 +52,14 @@ src/frontends/qt2/QGraphics.C
 src/frontends/qt2/QInclude.C
 src/frontends/qt2/QIndex.C
 src/frontends/qt2/QLog.C
+src/frontends/qt2/QLPrintDialog.C
 src/frontends/qt2/QMathDialog.C
+src/frontends/qt2/QMathMatrixDialog.C
 src/frontends/qt2/QMinipage.C
 src/frontends/qt2/QParagraph.C
 src/frontends/qt2/QPreamble.C
 src/frontends/qt2/QPreambleDialog.C
 src/frontends/qt2/QPrint.C
-src/frontends/qt2/QPrintDialog.C
 src/frontends/qt2/QRef.C
 src/frontends/qt2/QSearch.C
 src/frontends/qt2/QSendto.C
@@ -107,6 +108,7 @@ src/frontends/xforms/FormPrint.C
 src/frontends/xforms/FormRef.C
 src/frontends/xforms/FormSearch.C
 src/frontends/xforms/FormSendto.C
+src/frontends/xforms/FormShowFile.C
 src/frontends/xforms/FormSpellchecker.C
 src/frontends/xforms/FormTabular.C
 src/frontends/xforms/FormTabularCreate.C
index d2fbfa222489f429179b36c56bbd9777cb58c5c5..a44049d532025cadc8f7b0c5238e4e50be686e7c 100644 (file)
@@ -638,7 +638,7 @@ void BufferView::Pimpl::savePosition(unsigned int i)
        if (i > 0) {
                ostringstream str;
                str << _("Saved bookmark") << ' ' << i;
-               owner_->message(str.str().c_str());
+               owner_->message(STRCONV(str.str()));
        }
 }
 
@@ -670,7 +670,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
        if (i > 0) {
                ostringstream str;
                str << _("Moved to bookmark") << ' ' << i;
-               owner_->message(str.str().c_str());
+               owner_->message(STRCONV(str.str()));
        }
 }
 
@@ -879,18 +879,18 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
        ostringstream s1;
        s1 << _("Inserting document") << ' '
           << disp_fn << " ...";
-       owner_->message(s1.str().c_str());
+       owner_->message(STRCONV(s1.str()));
        bool const res = bv_->insertLyXFile(filename);
        if (res) {
                ostringstream str;
                str << _("Document") << ' ' << disp_fn
                    << ' ' << _("inserted.");
-               owner_->message(str.str().c_str());
+               owner_->message(STRCONV(str.str()));
        } else {
                ostringstream str;
                str << _("Could not insert document") << ' '
                    << disp_fn;
-               owner_->message(str.str().c_str());
+               owner_->message(STRCONV(str.str()));
        }
 }
 
@@ -908,7 +908,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        // e.g. Qt mouse press when no buffer
        if (!buffer_)
                return false;
+
        LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
 
        switch (ev.action) {
@@ -1126,7 +1126,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                        inset->setLoadingBuffer(bv_->buffer(), false);
                        updateInset(inset, true);
                }
-               
+
        }
        break;
 
@@ -1175,7 +1175,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        {
                InsetBibtex * inset =
                        static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
-               if (inset) 
+               if (inset)
                        inset->setOptions(ev.argument);
        }
        break;
index cad0be4c0c6cad4aeb1b48ed1db2a69105745e1f..29fe937a77d99a3221122e030d9a3d04f138f76b 100644 (file)
@@ -1,5 +1,59 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * vc-backend.C: STRCONV
+       (scanMaster): ditto
+
+       * text2.C (setCounter): STRCONV
+
+       * paragraph.C (asString): STRCONV
+
+       * lyxlength.C (asString): STRCONV
+       (asLatexString): ditto
+
+       * lyxgluelength.C (asString): STRCONV
+       (asLatexString): ditto
+
+       * lyxfunc.C (dispatch): STRCONV
+       (open): ditto
+
+       * lyxfont.C (stateText): STRCONV
+
+       * importer.C (Import): STRCONV
+
+       * counters.C (labelItem): STRCONV
+       (numberLabel): ditto
+       (numberLabel): remove unused ostringstream o
+
+       * chset.C: STRCONV
+       (loadFile): ditto
+
+       * bufferview_funcs.C (currentState): STRCONV
+
+       * buffer.C (readFile): STRCONV
+       (asciiParagraph): ditto
+       (makeLaTeXFile): ditto
+
+       * Spacing.C (writeEnvirBegin): STRCONV
+
+       * LaTeXFeatures.C (getLanguages): STRCONV
+       (getPackages): ditto
+       (getMacros): ditto
+       (getBabelOptions): ditto
+       (getTClassPreamble): ditto
+       (getLyXSGMLEntities): ditto
+       (getIncludedFiles): ditto
+
+       * LaTeX.C: STRCONV
+       (run): ditto
+       (scanAuxFile): ditto
+       (deplog): ditto
+
+       * LString.h: add the STRCONV macros
+
+       * BufferView_pimpl.C (savePosition): STRCONV
+       (restorePosition): ditto
+       (MenuInsertLyXFile): ditto
+
        * vc-backend.C (scanMaster): change from submatch[...] to
        submatch.str(...)
 
index ac5c6b878a92cc2b53868f9facb53a69e7a4938a..1e135594b319e992bc4e2ab19cd3ba86af47d77e 100644 (file)
 #endif
 
 #ifndef USE_INCLUDED_STRING
+
 #include <string>
 using std::string;
+#define STRCONV(STR) STR
 #else
+
 #ifdef __STRING__
 #error The <string> header has been included before LString.h
 #else
@@ -30,5 +33,7 @@ using std::string;
 #include "support/lyxstring.h"
 // using lyx::string;
 typedef lyxstring string;
+#define STRCONV(STR) STR.c_str()
 #endif
+
 #endif
index 9324e66f23fac1bfaf7d943d744e8854b812b31f..a4d8ab4f50841e452b77b7fe174ca8cecda6c2df 100644 (file)
@@ -47,7 +47,12 @@ using std::vector;
 using std::set;
 using boost::regex;
 using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
 using boost::smatch;
+#else
+using boost::cmatch;
+#endif
 
 // TODO: in no particular order
 // - get rid of the extern BufferList and the call to
@@ -104,18 +109,18 @@ void LaTeX::deleteFilesOnError() const
 
        // but the reason for the error might be in a generated file...
 
-       string ofname = OnlyFilename(file);
+       string const ofname = OnlyFilename(file);
 
        // bibtex file
-       string bbl = ChangeExtension(ofname, ".bbl");
+       string const bbl = ChangeExtension(ofname, ".bbl");
        lyx::unlink(bbl);
 
        // makeindex file
-       string ind = ChangeExtension(ofname, ".ind");
+       string const ind = ChangeExtension(ofname, ".ind");
        lyx::unlink(ind);
 
        // Also remove the aux file
-       string aux = ChangeExtension(ofname, ".aux");
+       string const aux = ChangeExtension(ofname, ".aux");
        lyx::unlink(aux);
 }
 
@@ -130,7 +135,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
        int scanres = NO_ERRORS;
        unsigned int count = 0; // number of times run
        num_errors = 0; // just to make sure.
-       const unsigned int MAX_RUN = 6;
+       unsigned int const MAX_RUN = 6;
        DepTable head; // empty head
        bool rerun = false; // rerun requested
 
@@ -198,7 +203,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
        if (lfun) {
                ostringstream str;
                str << _("LaTeX run number") << ' ' << count;
-               lfun->dispatch(FuncRequest(LFUN_MESSAGE, str.str().c_str()));
+               lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
        }
 
        this->operator()();
@@ -284,7 +289,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                        ostringstream str;
                        str << _("LaTeX run number") << ' ' << count;
                        // check lyxstring string stream and gcc 3.1 before fixing
-                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, str.str().c_str()));
+                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
                }
 
                this->operator()();
@@ -340,7 +345,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                if (lfun) {
                        ostringstream str;
                        str << _("LaTeX run number") << ' ' << count;
-                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, str.str().c_str()));
+                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
                }
 
                this->operator()();
@@ -432,9 +437,13 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
 
        while (getline(ifs, token)) {
                token = rtrim(token, "\r");
+#ifndef USE_INCLUDED_STRING
                smatch sub;
-               if (regex_match(token, sub, reg1)) {
-                       string data = sub.str(1);
+#else
+               cmatch sub;
+#endif
+               if (regex_match(STRCONV(token), sub, reg1)) {
+                       string data = STRCONV(sub.str(1));
                        while (!data.empty()) {
                                string citation;
                                data = split(data, citation, ',');
@@ -442,8 +451,8 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
                                                     << citation << endl;
                                aux_info.citations.insert(citation);
                        }
-               } else if (regex_match(token, sub, reg2)) {
-                       string data = sub.str(1);
+               } else if (regex_match(STRCONV(token), sub, reg2)) {
+                       string data = sub.STRCONV(str(1));
                        // data is now all the bib files separated by ','
                        // get them one by one and pass them to the helper
                        while (!data.empty()) {
@@ -454,16 +463,16 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
                                                     << database << "'" << endl;
                                aux_info.databases.insert(database);
                        }
-               } else if (regex_match(token, sub, reg3)) {
-                       string style = sub.str(1);
+               } else if (regex_match(STRCONV(token), sub, reg3)) {
+                       string style = STRCONV(sub.str(1));
                        // token is now the style file
                        // pass it to the helper
                        style = ChangeExtension(style, "bst");
                        lyxerr[Debug::LATEX] << "Bibtex style: `"
                                             << style << "'" << endl;
                        aux_info.styles.insert(style);
-               } else if (regex_match(token, sub, reg4)) {
-                       string file2 = sub.str(1);
+               } else if (regex_match(STRCONV(token), sub, reg4)) {
+                       string const file2 = STRCONV(sub.str(1));
                        scanAuxFile(file2, aux_info);
                }
        }
@@ -683,17 +692,21 @@ void LaTeX::deplog(DepTable & head)
                token = rtrim(token, "\r");
                if (token.empty()) continue;
 
+#ifndef USE_INCLUDED_STRING
                smatch sub;
-               if (regex_match(token, sub, reg1)) {
-                       foundfile = sub.str(1);
-               } else if (regex_match(token, sub, reg2)) {
-                       foundfile = sub.str(1);
-               } else if (regex_match(token, sub, reg3)) {
-                       foundfile = sub.str(1);
-               } else if (regex_match(token, sub, reg4)) {
-                       foundfile = sub.str(1);
-               } else if (regex_match(token, sub, reg5)) {
-                       foundfile = sub.str(1);
+#else
+               cmatch sub;
+#endif
+               if (regex_match(STRCONV(token), sub, reg1)) {
+                       foundfile = STRCONV(sub.str(1));
+               } else if (regex_match(STRCONV(token), sub, reg2)) {
+                       foundfile = STRCONV(sub.str(1));
+               } else if (regex_match(STRCONV(token), sub, reg3)) {
+                       foundfile = STRCONV(sub.str(1));
+               } else if (regex_match(STRCONV(token), sub, reg4)) {
+                       foundfile = STRCONV(sub.str(1));
+               } else if (regex_match(STRCONV(token), sub, reg5)) {
+                       foundfile = STRCONV(sub.str(1));
                } else {
                        continue;
                }
@@ -726,7 +739,7 @@ void LaTeX::deplog(DepTable & head)
                // (2) foundfile is in the tmpdir
                //     insert it into head
                else if (FileInfo(OnlyFilename(foundfile)).exist()) {
-                       if (regex_match(foundfile, unwanted)) {
+                       if (regex_match(STRCONV(foundfile), unwanted)) {
                                lyxerr[Debug::DEPEND]
                                        << "We don't want "
                                        << OnlyFilename(foundfile)
index d9d53774a95a7c96e855bcf94ee94599d18b1c49..c6e65beb99fa6434055c5752ebb3c4aad0858a7f 100644 (file)
@@ -145,7 +145,7 @@ string LaTeXFeatures::getLanguages() const
             ++cit)
                languages << (*cit)->babel() << ',';
 
-       return languages.str().c_str();
+       return STRCONV(languages.str());
 }
 
 
@@ -289,7 +289,7 @@ string const LaTeXFeatures::getPackages() const
 
        packages << externalPreambles;
 
-       return packages.str().c_str();
+       return STRCONV(packages.str());
 }
 
 
@@ -346,7 +346,7 @@ string const LaTeXFeatures::getMacros() const
        // floats
        getFloatDefinitions(macros);
 
-       return macros.str().c_str();
+       return STRCONV(macros.str());
 }
 
 
@@ -361,7 +361,7 @@ string const LaTeXFeatures::getBabelOptions() const
        if (!params.language->latex_options().empty())
                tmp << params.language->latex_options() << '\n';
 
-       return tmp.str().c_str();
+       return STRCONV(tmp.str());
 }
 
 
@@ -379,7 +379,7 @@ string const LaTeXFeatures::getTClassPreamble() const
                tcpreamble << tclass[*cit]->preamble();
        }
 
-       return tcpreamble.str().c_str();
+       return STRCONV(tcpreamble.str());
 }
 
 
@@ -392,7 +392,7 @@ string const LaTeXFeatures::getLyXSGMLEntities() const
                entities << "<!ENTITY lyxarrow \"-&gt;\">" << '\n';
        }
 
-       return entities.str().c_str();
+       return STRCONV(entities.str());
 }
 
 
@@ -408,7 +408,7 @@ string const LaTeXFeatures::getIncludedFiles(string const & fname) const
                             << (IsSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
                             << MakeRelPath(fi->second, basename) << "\">";
 
-       return sgmlpreamble.str().c_str();
+       return STRCONV(sgmlpreamble.str());
 }
 
 
index 1bbb945f9f48e51ad0f743c3d2c349c9ca4f1f3b..26ef6edf13d7e17ef48bdf4276a4823adeb9305f 100644 (file)
@@ -92,7 +92,7 @@ string const Spacing::writeEnvirBegin() const
                ostringstream ost;
                ost << "\\begin{spacing}{"
                    << getValue() << "}";
-               return ost.str().c_str();
+               return STRCONV(ost.str());
        }
        }
        return string();
index 1b927116695d30263c2aa1733026a7d6447e1d95..fba66f3317f66cbe9b045d6fc37140bcb6b5aca9 100644 (file)
@@ -1180,7 +1180,7 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, Paragraph * par)
                                                               "running the conversion script."));
                                                return false;
                                        }
-                                       istringstream is(ret.second);
+                                       istringstream is(STRCONV(ret.second));
                                        LyXLex tmplex(0, 0);
                                        tmplex.setStream(is);
                                        return readFile(tmplex, string());
@@ -1588,7 +1588,7 @@ string const Buffer::asciiParagraph(Paragraph const & par,
                }
        }
        buffer << word;
-       return buffer.str().c_str();
+       return STRCONV(buffer.str());
 }
 
 
@@ -1775,7 +1775,7 @@ void Buffer::makeLaTeXFile(ostream & os,
                        options << params.options << ',';
                }
 
-               string strOptions(options.str().c_str());
+               string strOptions(STRCONV(options.str()));
                if (!strOptions.empty()) {
                        strOptions = rtrim(strOptions, ",");
                        os << '[' << strOptions << ']';
@@ -2055,7 +2055,7 @@ void Buffer::makeLaTeXFile(ostream & os,
                        if (!lyxrc.language_global_options
                            && tmp == "\\usepackage{babel}")
                                tmp = string("\\usepackage[") +
-                                       language_options.str().c_str() +
+                                       STRCONV(language_options.str()) +
                                        "]{babel}";
                        preamble += tmp + "\n";
                        preamble += features.getBabelOptions();
index 448f17788487fadfa6776aac73556d73592a5e9d..2cea22311554297077311928916bc06837e6e5f3 100644 (file)
@@ -194,7 +194,7 @@ string const currentState(BufferView * bv)
 #ifdef DEVEL_VERSION
        state << _(", Paragraph: ") << text->cursor.par()->id();
 #endif
-       return state.str().c_str();
+       return STRCONV(state.str());
 }
 
 
index d0258c51e826a80cd56b9ad4706c7f4b86f033b6..20e28319c5bb4b3b01cbb0ff5178bfb123de6015 100644 (file)
@@ -20,7 +20,13 @@ using std::make_pair;
 using std::endl;
 using boost::regex;
 using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
 using boost::smatch;
+#else
+using boost::cmatch;
+#endif
+
 
 
 bool CharacterSet::loadFile(string const & fname)
@@ -50,10 +56,14 @@ bool CharacterSet::loadFile(string const & fname)
        // without the use of a keyword table.
        regex reg("^([12][0-9][0-9])[ \t]+\"([^ ]+)\".*");
        while (getline(ifs, line)) {
+#ifndef USE_INCLUDED_STRING
                smatch sub;
-               if (regex_match(line, sub, reg)) {
-                       int const n = lyx::atoi(sub.str(1));
-                       string const str = sub.str(2);
+#else
+               cmatch sub;
+#endif
+               if (regex_match(STRCONV(line), sub, reg)) {
+                       int const n = lyx::atoi(STRCONV(sub.str(1)));
+                       string const str = STRCONV(sub.str(2));
                        if (lyxerr.debugging(Debug::KBMAP))
                                lyxerr << "Chardef: " << n
                                       << " to [" << str << "]" << endl;
index 8203a98ceaec6583467fdeae9b4404d1c6af576a..cc5d3328ee46609ca81cc402ebdc53b0efb3cfe9 100644 (file)
@@ -278,7 +278,8 @@ string Counters::labelItem(string const & ctr,
                }
                s << o.str();
        }
-       return s.str();
+
+       return STRCONV(s.str());
 }
 
 
@@ -287,7 +288,8 @@ string Counters::numberLabel(string const & ctr,
                             string const & langtype,
                             int head)
 {
-       ostringstream s, o;
+       ostringstream s;
+
        if (numbertype == "sectioning" || numbertype == "appendix") {
                if (ctr == "chapter" && head == 0) {
                        s << labelItem("chapter", numbertype, langtype, true);
@@ -340,5 +342,6 @@ string Counters::numberLabel(string const & ctr,
                        s << eiv.str();
                }
        }
-       return s.str();
+
+       return STRCONV(s.str());
 }
index f34d9b88f1d912f676e78390b6fd1aac94cc8ef5..0b094d62ad1c24892ea3a8cb4a4a9d6366bae859 100644 (file)
@@ -1,3 +1,7 @@
+2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * lyx_gui.h: do not use std:: on string
+
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * lyx_gui.h: reindent a bit, change signeture on lyx_gui::start.
index f540ce35697513a38539b874fb26919e8b09be4e..193a1067bceb7703e8e052579dbcc9c0c252f852 100644 (file)
@@ -1,5 +1,10 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * biblio.C (regexSearch): STRCONV
+       (getInfo): ditto
+
+       * ControlAboutlyx.C (getVersion): STRCONV
+
        * ControlMath.C: include config.h
 
 2002-10-31  John Levon  <levon@movementarian.org>
index 0a2fdf20510c7397f7d2d5667231c43e71f0e29e..6531654fb9dddd4e232141fb94f948100e266c86 100644 (file)
@@ -91,5 +91,5 @@ string const ControlAboutlyx::getVersion() const
           << _("User directory: ")
           << MakeDisplayPath(user_lyxdir);
 
-       return ss.str().c_str();
+       return STRCONV(ss.str());
 }
index 5c2371a5bc6ad7de6584711f458f1e8d14119416..60c61ad849881f88bfea70e89a5cc3765508b2e7 100644 (file)
@@ -118,7 +118,7 @@ regexSearch(InfoMap const & theMap,
            vector<string>::const_iterator start,
            Direction dir)
 {
-       boost::regex reg(expr);
+       boost::regex reg(STRCONV(expr));
 
        for (vector<string>::const_iterator it = start;
             // End condition is direction-dependent.
@@ -131,7 +131,7 @@ regexSearch(InfoMap const & theMap,
                if (info != theMap.end())
                        data += " " + info->second;
 
-               if (boost::regex_match(data, reg)) {
+               if (boost::regex_match(STRCONV(data), reg)) {
                        return it;
                }
        }
@@ -336,7 +336,7 @@ string const getInfo(InfoMap const & map, string const & key)
        if (!year.empty())
                result << ", " << year;
 
-       string const result_str = rtrim(result.str().c_str());
+       string const result_str = rtrim(STRCONV(result.str()));
        if (!result_str.empty())
                return result_str;
 
index efecce720b1bd0eefa7904759bf5e813a4d46f88..1df4a355fcefc6f16d4973b2c807950ab5e0d6d1 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Michael Koziarski 
+ * \author Michael Koziarski
  *
  * Full author contact details are available in file CREDITS
  */
@@ -59,21 +59,21 @@ void GAbout::update()
        cr += controller().getDisclaimer();
        copyright()->get_buffer()->set_text(cr);
 
-       
+
 
        version()->set_text(controller().getVersion());
 
        stringstream in;
        controller().getCredits(in);
 
-       istringstream ss(in.str().c_str());
+       istringstream ss(in.str());
 
        string s;
        string out;
        Gtk::TextIter  e;
 
        while (getline(ss, s)) {
-       
+
                if (prefixIs(s, "@b"))
                        out += s.substr(2);
                else if (prefixIs(s, "@i"))
@@ -88,19 +88,19 @@ void GAbout::update()
 
 
 
-Gtk::Button * GAbout::close_btn() const 
+Gtk::Button * GAbout::close_btn() const
 {
-        return getWidget<Gtk::Button>("r_close_btn");
+       return getWidget<Gtk::Button>("r_close_btn");
 }
-Gtk::Label * GAbout::version() const 
+Gtk::Label * GAbout::version() const
 {
-        return getWidget<Gtk::Label>("r_version");
+       return getWidget<Gtk::Label>("r_version");
 }
-Gtk::TextView * GAbout::credits() const 
+Gtk::TextView * GAbout::credits() const
 {
-        return getWidget<Gtk::TextView>("r_credits");
+       return getWidget<Gtk::TextView>("r_credits");
 }
-Gtk::TextView * GAbout::copyright() const 
+Gtk::TextView * GAbout::copyright() const
 {
-        return getWidget<Gtk::TextView>("r_copyright");
+       return getWidget<Gtk::TextView>("r_copyright");
 }
index 0ebcebbb093f368da70583c9b9f406e190f7a30d..5885a16ae1bf3bfe5a4eb1f5cfd2e9804d6f38c1 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "LColor.h"
 #include "LString.h"
+
 #include <vector>
 
 class Dialogs;
@@ -36,7 +37,7 @@ void parse_lyxrc();
  * Start the main event loop, after executing the given
  * batch commands, and loading the given documents
  */
-void start(string const & batch, std::vector<std::string> const & files);
+void start(string const & batch, std::vector<string> const & files);
 
 /**
  * quit running LyX
@@ -70,6 +71,7 @@ void set_read_callback(int fd, LyXComm * comm);
 
 /**
  * remove a I/O read callback
+ * @param fd file descriptor
  */
 void remove_read_callback(int fd);
 
index 5b20ee25e5d1196dbb441b73a40a0b4b53850bdf..dbb55883d65e844dd32d9199f26fb267eb6811a4 100644 (file)
@@ -1,5 +1,7 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * QAbout.C (build_dialog): do not use str().c_str() when not needed.
+
        * qttableview.C: include config.h
 
        * lyx_gui.C: move includes around a bit
index 8c7dfd943d6f689847c449c585f574ace248325e..c04d3499244ceb6a1476ad0ffc70cfcc31fa992f 100644 (file)
@@ -64,7 +64,7 @@ void QAbout::build_dialog()
        ostringstream in;
        controller().getCredits(in);
 
-       istringstream ss(in.str().c_str());
+       istringstream ss(in.str());
 
        string s;
        ostringstream out;
index 7548a960c4390297f645d31f2b1ec5bc2cbde9be..ae6a09912a406e98b180f0e5480e53b7f6ddaf21 100644 (file)
@@ -1,5 +1,13 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * lyx_gui.C (hexname): STRCONV
+
+       * FormPreferences.C (X11hexname): STRCONV
+
+       * FormMathsMatrix.C (apply): STRCONV
+
+       * FormMathsDelim.C (apply): STRCONV
+
        * lyx_gui.C (start): adjust signature
        (start): exchange magic integeres for defined values.
 
index dedf4b58b397d1e0d1811cfe8fc96ba83db4ae0d..bcd6e047fd22a3feeb2560963206d1286533392d 100644 (file)
@@ -26,8 +26,6 @@
 
 #include FORMS_H_LOCATION
 
-using std::string;
-
 
 typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
 
@@ -50,7 +48,7 @@ void FormAboutlyx::build()
        fl_add_browser_line(version_->browser_version, vs.str().c_str());
 
        // create credits tab
-       credits_.reset(build_aboutlyx_credits(this));
+       credits_.reset(build_aboutlyx_credits(this));
 
        ostringstream crs;
        controller().getCredits(crs);
@@ -73,7 +71,7 @@ void FormAboutlyx::build()
                           version_->form);
        fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
                           credits_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("License"), 
+       fl_addto_tabfolder(dialog_->tabfolder, _("License"),
                           license_->form);
 
        // work-around xforms bug re update of folder->x, folder->y coords.
index 8e8a5c52730597b04e10a27866e2e7ab95818e41..5a5542a444313ffc54497438d5d0c28ff3ec01ef 100644 (file)
@@ -6,7 +6,7 @@
  * \author Alejandro Aguilar Sierra
  * \author Pablo De Napoli
  * \author John Levon
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -103,7 +103,7 @@ void FormMathsDelim::apply()
        ostringstream os;
        os << delim_values[left] << ' ' << delim_values[right];
 
-       lv_.dispatch(FuncRequest(LFUN_MATH_DELIM, os.str().c_str()));
+       lv_.dispatch(FuncRequest(LFUN_MATH_DELIM, STRCONV(os.str())));
 }
 
 
@@ -136,13 +136,13 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
                }
        }
 
-       // Re-initialize button_pix to solid blue 
+       // Re-initialize button_pix to solid blue
        // (not elegant but works, MV 24.5.2002)
        fl_free_pixmap_pixmap(dialog_->button_pix);
        fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim1));
        Pixmap p1;
        fl_get_pixmap_pixmap(dialog_->button_pix, &p1, 0);
-       
+
        fl_draw_bmtable_item(dialog_->bmtable, left, p1, 0, 0);
        fl_draw_bmtable_item(dialog_->bmtable, right, p1, 16, 0);
        fl_redraw_object(dialog_->button_pix);
index 7f8f4cd29039881fa7c8b3dfb91db1d7360561f5..db68165677d35c230ddc54bf2578ca1be9fb5e10 100644 (file)
@@ -6,7 +6,7 @@
  * \author Alejandro Aguilar Sierra
  * \author Pablo De Napoli
  * \author John Levon
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -106,7 +106,7 @@ void FormMathsMatrix::apply()
        ostringstream os;
        os << nx << ' ' << ny << ' ' << c << ' ' << sh;
 
-       lv_.dispatch(FuncRequest(LFUN_INSERT_MATRIX, os.str().c_str()));
+       lv_.dispatch(FuncRequest(LFUN_INSERT_MATRIX, STRCONV(os.str())));
 }
 
 
index 0bf440b5f02641e3ab549a6fc9132eac789a9651..3df959142afc141350397172885609c686f00516 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -911,7 +911,7 @@ string const FormPreferences::Colors::X11hexname(RGBColor const & col) const
             << setw(2) << col.g
             << setw(2) << col.b;
 
-       return ostr.str().c_str();
+       return STRCONV(ostr.str());
 }
 
 
@@ -1871,7 +1871,7 @@ void FormPreferences::LnFmisc::build()
        setPrehandler(dialog_->check_dialogs_iconify_with_main);
        setPrehandler(dialog_->check_preview_latex);
        setPrehandler(dialog_->counter_wm_jump);
-       
+
        fl_addto_choice(dialog_->choice_display, _("Monochrome|Grayscale|Color|Do not display"));
 }
 
index 948afbaf45a189687806fa6189f8bd06333dc8dc..2c6be8eeb7bd570ac8cface9a308b9340e9c169e 100644 (file)
@@ -35,6 +35,5 @@ void FormVCLog::update()
        ostringstream ss;
        controller().getVCLogFile(ss);
 
-       fl_add_browser_line(dialog_->browser,
-                           ss.str().c_str());
+       fl_add_browser_line(dialog_->browser, ss.str().c_str());
 }
index 42818e8c10cb51fae71e97f1ab6afd9c38a5f939..7713c528225e2613f92bb6836ebecece61a31729 100644 (file)
@@ -249,7 +249,7 @@ void lyx_gui::start(string const & batch, vector<string> const & files)
 
        int const geometryBitmask =
                XParseGeometry(geometry,
-                               &xpos, &ypos, &width, &height);
+                              &xpos, &ypos, &width, &height);
 
        // if width is not set by geometry, check it against monitor width
        if (!(geometryBitmask & WidthValue)) {
@@ -353,7 +353,7 @@ string const lyx_gui::hexname(LColor::color col)
           << setw(2) << (xcol.green / 256)
           << setw(2) << (xcol.blue  / 256);
 
-       return os.str().c_str();
+       return STRCONV(os.str());
 }
 
 
index d1a8a300299156825e92fe074f93d0b1a66aa96e..390680e43d10ffd812ea95bb7720dbbcd6a35a1c 100644 (file)
@@ -1,5 +1,11 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * PreviewLoader.C (IncrementedFileName): STRCONV
+       (startLoading): ditto
+
+       * GraphicsConverter.C (Impl): STRCONV
+       (move_file): ditto
+
        * GraphicsTypes.C: include config.h
 
 2002-10-25  Angus Leeming  <leeming@lyx.org>
index 2ca7e1cacf519c16dac99acf52685737cba8a541..c8fda70f563892b7a0ebb7a003881ecd26b5d073 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- *  \author Angus Leeming 
+ *  \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -161,7 +161,7 @@ Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
 
                lyxerr[Debug::GRAPHICS] << "\tConversion script:"
                                << "\n--------------------------------------\n"
-                               << script.str().c_str()
+                               << STRCONV(script.str())
                                << "\n--------------------------------------\n";
 
                // Output the script to file.
@@ -173,7 +173,7 @@ Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
                if (!fs.good())
                        return;
 
-               fs << script.str().c_str();
+               fs << STRCONV(script.str());
                fs.close();
 
                // The command needed to run the conversion process
@@ -251,7 +251,7 @@ string const move_file(string const & from_file, string const & to_file)
                << "\t'rm' -f ${fromfile}\n"
                << "fi\n";
 
-       return command.str().c_str();
+       return STRCONV(command.str());
 }
 
 
index be5c4b3b81eeda318bd0e3dfab31cfc2a9f10ad5..274803ea496f96d6a6f152217ff6ce638c9e319c 100644 (file)
@@ -3,8 +3,8 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Baruch Even 
- * \author Angus Leeming 
+ * \author Baruch Even
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
index b8533eba811ca0b311da3617ddc6bb88e1e6efbc..20f57bf2999acca08fe32e9183d3cbbf732f1b8c 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -258,7 +258,7 @@ struct IncrementedFileName {
        {
                ostringstream os;
                os << base_ << counter_++ << "." << to_format_;
-               string const file = os.str().c_str();
+               string const file = STRCONV(os.str());
 
                return make_pair(snippet, file);
        }
@@ -281,7 +281,7 @@ InProgress::InProgress(string const & filename_base,
        PendingSnippets::const_iterator pend = pending.end();
        BitmapFile::iterator sit = snippets.begin();
 
-       std::transform(pit, pend, sit, 
+       std::transform(pit, pend, sit,
                       IncrementedFileName(to_format, filename_base));
 }
 
@@ -478,7 +478,7 @@ void PreviewLoader::Impl::startLoading()
        cs << pconverter_->command << " " << latexfile << " "
           << int(font_scaling_factor_) << " " << pconverter_->to;
 
-       string const command = "sh " + LibScriptSearch(cs.str().c_str());
+       string const command = "sh " + LibScriptSearch(STRCONV(cs.str()));
 
        // Initiate the conversion from LaTeX to bitmap images files.
        Forkedcall::SignalTypePtr convert_ptr(new Forkedcall::SignalType);
index f70b2295ace2ca359379ed7caccac04ff0d0ba2a..03eb4002b92be0dc35a300a86a8c16468c248f9c 100644 (file)
@@ -40,7 +40,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
        string const displaypath = MakeDisplayPath(filename);
        ostringstream s1;
        s1 << _("Importing") << ' ' << displaypath << "...";
-       lv->message(s1.str().c_str());
+       lv->message(STRCONV(s1.str()));
 
        string const lyxfile = ChangeExtension(filename, ".lyx");
 
index 14f583a99d618aa156f71e1c5769641195b41a8c..95dd6517fd41dd92a0fe31e1c68826b89deebfa0 100644 (file)
@@ -1,5 +1,13 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * insettabular.C (copySelection): STRCONV
+
+       * insetinclude.C (uniqueID): STRCONV
+       (latexString): ditto
+
+       * insetgraphics.C: put VersionNumber inside anon namespace
+       (createLatexOptions): STRCONV
+
        * insetcommandparams.C: include config.h
 
 2002-10-31  Rob Lahaye  <lahaye@snu.ac.kr>
index dd92daaba04fa6196e82a5987df42c65a3c0550c..cbcd6c8d208d29bf7cdf274cdb64c8031004d644 100644 (file)
@@ -100,12 +100,13 @@ extern string system_tempdir;
 using std::ostream;
 using std::endl;
 
+
+namespace {
+
 ///////////////////////////////////////////////////////////////////////////
 int const VersionNumber = 1;
 ///////////////////////////////////////////////////////////////////////////
 
-namespace {
-
 // This function is a utility function
 // ... that should be with ChangeExtension ...
 inline
@@ -114,10 +115,6 @@ string const RemoveExtension(string const & filename)
        return ChangeExtension(filename, string());
 }
 
-} // namespace anon
-
-
-namespace {
 
 string const uniqueID()
 {
@@ -127,7 +124,30 @@ string const uniqueID()
        ost << "graph" << ++seed;
 
        // Needed if we use lyxstring.
-       return ost.str().c_str();
+       return STRCONV(ost.str());
+}
+
+
+string findTargetFormat(string const & suffix)
+{
+       // lyxrc.pdf_mode means:
+       // Are we creating a PDF or a PS file?
+       // (Should actually mean, are we using latex or pdflatex).
+       if (lyxrc.pdf_mode) {
+               lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode\n";
+               if (contains(suffix, "ps") || suffix == "pdf")
+                       return "pdf";
+               else if (suffix == "jpg")       // pdflatex can use jpeg
+                       return suffix;
+               else
+                       return "png";           // and also png
+       }
+       // If it's postscript, we always do eps.
+       lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode\n";
+       if (suffix != "ps")                     // any other than ps
+           return "eps";                       // is changed to eps
+       else
+           return suffix;                      // let ps untouched
 }
 
 } // namespace anon
@@ -468,7 +488,6 @@ string const InsetGraphics::createLatexOptions() const
            options << "  draft,\n";
        if (params().clip)
            options << "  clip,\n";
-       
        if (!lyx::float_equal(params().scale, 0.0, 0.05)) {
                if (!lyx::float_equal(params().scale, 100.0, 0.05))
                        options << "  scale=" << params().scale / 100.0
@@ -479,7 +498,7 @@ string const InsetGraphics::createLatexOptions() const
                if (!params().height.zero())
                        options << "  height=" << params().height.asLatexString() << ",\n";
                if (params().keepAspectRatio)
-                       options << "  keepaspectratio,\n";
+                       options << "  keepaspectratio,\n";
        }
 
        // Make sure rotation angle is not very close to zero;
@@ -501,37 +520,13 @@ string const InsetGraphics::createLatexOptions() const
        if (!params().special.empty())
            options << params().special << ",\n";
 
-       string opts = options.str().c_str();
-       return opts.substr(0,opts.size()-2);    // delete last ",\n"
-}
-
-namespace {
-string findTargetFormat(string const & suffix)
-{
-       // lyxrc.pdf_mode means:
-       // Are we creating a PDF or a PS file?
-       // (Should actually mean, are we using latex or pdflatex).
-       if (lyxrc.pdf_mode) {
-               lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode\n";
-               if (contains(suffix, "ps") || suffix == "pdf")
-                       return "pdf";
-               else if (suffix == "jpg")       // pdflatex can use jpeg
-                       return suffix;
-               else
-                       return "png";           // and also png
-       }
-       // If it's postscript, we always do eps.
-       lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode\n";
-       if (suffix != "ps")                     // any other than ps
-           return "eps";                       // is changed to eps
-       else
-           return suffix;                      // let ps untouched
+       string opts = STRCONV(options.str());
+       // delete last ",\n"
+       return opts.substr(0, opts.size() - 2);
 }
 
-} // Anon. namespace
-
 
-string const InsetGraphics::prepareFile(Buffer const *buf) const
+string const InsetGraphics::prepareFile(Buffer const * buf) const
 {
        // LaTeX can cope if the graphics file doesn't exist, so just return the
        // filename.
index 3854c950983f7dc0a456936d8567b3d1f47c5f9e..4aea2aee1b4185f4ebfecc18bbc529974e326c64 100644 (file)
@@ -86,7 +86,7 @@ string const uniqueID()
        ost << "file" << ++seed;
 
        // Needed if we use lyxstring.
-       return ost.str().c_str();
+       return STRCONV(ost.str());
 }
 
 } // namespace anon
@@ -554,7 +554,7 @@ string const InsetInclude::PreviewImpl::latexString() const
        ostringstream os;
        parent().latex(view()->buffer(), os, false, false);
 
-       return os.str().c_str();
+       return STRCONV(os.str());
 }
 
 
index fb01fa30155f0e09c68a0f016799bae0d5b1dacc..79a3fef505907f025585f16b7d28d3b15cd37b28 100644 (file)
@@ -2529,7 +2529,7 @@ bool InsetTabular::copySelection(BufferView * bv)
        ostringstream sstr;
        paste_tabular->ascii(bv->buffer(), sstr,
                             (int)parOwner()->params().depth(), true, '\t');
-       bv->stuffClipboard(sstr.str().c_str());
+       bv->stuffClipboard(STRCONV(sstr.str()));
        return true;
 }
 
index 3c50f3e0ac99062d18b1d574526af8565b64c6d1..61efafa627321354eaa2a5d44611b255d895275a 100644 (file)
@@ -91,7 +91,7 @@ LyX::LyX(int & argc, char * argv[])
        // if this should not be in this file, please also remove
        // #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
        grfx::setDisplayTranslator();
-       
+
        if (want_gui) {
                lyx_gui::parse_init(argc, argv);
        }
index 7a04c7177e54783cf96254fbec3d987a10963fc9..5a11937436819b30783bbafc5945b5078e765239 100644 (file)
@@ -539,7 +539,7 @@ string const LyXFont::stateText(BufferParams * params) const
        if (number() != OFF)
                ost << _("  Number ") << _(GUIMiscNames[number()]);
 
-       string buf(ost.str().c_str());
+       string buf(STRCONV(ost.str()));
        buf = rtrim(buf, ", ");
        return buf;
 }
index 85eaa63d5c6eaa9288889b2631005040622202e2..f4208f820c55898c386639c48a3dbd1353b26014 100644 (file)
@@ -160,7 +160,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
                       << keysym->getSymbolName()
                       << endl;
        }
+
        // Do nothing if we have nothing (JMarc)
        if (!keysym->isOK()) {
                lyxerr[Debug::KEY] << "Empty kbd action (probably composing)"
@@ -948,10 +948,10 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        ostringstream s1;
                        s1 << _("Saving document") << ' '
                           << MakeDisplayPath(owner->buffer()->fileName() + "...");
-                       owner->message(s1.str().c_str());
+                       owner->message(STRCONV(s1.str()));
                        MenuWrite(view(), owner->buffer());
                        s1 << _(" done.");
-                       owner->message(s1.str().c_str());
+                       owner->message(STRCONV(s1.str()));
                } else
                        WriteAs(view(), owner->buffer());
                break;
@@ -1106,7 +1106,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                ostringstream str;
                str << _("Opening help file") << ' '
                    << MakeDisplayPath(fname) << "...";
-               owner->message(str.str().c_str());
+               owner->message(STRCONV(str.str()));
                view()->buffer(bufferlist.loadLyXFile(fname, false));
                owner->allowInput();
                break;
@@ -1675,19 +1675,17 @@ void LyXFunc::open(string const & fname)
        ostringstream str;
        str << _("Opening document") << ' ' << disp_fn << "...";
 
-       owner->message(str.str().c_str());
+       owner->message(STRCONV(str.str()));
 
        Buffer * openbuf = bufferlist.loadLyXFile(filename);
+       ostringstream str2;
        if (openbuf) {
                view()->buffer(openbuf);
-               ostringstream str;
-               str << _("Document") << ' ' << disp_fn << ' ' << _("opened.");
-               owner->message(str.str().c_str());
+               str2 << _("Document") << ' ' << disp_fn << ' ' << _("opened.");
        } else {
-               ostringstream str;
-               str << _("Could not open document") << ' ' << disp_fn;
-               owner->message(str.str().c_str());
+               str2 << _("Could not open document") << ' ' << disp_fn;
        }
+       owner->message(STRCONV(str2.str()));
 }
 
 
index fd1cf48565f725efdeec5451932037970a615681..ae56a832689dc1a2902fd1f503d45d6615fe9e1b 100644 (file)
@@ -45,45 +45,45 @@ string const LyXGlueLength::asString() const
 
        if (plus_.zero() && minus_.zero()) {
                buffer << unit_name[len_.unit()];
-               return buffer.str().c_str();
+               return STRCONV(buffer.str());
        }
+
        // just len and plus
        if (minus_.zero()) {
                if (len_.unit() != plus_.unit())
                        buffer << unit_name[len_.unit()];
                buffer << "+" << plus_.value();
                buffer << unit_name[plus_.unit()];
-               return buffer.str().c_str();
+               return STRCONV(buffer.str());
        }
+
        // just len and minus
        if (plus_.zero()) {
                if (len_.unit() != minus_.unit())
                        buffer << unit_name[len_.unit()];
                buffer << "-" << minus_.value();
                buffer << unit_name[minus_.unit()];
-               return buffer.str().c_str();
+               return STRCONV(buffer.str());
        }
 
        // ok, len, plus AND minus
+
        // len+-
        if (minus_ == plus_) {
                if (len_.unit() != minus_.unit())
                        buffer << unit_name[len_.unit()];
                buffer << "+-" << minus_.value();
                buffer << unit_name[minus_.unit()];
-               return buffer.str().c_str();
+               return STRCONV(buffer.str());
        }
+
        // this is so rare a case, why bother minimising units ?
 
        buffer << unit_name[len_.unit()];
        buffer << "+" << plus_.value() << unit_name[plus_.unit()];
        buffer << "-" << minus_.value() << unit_name[minus_.unit()];
-       return buffer.str().c_str();
+
+       return STRCONV(buffer.str());
 }
 
 
@@ -92,12 +92,12 @@ string const LyXGlueLength::asLatexString() const
        ostringstream buffer;
 
        buffer << len_.value() << unit_name[len_.unit()];
+
        if (!plus_.zero())
                buffer << " plus " << plus_.value() << unit_name[plus_.unit()];
        if (!minus_.zero())
                buffer << " minus " << minus_.value() << unit_name[minus_.unit()];
-       return buffer.str().c_str();
+       return STRCONV(buffer.str());
 }
 
 
index 40eb3b5d06b72a1a2a114c7c93543c3d24ebee45..2e16c84ed3ea28f122cd381397dfbcd31f59d159 100644 (file)
@@ -53,7 +53,7 @@ string const LyXLength::asString() const
 {
        ostringstream buffer;
        buffer << val_ << unit_name[unit_]; // setw?
-       return buffer.str().c_str();
+       return STRCONV(buffer.str());
 }
 
 
@@ -89,7 +89,7 @@ string const LyXLength::asLatexString() const
            buffer << val_ << unit_name[unit_]; // setw?
            break;
        }
-       return buffer.str().c_str();
+       return STRCONV(buffer.str());
 }
 
 
@@ -134,7 +134,7 @@ int LyXLength::inPixels(int text_width, int em_width_base) const
        double const em_width = (em_width_base > 0)
                ? em_width_base
                : 10*(dpi/72.27)*zoom;
-       // A different estimate for em_width is 
+       // A different estimate for em_width is
        // font_metrics::width('M', LyXFont(LyXFont::ALL_SANE))
        // but this estimate might not be more accurate as the screen font
        // is different then the latex font.
index 1c7f9a861df458eda8c401cb3997d000e4651948..d3776065d50523c9dc5d92e8ac9982a7e4987937 100644 (file)
@@ -1,5 +1,24 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * math_inset.C (asString): STRCONV
+
+       * math_factory.C (initSymbols): do not std:: qualify getline, use
+       empty() to check for empty string, STRCONV
+
+       * math_extern.C: STRCONV
+
+       * math_diminset.C (drawT): STRCONV
+
+       * math_cursor.C (info): STRCONV
+
+       * math_autocorrect.C (initAutoCorrect): STRCONV
+
+       * formulamacro.C (InsetFormulaMacro): STRCONV
+
+       * formulabase.C (localDispatch): STRCONV
+
+       * formula.C (latexString): STRCONV
+
        * math_factory.C: add using std::endl
        (math_font_available): use it
        (initSymbols): use it
index 4b8a9eaa76f0adcbea6e4a895ba33fa773a21a5a..440648d582a125b7bb92a9e1d2851617ac9817d0 100644 (file)
@@ -330,5 +330,5 @@ string const InsetFormula::PreviewImpl::latexString() const
        ostringstream ls;
        WriteStream wi(ls, false, false);
        parent().par_->write(wi);
-       return ls.str().c_str();
+       return STRCONV(ls.str());
 }
index 529719eb86262dd4ae02892bf69b6ec06b53a596..b8510d499bae545e7275d5b3558edfa582a72ac2 100644 (file)
@@ -310,7 +310,7 @@ Inset::RESULT InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
 
        if (cmd.button() == mouse_button::button3) {
                // try to dispatch to enclosed insets first
-               if (mathcursor->dispatch(cmd) == MathInset::UNDISPATCHED) {     
+               if (mathcursor->dispatch(cmd) == MathInset::UNDISPATCHED) {
                        // launch math panel for right mouse button
                        bv->owner()->getDialogs().showMathPanel();
                }
@@ -382,12 +382,12 @@ Inset::RESULT InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
                return DISPATCHED;
 
        // only select with button 1
-       if (cmd.button() != mouse_button::button1) 
+       if (cmd.button() != mouse_button::button1)
                return DISPATCHED;
 
        if (abs(cmd.x - first_x) < 2 && abs(cmd.y - first_y) < 2)
                return DISPATCHED;
-       
+
        first_x = cmd.x;
        first_y = cmd.y;
 
@@ -662,7 +662,7 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                unsigned int n = 1;
                string v_align;
                string h_align;
-               istringstream is(argument);
+               istringstream is(STRCONV(argument));
                is >> m >> n >> v_align >> h_align;
                m = max(1u, m);
                n = max(1u, n);
@@ -736,7 +736,7 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                mathcursor->niceInsert(argument);
                updateLocal(bv, true);
                break;
-       
+
        case -1:
        case LFUN_SELFINSERT:
                if (!argument.empty()) {
@@ -949,7 +949,7 @@ bool InsetFormulaBase::display() const
 
 string InsetFormulaBase::selectionAsString() const
 {
-       return mathcursor ? mathcursor->grabSelection() : string(); 
+       return mathcursor ? mathcursor->grabSelection() : string();
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -1025,13 +1025,13 @@ void mathDispatch(FuncRequest const & cmd)
                        }
                        break;
 
-               case LFUN_GREEK: 
-               case LFUN_INSERT_MATH: 
-               case LFUN_INSERT_MATRIX: 
+               case LFUN_GREEK:
+               case LFUN_INSERT_MATH:
+               case LFUN_INSERT_MATRIX:
                case LFUN_MATH_DELIM: {
                        InsetFormula * f = new InsetFormula(bv);
                        if (openNewInset(bv, f)) {
-                               bv->theLockingInset()-> 
+                               bv->theLockingInset()->
                                        localDispatch(FuncRequest(bv, LFUN_MATH_MUTATE, "simple"));
                                bv->theLockingInset()->localDispatch(cmd);
                        }
index 7c759d3432117aec80b201b0790aca68cec30f99..8bc0531c0b544ece3105c86647c31e6fe82979eb 100644 (file)
@@ -61,7 +61,7 @@ InsetFormulaMacro::InsetFormulaMacro(string const & name, int nargs)
 
 InsetFormulaMacro::InsetFormulaMacro(string const & s)
 {
-       std::istringstream is(s);
+       std::istringstream is(STRCONV(s));
        read(is);
 }
 
index c8ba7ca628199185ca5d24fd21231d55e9584c42..e279cb978b8abf538359ed06f2278dbc7664b5c1 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include <config.h>
@@ -146,7 +146,8 @@ void initAutoCorrect()
                        //lyxerr[Debug::MATHED] << "ignoring line '" << line << "'" << endl;
                        continue;
                }
-               istringstream il(line);
+               istringstream il(STRCONV(line));
+
                //lyxerr[Debug::MATHED] << "line '" << line << "'" << endl;
                Correction corr;
                if (corr.read(il)) {
index fec411d7b378680d5c6d35ca51c250c9650dafb9..b38fdab121c50b938a85d5d1755dcda43e4aaf8e 100644 (file)
@@ -1290,7 +1290,7 @@ string MathCursor::info() const
                if (prevAtom()->asSymbolInset() || prevAtom()->asScriptInset())
                        prevAtom()->infoize(os);
        os << "                    ";
-       return os.str().c_str(); // .c_str() needed for lyxstring
+       return STRCONV(os.str());
 }
 
 
index b851b75db950288c0a86e3c0f4d7770ad519fc8b..2e9e75ef71968ffc25dc8fe158623e62a520174e 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include "math_diminset.h"
@@ -28,6 +27,6 @@ void MathDimInset::drawT(TextPainter &, int, int) const
 /*
        std::ostringstream os;
        os << MathAtom(this);
-       pain.draw(x, y, os.str().c_str());
+       pain.draw(x, y, STRCONV(os.str()));
 */
 }
index ac84ace03428a9bedfa39229ae5d37fcb6d4dde3..8c887038f8de8d14249af818b3b016d264890044 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 // This file contains most of the magic that extracts "context
@@ -306,7 +305,7 @@ void extractExps(MathArray & ar)
                if (!sup || sup->hasDown())
                        continue;
 
-               // create a proper exp-inset as replacement 
+               // create a proper exp-inset as replacement
                ar[i] = MathAtom(new MathExFuncInset("exp", sup->cell(1)));
                ar.erase(i + 1);
        }
@@ -490,7 +489,7 @@ bool testIntegral(MathAtom const & at)
 {
        return
         testIntSymbol(at) ||
-               ( at->asScriptInset() 
+               ( at->asScriptInset()
                  && at->asScriptInset()->nuc().size()
                        && testIntSymbol(at->asScriptInset()->nuc().back()) );
 }
@@ -569,7 +568,7 @@ bool testSum(MathAtom const & at)
 {
        return
         testSumSymbol(at) ||
-               ( at->asScriptInset() 
+               ( at->asScriptInset()
                  && at->asScriptInset()->nuc().size()
                        && testSumSymbol(at->asScriptInset()->nuc().back()) );
 }
@@ -750,7 +749,7 @@ void extractLims(MathArray & ar)
                MathArray::iterator it = ar.begin() + i;
 
                // is this a limit function?
-               if (!testSymbol(*it, "lim")) 
+               if (!testSymbol(*it, "lim"))
                        continue;
 
                // the next one must be a subscript (without superscript)
@@ -767,7 +766,7 @@ void extractLims(MathArray & ar)
                // the -> splits the subscript int x and x0
                MathArray x  = MathArray(s.begin(), st);
                MathArray x0 = MathArray(st + 1, s.end());
-               
+
                // use something behind the script as core
                MathArray f;
                MathArray::iterator tt = extractArgument(f, it + 2, ar.end());
@@ -927,7 +926,7 @@ namespace {
                ostringstream os;
                MaximaStream ms(os);
                ms << ar;
-               string expr = os.str().c_str();
+               string expr = STRCONV(os.str());
                string const header = "SIMPSUM:true;";
 
                string out;
@@ -1050,7 +1049,7 @@ namespace {
                ostringstream os;
                MapleStream ms(os);
                ms << ar;
-               string expr = os.str().c_str();
+               string expr = STRCONV(os.str());
                lyxerr << "ar: '" << ar << "'\n";
                lyxerr << "ms: '" << os.str() << "'\n";
 
@@ -1098,7 +1097,7 @@ namespace {
                ostringstream os;
                OctaveStream vs(os);
                vs << ar;
-               string expr = os.str().c_str();
+               string expr = STRCONV(os.str());
                string out;
 
                lyxerr << "pipe: ar: '" << ar << "'\n";
@@ -1182,7 +1181,7 @@ MathArray pipeThroughExtern(string const & lang, string const & extra,
        os << "[" << extra << ' ';
        ns << ar;
        os << "]";
-       string data = os.str().c_str();
+       string data = STRCONV(os.str());
 
        // search external script
        string file = LibFileSearch("mathed", "extern_" + lang);
index 68b70d19ce1a4562d631ecd76b13e833255dfb2f..cd569034896fe5538971f3fa294aba401d900160 100644 (file)
@@ -57,6 +57,7 @@ bool has_math_fonts;
 
 using std::endl;
 
+
 namespace {
 
 // file scope
@@ -98,15 +99,15 @@ void initSymbols()
        std::ifstream fs(filename.c_str());
        string line;
        bool skip = false;
-       while (std::getline(fs, line)) {
+       while (getline(fs, line)) {
                int charid     = 0;
                int fallbackid = 0;
-               if (line.size() > 0 && line[0] == '#')
+               if (!line.empty() && line[0] == '#')
                        continue;
 
                // special case of iffont/else/endif
                if (line.size() >= 7 && line.substr(0, 6) == "iffont") {
-                       istringstream is(line);
+                       istringstream is(STRCONV(line));
                        string tmp;
                        is >> tmp;
                        is >> tmp;
@@ -122,13 +123,13 @@ void initSymbols()
 
                // special case of pre-defined macros
                if (line.size() > 8 && line.substr(0, 5) == "\\def\\") {
-                       //lyxerr << "defining: '" << line << "'\n";
-                       istringstream is(line);
+                       //lyxerr << "defining: '" << line << "'" << endl;
+                       istringstream is(STRCONV(line));
                        MathMacroTable::create(MathAtom(new MathMacroTemplate(is)));
                        continue;
                }
 
-               istringstream is(line);
+               istringstream is(STRCONV(line));
                latexkeys tmp;
                is >> tmp.name >> tmp.inset;
                if (isFontName(tmp.inset))
@@ -145,7 +146,7 @@ void initSymbols()
                if (isFontName(tmp.inset)) {
                        // tmp.inset _is_ the fontname here.
                        // create fallbacks if necessary
-                       if (tmp.extra=="func" || tmp.extra=="funclim" || tmp.extra=="special") {
+                       if (tmp.extra == "func" || tmp.extra == "funclim" || tmp.extra == "special") {
                                lyxerr[Debug::MATHED] << "symbol abuse for " << tmp.name << endl;
                                tmp.draw = tmp.name;
                        } else if (math_font_available(tmp.inset)) {
@@ -165,20 +166,24 @@ void initSymbols()
                        }
                } else {
                        // it's a proper inset
-                       lyxerr[Debug::MATHED] << "inset " << tmp.inset << " used for "
-                               << tmp.name << endl;
+                       lyxerr[Debug::MATHED] << "inset " << tmp.inset
+                                             << " used for " << tmp.name
+                                             << endl;
                }
 
                if (theWordList.find(tmp.name) != theWordList.end())
-                       lyxerr[Debug::MATHED] << "readSymbols: inset " << tmp.name
-                                             << " already exists." << endl;
+                       lyxerr[Debug::MATHED]
+                               << "readSymbols: inset " << tmp.name
+                               << " already exists." << endl;
                else
                        theWordList[tmp.name] = tmp;
-               lyxerr[Debug::MATHED] << "read symbol '" << tmp.name
-                                       <<  "  inset: " << tmp.inset
-                                       <<  "  draw: " << int(tmp.draw[0])
-                                       <<  "  extra: " << tmp.extra
-                                     << "'" << endl;
+
+               lyxerr[Debug::MATHED]
+                       << "read symbol '" << tmp.name
+                       << "  inset: " << tmp.inset
+                       << "  draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
+                       << "  extra: " << tmp.extra
+                       << "'" << endl;
        }
        string tmp = "cmm";
        string tmp2 = "cmsy";
@@ -203,18 +208,20 @@ latexkeys const * in_word_set(string const & str)
 {
        WordList::iterator it = theWordList.find(str);
        //lyxerr << "looking up '" << str << "' found: "
-       // << (it != theWordList.end()) << "\n";
+       // << (it != theWordList.end()) << endl;
        return (it != theWordList.end()) ? &(it->second) : 0;
 }
 
 
 MathAtom createMathInset(string const & s)
 {
-       lyxerr[Debug::MATHED] << "creating inset with name: '" << s << "'" << endl;
+       lyxerr[Debug::MATHED] << "creating inset with name: '"
+                             << s << "'" << endl;;
        latexkeys const * l = in_word_set(s);
        if (l) {
                string const & inset = l->inset;
-               lyxerr[Debug::MATHED] << " found inset: '" << inset << "'" << endl;
+               lyxerr[Debug::MATHED] << " found inset: '" <<
+                       inset << "'" << endl;
                if (inset == "ref")
                        return MathAtom(new RefInset(l->name));
                if (inset == "underset")
index 00a036c865a01345bfe1a06a06cc73686643410b..b6f743e32a9b987da3a441a4e2efde5940c82cc9 100644 (file)
@@ -393,7 +393,7 @@ void MathHullInset::footer_write(WriteStream & os) const
                else
                        os << "\\]\n";
 
-       else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign"  
+       else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign"
             || type_ == "alignat" || type_ == "xalignat")
                os << "\\end{" << type_ << star(n) << "}\n";
 
@@ -433,7 +433,7 @@ void MathHullInset::delRow(row_type row)
 
 void MathHullInset::addCol(col_type col)
 {
-       if (colChangeOK()) 
+       if (colChangeOK())
                MathGridInset::addCol(col);
        else
                lyxerr << "Can't change number of columns in '" << type_ << "'\n";
@@ -442,7 +442,7 @@ void MathHullInset::addCol(col_type col)
 
 void MathHullInset::delCol(col_type col)
 {
-       if (colChangeOK()) 
+       if (colChangeOK())
                MathGridInset::delCol(col);
        else
                lyxerr << "Can't change number of columns in '" << type_ << "'\n";
@@ -592,7 +592,7 @@ void MathHullInset::mutate(string const & newtype)
        }
 
        else if (type_ == "multline") {
-               if (newtype == "gather" || newtype == "align" ||        
+               if (newtype == "gather" || newtype == "align" ||
                    newtype == "xalignat" || newtype == "xxalignat" || newtype == "flalign")
                        setType(newtype);
                else if (newtype == "eqnarray") {
@@ -826,7 +826,7 @@ MathInset::result_type MathHullInset::dispatch
                        idx = r * ncols() + c;
                        if (idx >= nargs())
                                idx = nargs() - 1;
-                       if (pos > cell(idx).size()) 
+                       if (pos > cell(idx).size())
                                pos = cell(idx).size();
                        return DISPATCHED_POP;
                }
index 2a6445205d9af42fd8ba2f99c45451c4e2059f3c..48f644d71a13f4ec02b7f903a0ddcc08523cda80 100644 (file)
@@ -18,7 +18,7 @@
 #include <config.h>
 
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include "math_inset.h"
@@ -264,7 +264,7 @@ int MathInset::docbook(std::ostream &, bool) const
 
 
 MathInset::result_type
-       MathInset::dispatch(FuncRequest const &, idx_type &, pos_type &) 
+       MathInset::dispatch(FuncRequest const &, idx_type &, pos_type &)
 {
        return UNDISPATCHED;
 }
@@ -288,7 +288,7 @@ string asString(MathArray const & ar)
        std::ostringstream os;
        WriteStream ws(os);
        ws << ar;
-       return os.str().c_str();
+       return STRCONV(os.str());
 }
 
 
index 2e3f8a927d36540605c93fff4117bfafe409afef..bee7384f6b249882284c94b15834d7dc13db473f 100644 (file)
@@ -1743,7 +1743,7 @@ string const Paragraph::asString(Buffer const * buffer, bool label)
                         getInset(i)->lyxCode() == Inset::MATH_CODE) {
                        ostringstream ost;
                        getInset(i)->ascii(buffer, ost);
-                       s += subst(ost.str().c_str(),'\n',' ');
+                       s += subst(STRCONV(ost.str()),'\n',' ');
                }
        }
 
@@ -1775,7 +1775,7 @@ string const Paragraph::asString(Buffer const * buffer,
                }
        }
 
-       return ost.str().c_str();
+       return STRCONV(ost.str());
 }
 
 
index 35b4b018dcad3f774a9cf62179ce7b5f3797b957..52ada720fc27fbdc13717fae7a31c155ad73cc27 100644 (file)
@@ -8,23 +8,23 @@
  */
 
 #include <config.h>
+
 #include "support/LOstream.h"
+
 #include "paragraph.h"
 #include "sgml.h"
+
 using std::pair;
 using std::make_pair;
 using std::ostream;
 using std::endl;
+
 namespace sgml {
 
 pair<bool, string> escapeChar(char c)
 {
        string str;
+
        switch (c) {
        case Paragraph::META_HFILL:
                break;
@@ -83,7 +83,7 @@ pair<bool, string> escapeChar(char c)
        return make_pair(false, str);
 }
 
+
 int openTag(ostream & os, Paragraph::depth_type depth,
            bool mixcont, string const & latexname)
 {
index 25f04786df1a164c147eb5ee5ef1fe84396d3418..7824345f983b71bc66917e9623d9171c163a954f 100644 (file)
@@ -1,5 +1,12 @@
 2002-11-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * lstrings.h (tostr): STRCONV
+
+       * lstrings.C (regexMatch): STRCONV
+       (getVectorFromString): STRCONV, manual copy into vector
+
+       * filetools.C (GetFileContents): STRCONV
+
        * os.C: include config.h
 
        * lstrings.C (getVectorFromString): rewrite to use
index d8c4438d96ce510ad5affb78c9839c03b19ec8ab..31112d8b697090c9c98eb73f1a5d636a05735878 100644 (file)
@@ -782,7 +782,7 @@ string const GetFileContents(string const & fname)
                if (ifs && ofs) {
                        ofs << ifs.rdbuf();
                        ifs.close();
-                       return ofs.str().c_str();
+                       return STRCONV(ofs.str());
                }
        }
        lyxerr << "LyX was not able to read file '" << fname << "'" << endl;
index b0ca602de3762a13961ebd25276cb7b8d59197ce..89ef75f0a75ce53a427263bc6570047d93404a0a 100644 (file)
@@ -447,8 +447,8 @@ bool regexMatch(string const & a, string const & pattern)
        string regex(pattern);
        regex = subst(regex, ".", "\\.");
        regex = subst(regex, "*", ".*");
-       boost::regex reg(regex);
-       return boost::regex_match(a, reg);
+       boost::regex reg(STRCONV(regex));
+       return boost::regex_match(STRCONV(a), reg);
 }
 
 
@@ -637,7 +637,20 @@ vector<string> const getVectorFromString(string const & str,
 #else
        boost::char_separator<char> sep(delim.c_str());
        boost::tokenizer<boost::char_separator<char> > tokens(str, sep);
+#ifndef USE_INCLUDED_STRING
        return vector<string>(tokens.begin(), tokens.end());
+#else
+       vector<string> vec;
+       using boost::tokenizer;
+       using boost::char_separator;
+
+       tokenizer<char_separator<char> >::iterator it = tokens.begin();
+       tokenizer<char_separator<char> >::iterator end = tokens.end();
+       for (; it != end; ++it) {
+               vec.push_back(STRCONV((*it)));
+       }
+       return vec;
+#endif
 #endif
 }
 
index 4fbde835dc6b4971930bcb78319c39acf291bfef..1330616ab92da2770a90549fe9a29a45bb086609 100644 (file)
@@ -97,7 +97,7 @@ string const tostr(T const & t)
 {
        ostringstream ostr;
        ostr << t;
-       return ostr.str().c_str();
+       return STRCONV(ostr.str());
        // We need to use the .c_str since we sometimes are using
        // our own string class and that is not compatible with
        // basic_string<char>. (of course we don't want this later)
index fbe70e23dce271f5c5cbdfe2ac6c278b3f614440..73f2f67ceb48cc057102cfd52d86f12d6c7033e0 100644 (file)
@@ -665,7 +665,7 @@ lyxstring::const_reference lyxstring::operator[](size_type pos) const
 #if 0
        // This is actually what the standard requires,
        lyx::Assert(pos <= rep->sz); // OURS!
-       static char helper = '\0';
+       static char const helper = '\0';
        return pos == rep->sz ? helper : rep->s[pos];
 #else
        // but we use this one since it is stricter
index 075fcc6a58b0a59c3ae56c4ec6a6b96a979a1d01..720abda3605a34d17cd702d135ad09788fd0801f 100644 (file)
@@ -1257,9 +1257,8 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                                .numberLabel(layout->latexname(),
                                             numbertype, langtype, head);
 
-                       par->params().labelString(par->params().labelString() + s.str().c_str());
-                       // We really want to remove the c_str as soon as
-                       // possible...
+                       par->params().labelString(par->params().labelString()
+                                                 + STRCONV(s.str()));
 
                        // reset enum counters
                        textclass.counters().reset("enum");
@@ -1292,7 +1291,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                        s << textclass.counters()
                                .numberLabel(enumcounter,
                                             "enumeration", langtype);
-                       par->params().labelString(s.str().c_str());
+                       par->params().labelString(STRCONV(s.str()));
                }
        } else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
                textclass.counters().step("bibitem");
@@ -1335,7 +1334,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                                ostringstream o;
                                //o << fl.name() << " " << buf->counters().value(fl.name()) << ":";
                                o << fl.name() << " #:";
-                               s = o.str();
+                               s = STRCONV(o.str());
                        } else {
                                // par->SetLayout(0);
                                // s = layout->labelstring;
index a41176b3a6deb02a7135031250ed98fe5ab532b8..e81ed01b2c38f30a61e55919b431013b6a80bd64 100644 (file)
@@ -31,7 +31,13 @@ using std::ifstream;
 using std::getline;
 using boost::regex;
 using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
 using boost::smatch;
+#else
+using boost::cmatch;
+#endif
+
 
 int VCS::doVCCommand(string const & cmd, string const & path)
 {
@@ -252,13 +258,18 @@ void CVS::scanMaster()
                lyxerr[Debug::LYXVC] << "\t  line: " << line << endl;
                if (contains(line, tmpf)) {
                        // Ok extract the fields.
+#ifndef USE_INCLUDED_STRING
                        smatch sm;
-                       regex_match(line, sm, reg);
+#else
+                       cmatch sm;
+#endif
+                       regex_match(STRCONV(line), sm, reg);
 
                        //sm[0]; // whole matched string
                        //sm[1]; // filename
-                       version_ = sm.str(2);
-                       string file_date = sm.str(3);
+                       version_ = STRCONV(sm.str(2));
+                       string const file_date = STRCONV(sm.str(3));
+
                        //sm[4]; // options
                        //sm[5]; // tag or tagdate
                        FileInfo fi(file_);