From fa78e1ddb6d0835cbde7b94bf97753122336117d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 30 Jun 2003 15:06:30 +0000 Subject: [PATCH] re-enable --with-included-string git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7223 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 8 +++++ src/Chktex.C | 9 ++---- src/frontends/controllers/tex_helpers.C | 18 ++++++------ src/funcrequest.C | 2 +- src/insets/ChangeLog | 7 +++++ src/lyxtext.h | 3 +- src/support/ChangeLog | 6 ++++ src/support/filetools.C | 2 +- src/support/lstrings.C | 39 +++++++++++++++++++++---- src/text.C | 2 +- 10 files changed, 70 insertions(+), 26 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 987d817830..b92d163eae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ + +2003-06-30 André Pönitz + + * Chktex.C: + * funcrequest.C: + * lyxtext.h: + * text.C: re-enable --with-included-string + 2003-06-28 Lars Gullik Bjønnes * textcursor.C: add diff --git a/src/Chktex.C b/src/Chktex.C index c58328746a..7b728fc9d4 100644 --- a/src/Chktex.C +++ b/src/Chktex.C @@ -32,9 +32,6 @@ using std::ifstream; using std::getline; -/* - * CLASS Chktex - */ Chktex::Chktex(string const & chktex, string const & f, string const & p) : cmd(chktex), file(f), path(p) @@ -48,7 +45,7 @@ int Chktex::run(TeXErrors &terr) string log = OnlyFilename(ChangeExtension(file, ".log")); string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log; Systemcall one; - int result= one.startscript(Systemcall::Wait, tmp); + int result = one.startscript(Systemcall::Wait, tmp); if (result == 0) { result = scanLogFile(terr); } else { @@ -66,7 +63,7 @@ int Chktex::scanLogFile(TeXErrors & terr) string const tmp = OnlyFilename(ChangeExtension(file, ".log")); #if USE_BOOST_FORMAT - boost::format msg(_("ChkTeX warning id # %1$d")); + boost::format msg(STRCONV(_("ChkTeX warning id # %1$d"))); #else string const msg(_("ChkTeX warning id # ")); #endif @@ -87,7 +84,7 @@ int Chktex::scanLogFile(TeXErrors & terr) #if USE_BOOST_FORMAT msg % warno; - terr.insertError(lineno, msg.str(), warning); + terr.insertError(lineno, STRCONV(msg.str()), warning); msg.clear(); #else terr.insertError(lineno, msg + warno, warning); diff --git a/src/frontends/controllers/tex_helpers.C b/src/frontends/controllers/tex_helpers.C index 3dcb62ee95..4bba95c08d 100644 --- a/src/frontends/controllers/tex_helpers.C +++ b/src/frontends/controllers/tex_helpers.C @@ -71,7 +71,7 @@ void getTexFileList(string const & filename, std::vector & list) std::vector::iterator it = list.begin(); std::vector::iterator end = list.end(); for (; it != end; ++it) { - *it = regex.Merge(*it, "/"); + *it = STRCONV(regex.Merge(it->c_str(), "/")); } lyx::eliminate_duplicates(list); @@ -84,14 +84,14 @@ string const getListOfOptions(string const & classname, string const & type) string optionList = string(); std::ifstream is(filename.c_str()); while (is) { - string s; - is >> s; - if (contains(s,"DeclareOption")) { - s = s.substr(s.find("DeclareOption")); - s = split(s,'{'); // cut front - s = token(s,'}',0); // cut end - optionList += (s + '\n'); - } + string s; + is >> s; + if (contains(s,"DeclareOption")) { + s = s.substr(s.find("DeclareOption")); + s = split(s,'{'); // cut front + s = token(s,'}',0); // cut end + optionList += (s + '\n'); + } } return optionList; } diff --git a/src/funcrequest.C b/src/funcrequest.C index 28007f08e6..4eb9e3491b 100644 --- a/src/funcrequest.C +++ b/src/funcrequest.C @@ -107,7 +107,7 @@ void FuncRequest::errorMessage(string const & msg) const void split(vector & args, string str) { - istringstream is(str); + istringstream is(STRCONV(str)); while (is) { char c; string s; diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 6b99359f4a..327fcea65a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ + +2003-06-30 André Pönitz + + * insetcite.C (localDispatch): fix case of missing return value + + * insetcite.C (ascii): remove unneeded temporary + 2003-06-28 Lars Gullik Bjønnes * insetspace.h: fix \file diff --git a/src/lyxtext.h b/src/lyxtext.h index b3e9c49090..2acca6d6d4 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -279,8 +279,7 @@ public: void clearSelection(); /// select the word we need depending on word_location - void getWord(LyXCursor & from, LyXCursor & to, - word_location loc); + void getWord(LyXCursor & from, LyXCursor & to, word_location const); /// just selects the word the cursor is in void selectWord(word_location loc); /// returns the inset at cursor (if it exists), 0 otherwise diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 80914fa050..d279c8d563 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,9 @@ + +2003-06-30 André Pönitz + + * filetools.C: + * lstrings.C: re-enable --with-included-string + 2003-06-28 Lars Gullik Bjønnes * filetools.h: fix some \param issue diff --git a/src/support/filetools.C b/src/support/filetools.C index 712decbf19..e27ef022bf 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -692,7 +692,7 @@ string const NormalizePath(string const & path) // Normalise paths like /foo//bar ==> /foo/bar boost::RegEx regex("/{2,}"); - RTemp = regex.Merge(RTemp, "/"); + RTemp = STRCONV(regex.Merge(STRCONV(RTemp), "/")); while (!RTemp.empty()) { // Split by next / diff --git a/src/support/lstrings.C b/src/support/lstrings.C index 1a047933fe..fbb5b00013 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -613,29 +613,39 @@ string const getStringFromVector(vector const & vec, string bformat(string const & fmt, string const & arg1) { - return STRCONV((boost::format(fmt) % STRCONV(arg1)).str()); + return STRCONV((boost::format(STRCONV(fmt)) % STRCONV(arg1)).str()); } string bformat(string const & fmt, string const & arg1, string const & arg2) { - return STRCONV((boost::format(fmt) % STRCONV(arg1) % STRCONV(arg2)).str()); + return STRCONV((boost::format(STRCONV(fmt)) % STRCONV(arg1) + % STRCONV(arg2)).str()); } string bformat(string const & fmt, string const & arg1, string const & arg2, string const & arg3) { - return STRCONV((boost::format(fmt) % STRCONV(arg1) % STRCONV(arg2) - % STRCONV(arg3)).str()); + return STRCONV((boost::format(STRCONV(fmt)) % STRCONV(arg1) + % STRCONV(arg2) % STRCONV(arg3)).str()); } string bformat(string const & fmt, string const & arg1, string const & arg2, string const & arg3, string const & arg4) { - return STRCONV((boost::format(fmt) % STRCONV(arg1) % STRCONV(arg2) - % STRCONV(arg3) % STRCONV(arg4)).str()); + return STRCONV((boost::format(STRCONV(fmt)) % STRCONV(arg1) + % STRCONV(arg2) % STRCONV(arg3) % STRCONV(arg4)).str()); +} + + +string bformat(string const & fmt, string const & arg1, string const & arg2, + string const & arg3, string const & arg4, string const & arg5) +{ + return STRCONV((boost::format(STRCONV(fmt)) % STRCONV(arg1) + % STRCONV(arg2) % STRCONV(arg3) % STRCONV(arg4) + % STRCONV(arg5)).str()); } #else @@ -685,4 +695,21 @@ string bformat(string const & fmt, string const & arg1, string const & arg2, return subst(str, "%%", "%"); } + +string bformat(string const & fmt, string const & arg1, string const & arg2, + string const & arg3, string const & arg4, string const & arg5) +{ + lyx::Assert(contains(fmt, "%1$s")); + lyx::Assert(contains(fmt, "%2$s")); + lyx::Assert(contains(fmt, "%3$s")); + lyx::Assert(contains(fmt, "%4$s")); + lyx::Assert(contains(fmt, "%5$s")); + string str = subst(fmt, "%1$s", arg1); + str = subst(str, "%2$s", arg2); + str = subst(str, "%3$s", arg3); + str = subst(str, "%4$s", arg4); + str = subst(str, "%5$s", arg5); + return subst(str, "%%", "%"); +} + #endif diff --git a/src/text.C b/src/text.C index eb7094f09c..4396e19894 100644 --- a/src/text.C +++ b/src/text.C @@ -2046,7 +2046,7 @@ void LyXText::cursorLeftOneWord(LyXCursor & cur) // Select current word. This depends on behaviour of // CursorLeftOneWord(), so it is patched as well. void LyXText::getWord(LyXCursor & from, LyXCursor & to, - word_location loc) + word_location const loc) { // first put the cursor where we wana start to select the word from = cursor;