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>
* insettoc.C (Ascii):

View File

@ -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<string, ExternalTemplate> Templates;

View File

@ -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<float>(scroll());
#endif
if (!cleared && (inset.need_update == InsetText::FULL ||
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:
///
explicit

View File

@ -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 {

View File

@ -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<float>(scroll());
#endif
if (!cleared && ((need_update == INIT) || (need_update == FULL) ||
(top_x != int(x)) || (top_baseline != baseline))) {

View File

@ -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<float>(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;
}