]> git.lyx.org Git - features.git/commitdiff
mathed46.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 6 Mar 2001 18:17:16 +0000 (18:17 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 6 Mar 2001 18:17:16 +0000 (18:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1696 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formula.C
src/mathed/math_matrixinset.C
src/mathed/math_matrixinset.h
src/mathed/math_parinset.C
src/mathed/math_parinset.h
src/mathed/math_parser.C
src/mathed/math_xiter.C

index c16e3a0b58447a23e9cd02dc36e15f5b1f58e40d..05277e7eeb9bbf66792888b63120cee98c72e2db 100644 (file)
@@ -393,7 +393,7 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & f,
                } else {
                        MathMatrixInset * mt =
                                static_cast<MathMatrixInset*>(par);
-                       MathedRowSt const * crow = mt->getRowSt();
+                       MathedRowContainer::iterator crow = mt->getRowSt().begin();
                        while (crow) {
                                int const y = baseline + crow->getBaseline();
                                if (crow->isNumbered()) {
@@ -404,7 +404,7 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & f,
                                                str = "(#)";
                                        pain.text(int(x + 20), y, str, wfont);
                                }
-                               crow = crow->getNext();
+                               ++crow;
                        }
                }
        }
@@ -557,11 +557,11 @@ vector<string> const InsetFormula::getLabelList() const
 
        if (is_multi_numbered(par->GetType())) {
                MathMatrixInset * mt = static_cast<MathMatrixInset*>(par);
-               MathedRowSt const * crow = mt->getRowSt();
+               MathedRowContainer::iterator crow = mt->getRowSt().begin();
                while (crow) {
                        if (!crow->getLabel().empty())
                                label_list.push_back(crow->getLabel());
-                       crow = crow->getNext();
+                       ++crow;
                }
        } else if (!label_.empty())
                label_list.push_back(label_);
index cddfe2566d8e5daf22bc52c11ea12be8bebd0da7..ee3393d06ae20e9b358582c80ebd53a1219651f0 100644 (file)
@@ -53,7 +53,7 @@ MathMatrixInset::MathMatrixInset(MathMatrixInset const & mt)
                                row_ = r;
                        else
                                ro->setNext(r);
-                       mrow = mrow->getNext();
+                       mrow = mrow->next_;
                        ro = r;
                        ++nr_;
                }
@@ -67,7 +67,7 @@ MathMatrixInset::~MathMatrixInset()
 {
        MathedRowSt * r = row_.data_;
        while (r) {
-               MathedRowSt * q = r->getNext();
+               MathedRowSt * q = r->next_;
                delete r;
                r = q;
        }
@@ -184,7 +184,7 @@ void MathMatrixInset::Metrics()
                ascent = h - hl;
                break;
        default:
-               ascent = (row_.data_->getNext()) ? h / 2 : h - hl;
+               ascent = (row_.begin().is_last()) ? h / 2 : h - hl;
                break;
        }
        descent = h - ascent + 2;
index c8c7cc45b7315022c4155f69d45246eb820db0db..6ee2478ec02f26c5a2c261b4fe6c8ddb39d79347 100644 (file)
@@ -45,9 +45,9 @@ public:
        virtual bool isMatrix() const;
        
        /// Use this to manage the extra information independently of paragraph
-       MathedRowSt * getRowSt() const;
+       MathedRowContainer & getRowSt();
        ///
-       void setRowSt(MathedRowSt * r);
+       void setRowSt(MathedRowContainer & r);
 private:
        ///  Number of columns & rows
        int nc_;
@@ -87,14 +87,14 @@ bool MathMatrixInset::isMatrix() const
        
 
 inline
-MathedRowSt * MathMatrixInset::getRowSt() const
+MathedRowContainer & MathMatrixInset::getRowSt()
 {
-       return row_.data_;
+       return row_;
 }
 
 
 inline
-void MathMatrixInset::setRowSt(MathedRowSt * r)
+void MathMatrixInset::setRowSt(MathedRowContainer & r)
 {
        row_ = r;
 }
index ae43ae750f15dc9641ea2f0641e91bcca957c7d3..7728671c711f3c411f1154aa7eed9c7d29714e49 100644 (file)
@@ -21,9 +21,10 @@ using std::endl;
 extern int number_of_newlines;
 
 
