From 7e8b69acf03403d91b29ef71fc8816d8fc482700 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 2 May 2001 08:18:00 +0000 Subject: [PATCH] compilation fixes when using lyxstring git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1975 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 11 +++++++++++ src/mathed/formula.C | 2 +- src/mathed/math_macroarg.C | 3 +-- src/mathed/math_macrotemplate.C | 2 +- src/mathed/math_macrotemplate.h | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 5989fef9c3..0ff21c4b8c 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,14 @@ +2001-05-02 Jean-Marc Lasgouttes + + * math_macrotemplate.h: do not use explicitely std::string, but + string. + + * math_macroarg.C: avoid bringing the whole std:: namespace in + global-land. When you do that, there is an ambiguity between + lyxstring and std::string (which may be defined at the same time). + + * formula.C (HandleExtern): add .c_str() to .str() (useful when + using lyxtring) 2001-04-27 André Pönitz diff --git a/src/mathed/formula.C b/src/mathed/formula.C index e4bce63436..48d0b55581 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -1419,7 +1419,7 @@ void InsetFormula::HandleExtern(const string & arg, BufferView * bv) string outfile = "/tmp/lyx2" + arg + ".out"; ostringstream os; par->WriteNormal(os); - string code = os.str(); + string code = os.str().c_str(); string script = "lyx2" + arg + " '" + code + "' " + outfile; lyxerr << "calling: " << script << endl; Systemcalls cmd(Systemcalls::System, script, 0); diff --git a/src/mathed/math_macroarg.C b/src/mathed/math_macroarg.C index 7a512f7563..91589b32e4 100644 --- a/src/mathed/math_macroarg.C +++ b/src/mathed/math_macroarg.C @@ -10,8 +10,7 @@ #include "Lsstream.h" #include "debug.h" - -using namespace std; +using std::endl; MathMacroArgument::MathMacroArgument(int n) : MathedInset(string(), LM_OT_MACRO_ARG, LM_ST_TEXT), diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 7377ac9104..89e3a4faf0 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -12,7 +12,7 @@ #include "debug.h" #include "Painter.h" -using namespace std; +//using namespace std; MathMacroTemplate::MathMacroTemplate() : MathParInset(LM_ST_TEXT, "undefined", LM_OT_MACRO), diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index 12bdbc0cb3..a6a5743632 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -22,7 +22,7 @@ public: /// MathMacroTemplate(); /// - MathMacroTemplate(std::string const & name, int nargs); + MathMacroTemplate(string const & name, int nargs); /// void WriteDef(std::ostream &, bool fragile) const; /// Number of arguments -- 2.39.2