From: Lars Gullik Bjønnes Date: Tue, 24 Apr 2001 16:13:38 +0000 (+0000) Subject: mathed64.diff X-Git-Tag: 1.6.10~21287 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6b954412883ed962cee39e5cdfc5d9962e893142;p=features.git mathed64.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1950 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/array.C b/src/mathed/array.C index 47034105ec..0cec697b09 100644 --- a/src/mathed/array.C +++ b/src/mathed/array.C @@ -5,9 +5,11 @@ #pragma implementation #endif +#include "debug.h" #include "array.h" #include "math_iter.h" #include "math_inset.h" +#include "math_macro.h" #include "support/LOstream.h" @@ -79,6 +81,29 @@ void MathedArray::deep_copy() } } +void MathedArray::substitute(MathMacro * m) +{ + if (m->nargs() == 0) + return; + + MathedIter it(this); + while (it.OK()) { + if (it.IsInset()) { + MathedInset * inset = it.GetInset(); + if (inset->GetType() == LM_OT_MACRO_ARG) { + int n = static_cast(inset)->number() - 1; + //lyxerr << "substituting an argument inset: " << n << "\n"; + inset = m->arg(n)->Clone(); + } else { + inset->substitute(m); + //lyxerr << "substituting in an ordinary inset\n"; + } + raw_pointer_insert(inset, it.getPos() + 1); + } + it.Next(); + } +} + MathedArray & MathedArray::operator=(MathedArray const & array) { @@ -284,7 +309,7 @@ byte & MathedArray::operator[](int i) } -void MathedArray::dump(ostream & os) const +void MathedArray::dump2(ostream & os) const { buffer_type::const_iterator cit = bf_.begin(); buffer_type::const_iterator end = bf_.end(); @@ -294,4 +319,28 @@ void MathedArray::dump(ostream & os) const os << endl; } +void MathedArray::dump(ostream & os) const +{ + MathedIter it( const_cast(this) ); + while (it.OK()) { + if (it.IsInset()) { + MathedInset * inset = it.GetInset(); + os << ""; + } + else if (it.IsTab()) + os << ""; + else if (it.IsCR()) + os << ""; + else if (it.IsScript()) + os << "