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
This commit is contained in:
Lars Gullik Bjønnes 2001-04-17 14:17:11 +00:00
parent 1e0c627c73
commit df199d6d56
7 changed files with 27 additions and 21 deletions

View File

@ -1,3 +1,19 @@
2001-04-17 Lars Gullik Bjønnes <larsbj@birdstep.com>
* 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 <rae@lyx.org> 2001-04-16 Allan Rae <rae@lyx.org>
* insettoc.C (Ascii): * insettoc.C (Ascii):

View File

@ -72,7 +72,7 @@ struct ExternalTemplate {
/** /**
A singleton class that manages the external inset templates A singleton class that manages the external inset templates
*/ */
class ExternalTemplateManager : public boost::noncopyable { class ExternalTemplateManager : boost::noncopyable {
public: public:
/// Map from the LyX name of the template to the template structure /// Map from the LyX name of the template to the template structure
typedef std::map<string, ExternalTemplate> Templates; typedef std::map<string, ExternalTemplate> Templates;

View File

@ -194,7 +194,7 @@ void InsetCollapsable::draw(BufferView * bv, LyXFont const & f,
UpdatableInset::draw(bv, f, baseline, x, cleared); UpdatableInset::draw(bv, f, baseline, x, cleared);
#else #else
if (!owner()) if (!owner())
x += (float)scroll(); x += static_cast<float>(scroll());
#endif #endif
if (!cleared && (inset.need_update == InsetText::FULL || if (!cleared && (inset.need_update == InsetText::FULL ||
inset.need_update == InsetText::INIT || inset.need_update == InsetText::INIT ||

View File

@ -74,7 +74,7 @@ private:
/// ///
class InsetCommand : public InsetButton, public boost::noncopyable { class InsetCommand : public InsetButton, boost::noncopyable {
public: public:
/// ///
explicit explicit

View File

@ -24,7 +24,7 @@ struct LaTeXFeatures;
/** Used to include files /** Used to include files
*/ */
class InsetInclude: public InsetButton, public boost::noncopyable { class InsetInclude: public InsetButton, boost::noncopyable {
public: public:
/// the type of inclusion /// the type of inclusion
enum Flags { enum Flags {

View File

@ -126,15 +126,11 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
rows = 1; rows = 1;
if (columns <= 0) if (columns <= 0)
columns = 1; columns = 1;
//tabular = new LyXTabular(this, rows,columns);
tabular.reset(new LyXTabular(this, rows,columns)); tabular.reset(new LyXTabular(this, rows,columns));
// for now make it always display as display() inset // for now make it always display as display() inset
// just for test!!! // just for test!!!
the_locking_inset = 0; the_locking_inset = 0;
locked = no_selection = false; locked = no_selection = false;
#if 0
cursor_visible = false;
#endif
oldcell = -1; oldcell = -1;
actrow = actcell = 0; actrow = actcell = 0;
clearSelection(); clearSelection();
@ -145,13 +141,9 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf) InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
: buffer(&buf) : buffer(&buf)
{ {
//tabular = new LyXTabular(this, *(tab.tabular));
tabular.reset(new LyXTabular(this, *(tab.tabular))); tabular.reset(new LyXTabular(this, *(tab.tabular)));
the_locking_inset = 0; the_locking_inset = 0;
locked = no_selection = false; locked = no_selection = false;
#if 0
cursor_visible = false;
#endif
oldcell = -1; oldcell = -1;
actrow = actcell = 0; actrow = actcell = 0;
sel_cell_start = sel_cell_end = 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); UpdatableInset::draw(bv, font, baseline, x, cleared);
#else #else
if (!owner()) if (!owner())
x += (float)scroll(); x += static_cast<float>(scroll());
#endif #endif
if (!cleared && ((need_update == INIT) || (need_update == FULL) || if (!cleared && ((need_update == INIT) || (need_update == FULL) ||
(top_x != int(x)) || (top_baseline != baseline))) { (top_x != int(x)) || (top_baseline != baseline))) {

View File

@ -37,7 +37,6 @@
#include "lyxcursor.h" #include "lyxcursor.h"
#include "CutAndPaste.h" #include "CutAndPaste.h"
#include "font.h" #include "font.h"
#include "minibuffer.h"
#include "LColor.h" #include "LColor.h"
#include "support/textutils.h" #include "support/textutils.h"
#include "support/LAssert.h" #include "support/LAssert.h"
@ -47,6 +46,8 @@
#include "trans_mgr.h" #include "trans_mgr.h"
#include "lyxscreen.h" #include "lyxscreen.h"
#include "WorkArea.h" #include "WorkArea.h"
#include "lyxfunc.h"
#include "gettext.h"
using std::ostream; using std::ostream;
using std::ifstream; using std::ifstream;
@ -91,9 +92,6 @@ void InsetText::init(InsetText const * ins)
insetDescent = 0; insetDescent = 0;
insetWidth = 0; insetWidth = 0;
the_locking_inset = 0; the_locking_inset = 0;
#if 0
cursor_visible = false;
#endif
interline_space = 1; interline_space = 1;
no_selection = false; no_selection = false;
need_update = INIT; need_update = INIT;
@ -322,7 +320,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
UpdatableInset::draw(bv, f, baseline, x, cleared); UpdatableInset::draw(bv, f, baseline, x, cleared);
#else #else
if (!owner()) if (!owner())
x += (float)scroll(); x += static_cast<float>(scroll());
#endif #endif
// update insetWidth and insetHeight with dummy calls // update insetWidth and insetHeight with dummy calls
(void)ascent(bv, f); (void)ascent(bv, f);
@ -1112,9 +1110,9 @@ InsetText::LocalDispatch(BufferView * bv,
// see if we found the layout number: // see if we found the layout number:
if (!layout.first) { if (!layout.first) {
string msg = string(N_("Layout ")) + arg + N_(" not known"); string const msg = string(N_("Layout ")) + arg + N_(" not known");
bv->owner()->getLyXFunc()
bv->owner()->getMiniBuffer()->Set(msg); ->Dispatch(LFUN_MESSAGE, msg);
break; break;
} }