some fixes for compaq cxx

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2147 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-06-27 15:57:57 +00:00
parent b1c4f8070f
commit 9f42114d4d
10 changed files with 35 additions and 32 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -12,8 +12,8 @@
#include "math_parser.h"
#include "mathed/support.h"
using namespace std;
using std::ostream;
using std::endl;
MathArray::MathArray()
{}

View File

@ -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;

View File

@ -39,7 +39,7 @@
#include "debug.h"
#include "lyxlex.h"
using namespace std;
using std::ostream;
extern MathCursor * mathcursor;

View File

@ -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);
}

View File

@ -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 {

View File

@ -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
{

View File

@ -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);

View File

@ -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

View File

@ -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)