From: Jean-Marc Lasgouttes Date: Wed, 27 Jun 2001 15:57:57 +0000 (+0000) Subject: some fixes for compaq cxx X-Git-Tag: 1.6.10~21165 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9f42114d4d865aac377bee09389e4c88fe701cc3;p=features.git some fixes for compaq cxx git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2147 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 80b9490e86..6017f63100 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,10 @@ +2001-06-27 Jean-Marc Lasgouttes + + * *.C: remove all "using namespace std" directives (not + good!!) and replaced it with relevant "using" directives. + + * math_macrotemplate.C (Clone): change return type to MathInset* + 2001-06-27 Lars Gullik Bjønnes * math_sizeinset.C: include support/LOstream.h diff --git a/src/mathed/array.C b/src/mathed/array.C index 3a8f83e9d5..756cb75c5a 100644 --- a/src/mathed/array.C +++ b/src/mathed/array.C @@ -12,8 +12,8 @@ #include "math_parser.h" #include "mathed/support.h" -using namespace std; - +using std::ostream; +using std::endl; MathArray::MathArray() {} diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 1941b0a614..18d369319b 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -41,7 +41,9 @@ #include "support/lyxlib.h" #include "mathed/support.h" -using namespace std; +using std::endl; +using std::ostream; +using std::vector; extern char const * latex_special_chars; diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 1317be9d95..fec9ff2dc6 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -39,7 +39,7 @@ #include "debug.h" #include "lyxlex.h" -using namespace std; +using std::ostream; extern MathCursor * mathcursor; diff --git a/src/mathed/math_grid.C b/src/mathed/math_grid.C index 467f77ba14..cb0f3dae9e 100644 --- a/src/mathed/math_grid.C +++ b/src/mathed/math_grid.C @@ -10,7 +10,6 @@ #include "Painter.h" - namespace { /// @@ -23,9 +22,6 @@ int const MATH_BORDER = 2; } -using namespace std; - - MathGridInset::RowInfo::RowInfo() : upperline_(false), lowerline_(false) {} @@ -93,8 +89,8 @@ void MathGridInset::Metrics(MathStyles st) int desc = 0; for (int col = 0; col < ncols(); ++col) { MathXArray const & c = xcell(index(row, col)); - asc = max(asc, c.ascent()); - desc = max(desc, c.descent()); + asc = std::max(asc, c.ascent()); + desc = std::max(desc, c.descent()); } rowinfo_[row].ascent_ = asc; rowinfo_[row].descent_ = desc; @@ -131,7 +127,7 @@ void MathGridInset::Metrics(MathStyles st) for (int col = 0; col < ncols(); ++col) { int wid = 0; for (int row = 0; row < nrows(); ++row) - wid = max(wid, xcell(index(row, col)).width()); + wid = std::max(wid, xcell(index(row, col)).width()); colinfo_[col].width_ = wid; colinfo_[col].offset_ = colinfo_[col].width_; @@ -264,15 +260,15 @@ void MathGridInset::delRow(int row) void MathGridInset::addCol(int newcol) { - int nc = ncols(); - int nr = nrows(); - cells_type new_cells = cells_type((nc + 1) * nr); + int const nc = ncols(); + int const nr = nrows(); + cells_type new_cells((nc + 1) * nr); for (int row = 0; row < nr; ++row) for (int col = 0; col < nc; ++col) new_cells[row * (nc + 1) + col + (col > newcol)] = cells_[row * nc + col]; - swap(cells_, new_cells); + std::swap(cells_, new_cells); colinfo_.insert(colinfo_.begin() + newcol); } @@ -287,7 +283,7 @@ void MathGridInset::delCol(int col) for (int i = 0; i < nargs(); ++i) if (i % ncols() != col) tmpcells.push_back(cells_[i]); - swap(cells_, tmpcells); + std::swap(cells_, tmpcells); colinfo_.erase(colinfo_.begin() + col); } diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 8a2e2e786c..d91fd3deb9 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -31,8 +31,8 @@ #include "math_macrotemplate.h" #include "Painter.h" - -using namespace std; +using std::ostream; +using std::endl; MathMacro::MathMacro(MathMacroTemplate const & t) : MathInset(t.name(), LM_OT_MACRO, t.numargs()), tmplate_(&t) @@ -60,7 +60,7 @@ void MathMacro::Metrics(MathStyles st) for (int i = 0; i < nargs(); ++i) { MathXArray & c = xcell(i); c.Metrics(st); - width_ = max(width_, c.width() + 30); + width_ = std::max(width_, c.width() + 30); descent_ += c.height() + 10; } } else { diff --git a/src/mathed/math_macrotable.C b/src/mathed/math_macrotable.C index 95d8572404..dba2b18e84 100644 --- a/src/mathed/math_macrotable.C +++ b/src/mathed/math_macrotable.C @@ -18,21 +18,19 @@ #include "debug.h" #include "support/LAssert.h" - -using namespace std; - +using std::endl; MathMacroTable::table_type MathMacroTable::macro_table; void MathMacroTable::dump() { - cerr << "\n------------------------------------------\n"; + lyxerr << "\n------------------------------------------\n"; table_type::const_iterator it; for (it = macro_table.begin(); it != macro_table.end(); ++it) - cerr << it->first << " [" << it->second->nargs() << "] : " + lyxerr << it->first << " [" << it->second->nargs() << "] : " << it->second << endl; - cerr << "------------------------------------------\n"; + lyxerr << "------------------------------------------" << endl;; } @@ -42,7 +40,7 @@ void MathMacroTable::updateTemplate(MathMacroTemplate * par) if (pos == macro_table.end()) lyxerr << "MathMacroTable::updateTemplate: no template with name '" - << par->name() << "' available.\n"; + << par->name() << "' available." << endl; else pos->second = par; } @@ -62,7 +60,7 @@ MathMacroTemplate & MathMacroTable::provideTemplate(string const & name) if (pos == macro_table.end()) { lyxerr << "MathMacroTable::provideTemplate: no template with name '" - << name << "' available.\n"; + << name << "' available." << endl; } return *pos->second; @@ -91,7 +89,7 @@ void MathMacroTable::builtinMacros() built = true; - lyxerr[Debug::MATHED] << "Building macros\n"; + lyxerr[Debug::MATHED] << "Building macros" << endl; // This macro doesn't have arguments { diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 89012bdad2..1bebb8596f 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -19,7 +19,7 @@ MathMacroTemplate::MathMacroTemplate(string const & nm, int numargs) : {} -MathMacroTemplate * MathMacroTemplate::Clone() const +MathInset * MathMacroTemplate::Clone() const { lyxerr << "cloning MacroTemplate!\n"; return new MathMacroTemplate(*this); diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index fdf53d661a..4b878cd6f0 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -24,7 +24,7 @@ public: /// MathMacroTemplate(string const & name, int nargs); /// - MathMacroTemplate * Clone() const; + MathInset * Clone() const; /// void Write(std::ostream &, bool fragile) const; /// Number of arguments diff --git a/src/mathed/xarray.C b/src/mathed/xarray.C index 3dc1d54f6b..d36c8d5abe 100644 --- a/src/mathed/xarray.C +++ b/src/mathed/xarray.C @@ -11,8 +11,8 @@ #include "math_defs.h" #include "Painter.h" -using namespace std; - +using std::max; +using std::min; MathXArray::MathXArray() : width_(0), ascent_(0), descent_(0), xo_(0), yo_(0), style_(LM_ST_TEXT)