+2001-06-27 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * *.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 <larsbj@birdstep.com>
* math_sizeinset.C: include support/LOstream.h
#include "math_parser.h"
#include "mathed/support.h"
-using namespace std;
-
+using std::ostream;
+using std::endl;
MathArray::MathArray()
{}
#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;
#include "debug.h"
#include "lyxlex.h"
-using namespace std;
+using std::ostream;
extern MathCursor * mathcursor;
#include "Painter.h"
-
namespace {
///
}
-using namespace std;
-
-
MathGridInset::RowInfo::RowInfo()
: upperline_(false), lowerline_(false)
{}
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;
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_;
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);
}
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);
}
#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)
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 {
#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;;
}
if (pos == macro_table.end())
lyxerr << "MathMacroTable::updateTemplate: no template with name '"
- << par->name() << "' available.\n";
+ << par->name() << "' available." << endl;
else
pos->second = par;
}
if (pos == macro_table.end()) {
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
- << name << "' available.\n";
+ << name << "' available." << endl;
}
return *pos->second;
built = true;
- lyxerr[Debug::MATHED] << "Building macros\n";
+ lyxerr[Debug::MATHED] << "Building macros" << endl;
// This macro doesn't have arguments
{
{}
-MathMacroTemplate * MathMacroTemplate::Clone() const
+MathInset * MathMacroTemplate::Clone() const
{
lyxerr << "cloning MacroTemplate!\n";
return new MathMacroTemplate(*this);
///
MathMacroTemplate(string const & name, int nargs);
///
- MathMacroTemplate * Clone() const;
+ MathInset * Clone() const;
///
void Write(std::ostream &, bool fragile) const;
/// Number of arguments
#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)