From: Lars Gullik Bjønnes Date: Mon, 12 Feb 2001 20:39:25 +0000 (+0000) Subject: mathed15.diff X-Git-Tag: 1.6.10~21630 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=30fb3b3be3acdb23ac4256e9570c8552d2d56913;p=features.git mathed15.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1493 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index a4b0220957..bf9608ccaf 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -8,6 +8,7 @@ */ #include #include +#include #ifdef __GNUG__ #pragma implementation @@ -26,6 +27,8 @@ #include "form_include.h" +using std::cout; + FormInclude::FormInclude(LyXView * lv, Dialogs * d) : FormCommand(lv, d, _("Include file"), new OkCancelPolicy), dialog_(0) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index edf3df6c3c..c63589bf0b 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -4,7 +4,10 @@ std::vector * math_defs.h: math_inset.C: replace int[] with std::vector - + * math_panel.h: + * math_symbols.C: replace FL_OBJECTP[] with + std::vector + 2001-02-12 Lars Gullik Bjønnes * math_defs.h (struct MathedRowSt): make all private variables end diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 9421701036..6819ea540d 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -411,6 +411,9 @@ class MathParInset: public MathedInset { */ struct MathedRowSt { + /// + typedef vector Widths; + /// explicit MathedRowSt(int n) @@ -451,7 +454,7 @@ private: int desc_; int y_; /// widths - std::vector widths_; + Widths widths_; /// string label_; /// @@ -509,7 +512,8 @@ class MathMatrixInset: public MathParInset { /// char v_align; // add approp. type /// - string h_align; // a vector would perhaps be more correct + //std::vector h_align; + string h_align; // a vector would perhaps be more correct /// Vertical structure MathedRowSt * row; diff --git a/src/mathed/math_panel.h b/src/mathed/math_panel.h index c84c5e3e76..f27d49a7fa 100644 --- a/src/mathed/math_panel.h +++ b/src/mathed/math_panel.h @@ -20,6 +20,7 @@ #pragma interface #endif +#include #include "bmtable.h" /// @@ -65,21 +66,20 @@ enum SomeMathValues { }; /// -typedef FL_OBJECT * FL_OBJECTP; - /// Class to manage bitmap menu bars class BitmapMenu { /// static BitmapMenu * active; /// friend int peek_event(FL_FORM *, void *); -protected: + /// + typedef std::vector bitmaps_type; + /// + typedef bitmaps_type::size_type size_type; /// BitmapMenu * next, * prev; - /// Number of bitmaps - int nb; /// Current bitmap - int i; + size_type current_; /// Border width int ww; /// @@ -87,7 +87,7 @@ protected: /// FL_FORM * form; /// - FL_OBJECTP * bitmap; + bitmaps_type bitmaps_; /// FL_OBJECT * button; public: diff --git a/src/mathed/math_symbols.C b/src/mathed/math_symbols.C index 17e1576461..4d3d3b12f9 100644 --- a/src/mathed/math_symbols.C +++ b/src/mathed/math_symbols.C @@ -130,15 +130,14 @@ bool math_insert_greek(char c); BitmapMenu * BitmapMenu::active = 0; -BitmapMenu::BitmapMenu(int n, FL_OBJECT * bt, BitmapMenu * prevx): nb(n) +BitmapMenu::BitmapMenu(int n, FL_OBJECT * bt, BitmapMenu * prevx) + : current_(0), bitmaps_(n) { w = h = 0; form = 0; - i = 0; ww = 2 * FL_abs(FL_BOUND_WIDTH); x = y = ww; y += 8; - bitmap = new FL_OBJECTP[nb]; button = bt; button->u_vdata = this; prev = prevx; @@ -153,7 +152,6 @@ BitmapMenu::~BitmapMenu() delete next; if (form->visible) Hide(); fl_free_form(form); - delete[] bitmap; } @@ -180,7 +178,7 @@ FL_OBJECT * BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, unsigned char const * data, Bool vert) { - if (i >= nb) + if (current_ >= bitmaps_.size()) return 0; int wx = bw+ww/2, wy = bh+ww/2; wx += (wx % nx); @@ -199,20 +197,20 @@ BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, w = max(x, w); h = max(y + wy + ww, h); } - bitmap[i++] = obj; + bitmaps_[current_++] = obj; return obj; } void BitmapMenu::Create() { - if (i < nb) { + if (current_ < bitmaps_.size()) { lyxerr << "Error: Bitmaps not created!" << endl; return; } form = fl_bgn_form(FL_UP_BOX, w, h); - for (i = 0; i < nb; ++i) { - fl_add_object(form, bitmap[i]); - bitmap[i]->u_vdata = this; + for (current_ = 0; current_ < bitmaps_.size(); ++current_) { + fl_add_object(form, bitmaps_[current_]); + bitmaps_[current_]->u_vdata = this; } fl_end_form(); fl_register_raw_callback(form, KeyPressMask, C_peek_event); @@ -222,10 +220,10 @@ int BitmapMenu::GetIndex(FL_OBJECT* ob) { if (active == this) { int k = 0; - for (i = 0; i < nb; ++i) { - if (bitmap[i] == ob) + for (current_ = 0; current_ < bitmaps_.size(); ++current_) { + if (bitmaps_[current_] == ob) return k+fl_get_bmtable(ob); - k += fl_get_bmtable_maxitems(bitmap[i]); + k += fl_get_bmtable_maxitems(bitmaps_[current_]); } } return -1;