-MathedRowSt * MathParInset::getRowSt() const
+MathedRowContainer & MathParInset::getRowSt()
 {
-       return 0;
+       static MathedRowContainer dummy;
+       return dummy;
 }
 
 
@@ -270,7 +271,7 @@ void MathParInset::Write(ostream & os, bool fragile)
        latexkeys const * l;
        MathedIter data(&array);
        // hack
-       MathedRowSt const * crow = getRowSt();   
+       MathedRowContainer::iterator crow = getRowSt().begin();   
        data.Reset();
        
        if (!Permit(LMPF_FIXED_SIZE)) { 
@@ -348,7 +349,7 @@ void MathParInset::Write(ostream & os, bool fragile)
                                                           << crow->getLabel()
                                                           << "} ";
                                                }
-                                               crow = crow->getNext();
+                                               ++crow;
                                        }
                                        if (fragile)
                                                os << "\\protect";
index c5af2cfb5c0aafdbdac4c201be407e0d28747315..b3d8bc7d06e8f2723d933d95ecdf9cacd2098751 100644 (file)
@@ -67,9 +67,9 @@ public:
        ///
        virtual void SetStyle(short);
        ///
-       virtual MathedRowSt * getRowSt() const;
+       virtual MathedRowContainer & getRowSt();
        ///
-       virtual void setRowSt(MathedRowSt *);
+       virtual void setRowSt(MathedRowContainer &);
        ///
        virtual bool Permit(short f) const;
        ///
@@ -150,7 +150,7 @@ int MathParInset::getMaxArgumentIdx() const
 
 
 inline
-void MathParInset::setRowSt(MathedRowSt *)
+void MathParInset::setRowSt(MathedRowContainer &)
 {}
 
 
index 1b67bb40e055c5ecd65c56772608a5cb226d74a0..a4c33ef978609e682c4cb3fa60ab5fcfb3313251 100644 (file)
@@ -424,7 +424,7 @@ void mathed_parse(MathedArray & array, unsigned flags = 0,
        int acc_brace = 0;
        int acc_braces[8];
        MathParInset * mt = (mtx) ? *mtx : 0;
-       MathedRowSt * crow = (mt) ? mt->getRowSt() : 0;
+       MathedRowSt * crow = (mt) ? mt->getRowSt().data_ : 0;
        
        ++plevel;
        MathedIter data(&array);
@@ -869,7 +869,7 @@ void mathed_parse(MathedArray & array, unsigned flags = 0,
                                        }
                                        mt->SetStyle(size);
                                        mt->SetType(mathed_env);
-                                       crow = mt->getRowSt();
+                                       crow = mt->getRowSt().data_;
                                }
                                
                                lyxerr[Debug::MATHED] << "MATH BEGIN[" << mathed_env << "]" << endl;
index e14cc4c3e8de3e006eabf6f99147495718abecdb..17fb01b10ec4f874979b87a4b94fba876cd9c561 100644 (file)
@@ -186,7 +186,7 @@ void MathedXIter::SetData(MathParInset * pp)
        x_ = y_ = 0;
        array = &p_->GetData();
        ncols = p_->GetColumns();
-       crow_ = p_->getRowSt();
+       crow_ = p_->getRowSt().data_;
        if (p_->Permit(LMPF_ALLOW_CR))
                flags |= MthIF_CR;
        if (p_->Permit(LMPF_ALLOW_TAB))
@@ -272,7 +272,7 @@ void MathedXIter::GoBegin()
        x_ = y_ = 0;   
        sw_ = sx_ = 0;
        if (p_) {
-               crow_ = p_->getRowSt();
+               crow_ = p_->getRowSt().data_;
                if (crow_) {
                        x_ = crow_->getTab(0);
                        y_ = crow_->getBaseline();
@@ -447,7 +447,7 @@ void MathedXIter::ipop()
        x_ = stck.x;
        y_ = stck.y;
        if (p_) {
-               crow_ = p_->getRowSt();
+               crow_ = p_->getRowSt().data_;
                if (crow_)
                        for (int i = 0; i < row; ++i)
                                crow_ = crow_->getNext();