From: Jean-Marc Lasgouttes Date: Fri, 15 Sep 2000 10:24:15 +0000 (+0000) Subject: A few tweaks needed by cxx X-Git-Tag: 1.6.10~21993 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=160dc67127a88201dec6ec4d98e28ff260af3ccc;p=features.git A few tweaks needed by cxx git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1020 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index e9be3ff214..bb0ffe22cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2000-09-15 Angus Leeming + + * src/frontends/kde/FormCitation.h: added some using directives. + + * src/frontends/kde/FormToc.h: corrected definition of doTree. + + * src/frontends/kde/GUIRunTime.C (initApplication): use lyxerr not + cerr. + + * src/mathed/math_defs.h: redefine SetAlign to use string rather + than char *. + +2000-09-15 Jean-Marc Lasgouttes + + * src/buffer.C (pop_tag): revert for the second time a change by + Lars, who seems to really hate having non-local loop variables :) + + * src/Lsstream.h: add "using" statements. + + * src/support/copy.C (copy): add a bunch of std:: qualifiers + * src/buffer.C (writeFile): ditto + 2000-09-14 Lars Gullik Bjønnes * src/buffer.C (writeFile): try to fix the locale modified format diff --git a/po/POTFILES.in b/po/POTFILES.in index 70efb80a26..a70f1b39b2 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -119,6 +119,7 @@ src/mathed/formulamacro.C src/mathed/math_forms.C src/mathed/math_panel.C src/MenuBackend.C +src/menus.C src/minibuffer.C src/PaperLayout.C src/paragraph.C diff --git a/src/Lsstream.h b/src/Lsstream.h index 8d171d2156..89676b8a4e 100644 --- a/src/Lsstream.h +++ b/src/Lsstream.h @@ -14,6 +14,8 @@ #ifdef HAVE_SSTREAM #include +using std::istringstream; +using std::ostringstream; #else #include "support/sstream.h" #endif diff --git a/src/LyXView.C b/src/LyXView.C index 5f0deb8c66..4fc8f999b5 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -453,7 +453,7 @@ void LyXView::updateWindowTitle() if (view()->available()) { string cur_title = buffer()->fileName(); if (!cur_title.empty()){ - title += ": " + OnlyFilename(cur_title); + title += ": " + MakeDisplayPath(cur_title); if (!buffer()->isLyxClean()) title += _(" (Changed)"); if (buffer()->isReadonly()) diff --git a/src/buffer.C b/src/buffer.C index a363f8e4ce..143aab75dc 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1268,7 +1268,7 @@ bool Buffer::writeFile(string const & fname, bool flag) const #ifdef HAVE_LOCALE // Use the standard "C" locale for file output. - ofs.imbue(locale::classic()); + ofs.imbue(std::locale::classic()); #endif // The top of the file should not be written by params. @@ -2662,16 +2662,22 @@ void Buffer::push_tag(ostream & os, string const & tag, void Buffer::pop_tag(ostream & os, string const & tag, int & pos, char stack[5][3]) { +#ifdef WITH_WARNINGS #warning Use a real stack! (Lgb) +#endif + // Please, Lars, do not remove the global variable. I already + // had to reintroduce it twice! (JMarc) + int j; + // pop all tags till specified one - for (int j = pos; (j >= 0) && (strcmp(stack[j], tag.c_str())); --j) + for (j = pos; (j >= 0) && (strcmp(stack[j], tag.c_str())); --j) os << ""; // closes the tag os << ""; - + // push all tags, but the specified one - for (int j = j + 1; j <= pos; ++j) { + for (j = j + 1; j <= pos; ++j) { os << "<" << stack[j] << ">"; strcpy(stack[j-1], stack[j]); } diff --git a/src/frontends/kde/FormCitation.h b/src/frontends/kde/FormCitation.h index 29417f026e..aedf93d104 100644 --- a/src/frontends/kde/FormCitation.h +++ b/src/frontends/kde/FormCitation.h @@ -102,7 +102,7 @@ private: Connection ih_; /// available citation keys - std::vector > keys; + std::vector > keys; /// chosen citation keys std::vector chosenkeys; diff --git a/src/frontends/kde/FormToc.h b/src/frontends/kde/FormToc.h index 15cd6984c4..cdf878bbd8 100644 --- a/src/frontends/kde/FormToc.h +++ b/src/frontends/kde/FormToc.h @@ -55,7 +55,7 @@ private: void showTOC(InsetCommand * const); /// hierarchical tree - int FormToc::doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int); + int doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int); /// update the Toc void updateToc(void); diff --git a/src/frontends/kde/GUIRunTime.C b/src/frontends/kde/GUIRunTime.C index cc7c335c5d..15cc4f1ce8 100644 --- a/src/frontends/kde/GUIRunTime.C +++ b/src/frontends/kde/GUIRunTime.C @@ -54,7 +54,7 @@ int GUIRunTime::initApplication(int argc, char * argv[]) // } int xforms_lib_version = fl_library_version(0, 0); if (xforms_include_version != xforms_lib_version) { - cerr << "You are either running LyX with wrong " + lyxerr << "You are either running LyX with wrong " "version of a dynamic XForms library\n" "or you have build LyX with conflicting header " "and library (different\n" diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 99dbf57038..8ade1d3a5a 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -490,7 +490,7 @@ class MathMatrixInset: public MathParInset { /// void SetData(LyxArrayBase *); /// - void SetAlign(char, char const *); + void SetAlign(char, string const &); /// char * GetAlign(char * vv) { *vv = v_align; diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index dfcce43cd8..4b5660f3f0 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -373,10 +373,10 @@ MathedInset * MathMatrixInset::Clone() } -void MathMatrixInset::SetAlign(char vv, char const * hh) +void MathMatrixInset::SetAlign(char vv, string const & hh) { v_align = vv; - strncpy(h_align, hh, nc); + strncpy(h_align, hh.c_str(), nc); } diff --git a/src/support/copy.C b/src/support/copy.C index 29eb28394b..7324d44568 100644 --- a/src/support/copy.C +++ b/src/support/copy.C @@ -16,9 +16,9 @@ bool lyx::copy(string const & from, string const & to) return Systemcalls().startscript(Systemcalls::System, command) == 0; #else - ifstream ifs(from.c_str()); + std::ifstream ifs(from.c_str()); if (!ifs) return false; - ofstream ofs(to.c_str(), ios::out|ios::trunc); + std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc); if (!ofs) return false; ofs << ifs.rdbuf(); if (ofs.good()) return true;