]> git.lyx.org Git - lyx.git/commitdiff
some fixes for compaq cxx
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 27 Jun 2001 15:57:57 +0000 (15:57 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 27 Jun 2001 15:57:57 +0000 (15:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2147 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/array.C
src/mathed/formulabase.C
src/mathed/formulamacro.C
src/mathed/math_grid.C
src/mathed/math_macro.C
src/mathed/math_macrotable.C
src/mathed/math_macrotemplate.C
src/mathed/math_macrotemplate.h
src/mathed/xarray.C

index 80b9490e868d4784cbac7e3dcd81d8a421ed5a64..6017f6310069b33caf40a5692b16bf1ee297ad68 100644 (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
index 3a8f83e9d551ab05ca5c32886113f422281a136a..756cb75c5aeed92af7efed4f3d914ade46c1457e 100644 (file)
@@ -12,8 +12,8 @@
 #include "math_parser.h"
 #include "mathed/support.h"
 
-using namespace std;
-
+using std::ostream;
+using std::endl;
 
 MathArray::MathArray()
 {}
index 1941b0a61456c01c6852f64169d0710b3991b126..18d369319b9feaf85a0edf3169fb5d10fa7fd0ce 100644 (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;
 
index 1317be9d95f00dddac78005babbdf2b7f4cede69..fec9ff2dc61f66ead136364f349f773954acef12 100644 (file)
@@ -39,7 +39,7 @@
 #include "debug.h"
 #include "lyxlex.h"
 
-using namespace std;
+using std::ostream;
 
 extern MathCursor * mathcursor;
 
index 467f77ba14b8c70d7c8b4a4b7792796e782a7ff0..cb0f3dae9e983450b2075a49e9a6b526a31b7222 100644 (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);
 }
index 8a2e2e786cf7051cd3f5685069ff8e2e96fd13e7..d91fd3deb93b2927cdf213631937c95d7b234685 100644 (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 {
index 95d8572404dc2d843fdb4d6a29918341817151c9..dba2b18e847d58793b311777ff6904e55f943eec 100644 (file)
 #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
        {
index 89012bdad260c646260941b0d93a8132ed20ea2f..1bebb8596f35c19bc6e776acbd2603ad0844e1da 100644 (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);
index fdf53d661a2a5b9830107d0d3c13bd6eee9ed4fe..4b878cd6f0c6b5f71f39542ce4ecd9113a80718d 100644 (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
index 3dc1d54f6bf68d79af6dce4c1b81d45025ca1d3e..d36c8d5abe81f9c9920ca47369b696971edc2b8b 100644 (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)