From 646d6a77752adf582cdcdb0605a21a266caaf9e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 11 Mar 2003 09:25:47 +0000 Subject: [PATCH] clean my tree git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6441 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 12 ++++++------ src/mathed/math_gridinset.C | 25 +++++++++++++------------ src/mathed/math_inset.C | 13 ++++++++----- src/mathed/math_inset.h | 8 ++++---- src/mathed/math_spaceinset.C | 1 + 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 03ec5ea312..4bc566a1e4 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -652,7 +652,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd) break; // Math fonts - case LFUN_GREEK_TOGGLE: handleFont(bv, cmd.argument, "lyxgreek"); break; + //case LFUN_GREEK_TOGGLE: handleFont(bv, cmd.argument, "lyxgreek"); break; case LFUN_BOLD: handleFont(bv, cmd.argument, "mathbf"); break; case LFUN_SANS: handleFont(bv, cmd.argument, "mathsf"); break; case LFUN_EMPH: handleFont(bv, cmd.argument, "mathcal"); break; @@ -664,11 +664,11 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd) case LFUN_FREE: handleFont(bv, cmd.argument, "textrm"); break; case LFUN_DEFAULT: handleFont(bv, cmd.argument, "textnormal"); break; - case LFUN_GREEK: - handleFont(bv, cmd.argument, "lyxgreek1"); - if (cmd.argument.size()) - mathcursor->insert(asArray(cmd.argument)); - break; + //case LFUN_GREEK: + // handleFont(bv, cmd.argument, "lyxgreek1"); + // if (cmd.argument.size()) + // mathcursor->insert(asArray(cmd.argument)); + // break; case LFUN_MATH_MODE: if (mathcursor->currentMode() == MathInset::TEXT_MODE) { diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 5b05e54b98..9798536ab9 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -5,6 +5,7 @@ #include "funcrequest.h" #include "frontends/Painter.h" #include "debug.h" +#include "Lsstream.h" #include "insets/mailinset.h" @@ -27,8 +28,12 @@ public: /// virtual string const inset2string() const { - lyxerr << "inset2string called" << std::endl; - return "whatever"; //(inset_); + ostringstream data; + //data << name() << " active_cell " << inset.getActCell() << '\n'; + data << name() << " active_cell " << 0 << '\n'; + WriteStream ws(data); + inset_.write(ws); + return data.str(); } protected: @@ -1003,17 +1008,13 @@ dispatch_result MathGridInset::dispatch { switch (cmd.action) { - case LFUN_MOUSE_RELEASE: { - if (cmd.button() == mouse_button::button3) { - WriteStream ws(lyxerr); - write(ws); - GridInsetMailer mailer(*this); - lyxerr << "mailer " << mailer.name() << " active\n"; - mailer.showDialog(cmd.view()); - return DISPATCHED; - } + case LFUN_MOUSE_RELEASE: + //if (cmd.button() == mouse_button::button3) { + // GridInsetMailer mailer(*this); + // mailer.showDialog(); + // return DISPATCHED; + //} break; - } case LFUN_INSET_DIALOG_UPDATE: { GridInsetMailer mailer(*this); diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 065408881b..4c8038cc09 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -34,6 +34,14 @@ using std::ostream; +BufferView * MathInset::view() const +{ + if (!mathcursor) + return 0; + return mathcursor->formula()->view(); +} + + int MathInset::height() const { return ascent() + descent(); @@ -297,8 +305,3 @@ ostream & operator<<(ostream & os, MathAtom const & at) return os; } - -Dialogs & getDialogs() -{ - return mathcursor->formula()->view()->owner()->getDialogs(); -} diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 22dd39c60e..ed95d8d3e2 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -299,6 +299,10 @@ public: virtual string fileInsetLabel() const { return "Formula"; } /// usually the latex name virtual string name() const; + +protected: + /// a dirty hack + BufferView * view() const; }; std::ostream & operator<<(std::ostream &, MathAtom const &); @@ -311,8 +315,4 @@ MathArray asArray(string const & str); // initialize math void initMath(); -/// here to ssave a few includes in the insets -class Dialogs; -Dialogs & getDialogs(); - #endif diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index 168234db7d..d2d2232595 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -83,6 +83,7 @@ void MathSpaceInset::incSpace() space_ = (space_ + 1) % (nSpace - 2); } + void MathSpaceInset::validate(LaTeXFeatures & features) const { if (space_ >= 0 && space_< nSpace) { -- 2.39.2