From 015b7a2f587742b011982497e153e29fdf1aabdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 16 Nov 2001 12:00:27 +0000 Subject: [PATCH] search & replace for symbols & function git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3039 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 2 ++ src/mathed/formulabase.h | 2 ++ src/mathed/math_funcinset.C | 7 +++++++ src/mathed/math_funcinset.h | 2 ++ src/mathed/math_limitopinset.C | 6 +++--- src/mathed/math_symbolinset.C | 7 +++++++ src/mathed/math_symbolinset.h | 7 +++++-- 7 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 41bb90666b..927960565a 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -759,3 +759,5 @@ void mathDispatchGreek(BufferView * bv, string const & arg) } +void mathDispatch(BufferView *, kb_action, string const &) +{} diff --git a/src/mathed/formulabase.h b/src/mathed/formulabase.h index 1f05315b97..ad398baf84 100644 --- a/src/mathed/formulabase.h +++ b/src/mathed/formulabase.h @@ -143,5 +143,7 @@ void mathDispatchInsertMatrix(BufferView *, string const &); void mathDispatchGreek(BufferView *, string const &); // void mathDispatchMathImportSelection(BufferView *, string const &); +// +void mathDispatch(BufferView *, kb_action, string const &); #endif diff --git a/src/mathed/math_funcinset.C b/src/mathed/math_funcinset.C index b8cf2d1829..002775730b 100644 --- a/src/mathed/math_funcinset.C +++ b/src/mathed/math_funcinset.C @@ -49,6 +49,13 @@ void MathFuncInset::draw(Painter & pain, int x, int y) const } +bool MathFuncInset::match(MathInset * p) const +{ + MathFuncInset const * q = p->asFuncInset(); + return q && name_ == q->name_; +} + + void MathFuncInset::maplize(MapleStream & os) const { os << ' ' << name_.c_str(); diff --git a/src/mathed/math_funcinset.h b/src/mathed/math_funcinset.h index d5d270c7f1..98786403d3 100644 --- a/src/mathed/math_funcinset.h +++ b/src/mathed/math_funcinset.h @@ -28,6 +28,8 @@ public: MathFuncInset * asFuncInset() { return this; } /// void setName(string const &); + /// + bool match(MathInset * p) const; /// void normalize(NormalStream &) const; diff --git a/src/mathed/math_limitopinset.C b/src/mathed/math_limitopinset.C index 5d4d6942a7..ee5460e7c9 100644 --- a/src/mathed/math_limitopinset.C +++ b/src/mathed/math_limitopinset.C @@ -25,7 +25,7 @@ void MathLimitOpInset::write(WriteStream & os) const } -void MathLimitOpInset::normalize(NormalStream & os) const +void MathLimitOpInset::normalize(NormalStream &) const { //os << "[int " << scripts_ << ' ' << core_ << ' ' << diff_ << ']' } @@ -43,12 +43,12 @@ void MathLimitOpInset::draw(Painter &, int, int) const } -void MathLimitOpInset::maplize(MapleStream & os) const +void MathLimitOpInset::maplize(MapleStream &) const { //os << name_.c_str() << '(' << cell(0) << ')'; } -void MathLimitOpInset::mathmlize(MathMLStream & os) const +void MathLimitOpInset::mathmlize(MathMLStream &) const { //os << name_.c_str() << '(' << cell(0) << ')'; } diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index 4b635efbd5..9b0a9e41de 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -135,6 +135,13 @@ char const * MathMLtype(string const & s) } +bool MathSymbolInset::match(MathInset * p) const +{ + MathSymbolInset const * q = p->asSymbolInset(); + return q && name() == q->name(); +} + + void MathSymbolInset::mathmlize(MathMLStream & os) const { char const * type = MathMLtype(sym_->type); diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index 4f7db6d955..b83f5b5f9b 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -29,6 +29,10 @@ public: bool takesLimits() const; /// MathSymbolInset * asSymbolInset() { return this; } + /// + string name() const; + /// + bool match(MathInset *) const; /// void normalize(NormalStream &) const; @@ -40,8 +44,7 @@ public: void octavize(OctaveStream &) const; /// void write(WriteStream & os) const; - /// - string name() const; + private: /// MathTextCodes code() const;