From: Lars Gullik Bjønnes Date: Tue, 17 Apr 2001 14:17:11 +0000 (+0000) Subject: c++ casts, remvoe dead code, use LFUN_MESSAGE X-Git-Tag: 1.6.10~21302 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=df199d6d567dd0a9bfdd08fcf1f4846d244daa2c;p=features.git c++ casts, remvoe dead code, use LFUN_MESSAGE git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1931 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 0df54bd375..d46e9d6033 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,19 @@ +2001-04-17 Lars Gullik Bjønnes + + * insettext.C (init): remvoe leftovers from cursor_visible change + (draw): use c++ cast + (LocalDispatch): dispatch LFUN_MESSAGE + + * insettabular.C (InsetTabular): remove leftovers from + cursor_visible, and scoped_ptr changes + (draw): use c++ cast + + * insetcollapsable.C (draw): use c++ cast + + * ExternalTemplate.h: inherit privaely from noncopyable + * insetcommand.h: ditto + * insetinclude.h: ditto + 2001-04-16 Allan Rae * insettoc.C (Ascii): diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index 505365d224..97670011b1 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -72,7 +72,7 @@ struct ExternalTemplate { /** A singleton class that manages the external inset templates */ -class ExternalTemplateManager : public boost::noncopyable { +class ExternalTemplateManager : boost::noncopyable { public: /// Map from the LyX name of the template to the template structure typedef std::map Templates; diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index ba3b72318c..6fcd31120c 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -194,7 +194,7 @@ void InsetCollapsable::draw(BufferView * bv, LyXFont const & f, UpdatableInset::draw(bv, f, baseline, x, cleared); #else if (!owner()) - x += (float)scroll(); + x += static_cast(scroll()); #endif if (!cleared && (inset.need_update == InsetText::FULL || inset.need_update == InsetText::INIT || diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index cb06454208..99f0592dd8 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -74,7 +74,7 @@ private: /// -class InsetCommand : public InsetButton, public boost::noncopyable { +class InsetCommand : public InsetButton, boost::noncopyable { public: /// explicit diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index e57afeb0c7..2fa0040fef 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -24,7 +24,7 @@ struct LaTeXFeatures; /** Used to include files */ -class InsetInclude: public InsetButton, public boost::noncopyable { +class InsetInclude: public InsetButton, boost::noncopyable { public: /// the type of inclusion enum Flags { diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index dc9f2bc45a..c5521d3a27 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -126,15 +126,11 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns) rows = 1; if (columns <= 0) columns = 1; - //tabular = new LyXTabular(this, rows,columns); tabular.reset(new LyXTabular(this, rows,columns)); // for now make it always display as display() inset // just for test!!! the_locking_inset = 0; locked = no_selection = false; -#if 0 - cursor_visible = false; -#endif oldcell = -1; actrow = actcell = 0; clearSelection(); @@ -145,13 +141,9 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns) InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf) : buffer(&buf) { - //tabular = new LyXTabular(this, *(tab.tabular)); tabular.reset(new LyXTabular(this, *(tab.tabular))); the_locking_inset = 0; locked = no_selection = false; -#if 0 - cursor_visible = false; -#endif oldcell = -1; actrow = actcell = 0; sel_cell_start = sel_cell_end = 0; @@ -247,7 +239,7 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, UpdatableInset::draw(bv, font, baseline, x, cleared); #else if (!owner()) - x += (float)scroll(); + x += static_cast(scroll()); #endif if (!cleared && ((need_update == INIT) || (need_update == FULL) || (top_x != int(x)) || (top_baseline != baseline))) { diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 4484a9cca2..cd18251615 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -37,7 +37,6 @@ #include "lyxcursor.h" #include "CutAndPaste.h" #include "font.h" -#include "minibuffer.h" #include "LColor.h" #include "support/textutils.h" #include "support/LAssert.h" @@ -47,6 +46,8 @@ #include "trans_mgr.h" #include "lyxscreen.h" #include "WorkArea.h" +#include "lyxfunc.h" +#include "gettext.h" using std::ostream; using std::ifstream; @@ -91,9 +92,6 @@ void InsetText::init(InsetText const * ins) insetDescent = 0; insetWidth = 0; the_locking_inset = 0; -#if 0 - cursor_visible = false; -#endif interline_space = 1; no_selection = false; need_update = INIT; @@ -322,7 +320,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, UpdatableInset::draw(bv, f, baseline, x, cleared); #else if (!owner()) - x += (float)scroll(); + x += static_cast(scroll()); #endif // update insetWidth and insetHeight with dummy calls (void)ascent(bv, f); @@ -1112,9 +1110,9 @@ InsetText::LocalDispatch(BufferView * bv, // see if we found the layout number: if (!layout.first) { - string msg = string(N_("Layout ")) + arg + N_(" not known"); - - bv->owner()->getMiniBuffer()->Set(msg); + string const msg = string(N_("Layout ")) + arg + N_(" not known"); + bv->owner()->getLyXFunc() + ->Dispatch(LFUN_MESSAGE, msg); break; }