From 579857ebc505121a18343c854482ac2036da79b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 7 Jan 2003 11:24:43 +0000 Subject: [PATCH] Separate 'cursor inside' and 'cursor behind' cases for statusline display. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5909 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 5 +++-- src/mathed/math_cursor.C | 3 +-- src/mathed/math_inset.h | 4 +++- src/mathed/math_macro.C | 12 ++++++++++++ src/mathed/math_macro.h | 4 ++++ src/mathed/math_scriptinset.C | 5 +++++ src/mathed/math_scriptinset.h | 4 +++- src/mathed/math_symbolinset.C | 2 +- src/mathed/math_symbolinset.h | 2 +- 9 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 5ebce38133..b2197fd84e 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,7 +1,8 @@ 2003-01-07 Joćo Luis Meloni Assirati + * math_hullinset.C: fix numbering problem of AMS gather and - multline environments (bugs 518 and 594). Treat gather the same - way as eqnarray and multline as a special case. + multline environments. Treat gather the same + way as eqnarray and multline as a special case. 2002-12-18 John Levon diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index f76e0618fb..44b0136ce6 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1288,8 +1288,7 @@ string MathCursor::info() const os << " "; } if (hasPrevAtom()) - if (prevAtom()->asSymbolInset() || prevAtom()->asScriptInset()) - prevAtom()->infoize(os); + prevAtom()->infoize2(os); os << " "; return STRCONV(os.str()); } diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 823faf515f..bae365ab86 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -282,8 +282,10 @@ public: virtual void mathmlize(MathMLStream &) const; /// write content as something readable by Octave virtual void octavize(OctaveStream &) const; - /// describe content + /// describe content if cursor inside virtual void infoize(std::ostream &) const {} + /// describe content if cursor behind + virtual void infoize2(std::ostream &) const {} /// plain ascii output virtual int ascii(std::ostream & os, int) const; /// linuxdoc output diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 657deb39ba..7de25d1970 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -223,3 +223,15 @@ void MathMacro::updateExpansion() const expand(); expanded_.substitute(*this); } + + +void MathMacro::infoize(std::ostream & os) const +{ + os << "Macro: " << name(); +} + + +void MathMacro::infoize2(std::ostream & os) const +{ + os << "Macro: " << name(); +} diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index f32f30896b..f18fdecd2c 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -70,6 +70,10 @@ public: void mathmlize(MathMLStream &) const; /// void octavize(OctaveStream &) const; + /// + void infoize(std::ostream &) const; + /// + void infoize2(std::ostream &) const; private: /// diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index f531e4e626..9482caded5 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -472,6 +472,11 @@ void MathScriptInset::octavize(OctaveStream & os) const void MathScriptInset::infoize(std::ostream & os) const { os << "Scripts"; +} + + +void MathScriptInset::infoize2(std::ostream & os) const +{ if (limits_) os << (limits_ == 1 ? ", Displayed limits" : ", Inlined limits"); } diff --git a/src/mathed/math_scriptinset.h b/src/mathed/math_scriptinset.h index 5c39f638a7..18607d9132 100644 --- a/src/mathed/math_scriptinset.h +++ b/src/mathed/math_scriptinset.h @@ -89,8 +89,10 @@ public: void removeScript(bool up); /// make sure a script is accessible void ensure(bool up); - /// + /// say that we have scripts void infoize(std::ostream & os) const; + /// say whether we have displayed limits + void infoize2(std::ostream & os) const; /// local dispatcher result_type dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos); diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index 71fc0ecf16..c317c89077 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -192,7 +192,7 @@ void MathSymbolInset::write(WriteStream & os) const } -void MathSymbolInset::infoize(std::ostream & os) const +void MathSymbolInset::infoize2(std::ostream & os) const { os << "Symbol: " << name(); } diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index 8f59fbcfe2..2f13884b34 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -57,7 +57,7 @@ public: /// void write(WriteStream & os) const; /// - void infoize(std::ostream & os) const; + void infoize2(std::ostream & os) const; private: ///