changes... read the changelog...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1896 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-04-04 22:08:13 +00:00
parent b9655a2d25
commit bcd1410de1
6 changed files with 370 additions and 271 deletions

View File

@ -1,5 +1,42 @@
2001-04-05 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insettext.h: reindent
* insettabular.h: make tabular a scoped_ptr
* insettext.C (init): adjust for cursor_visible
(ToggleInsetCursor): constify asc and desc, font, adjust for
cursor_visible
(ShowInsetCursor): constify asc and desc, font, adjust for
cursor_visible
(HideInsetCursor): adjust for cursor_visible
* insettabular.C: reindent some
(InsetTabular): adjust for scoped_ptr and cursor_visible
(InsetTabular): ditto
(~InsetTabular): delete delete
(Clone): adjust for scoped_ptr
(Read): constify old_format, adjust for scoped_ptr, move init of
token
(draw): constify tx, localize loop vars.
some other localization of variables, remove double initilizatons.
* insetfoot.C: remove using std::ostream, add ostream where needed
2001-04-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
* lyxinset.h: some reindentaion, use initializer list for
constructro.
UpdatableInset: make cursor_visible a private var add
public isCursorVisible(), add protected toggleCursorVisible() and
proctected setCursorVisible(bool), make scroll call the Inset::scroll
* insettoc.C: remvoe using decl
(getScreenLabel): make cmdname donst
(LyxCode): ditto
(Ascii): ditto
(Ascii): don't use endl
* insetfootlike.C: remove using decl at file scope and add std::
where needed
* insetmarginal.C: ditto

View File

@ -23,8 +23,6 @@
#include "support/LOstream.h"
#include "debug.h"
using std::ostream;
InsetFoot::InsetFoot()
: InsetFootlike()
@ -51,7 +49,7 @@ string const InsetFoot::EditMessage() const
int InsetFoot::Latex(Buffer const * buf,
ostream & os, bool fragile, bool fp) const
std::ostream & os, bool fragile, bool fp) const
{
os << "\\footnote{%\n";
@ -65,7 +63,7 @@ int InsetFoot::Latex(Buffer const * buf,
bool InsetFoot::InsertInsetAllowed(Inset * in) const
{
if ((in->LyxCode() == Inset::FOOT_CODE) ||
(in->LyxCode() == Inset::MARGIN_CODE)) {
(in->LyxCode() == Inset::MARGIN_CODE)) {
return false;
}
return true;

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,9 @@
#ifndef INSETTABULAR_H
#define INSETTABULAR_H
#include <sigc++/signal_system.h>
#include <boost/smart_ptr.hpp>
#ifdef __GNUG__
#pragma interface
#endif
@ -54,7 +57,6 @@
#include "LString.h"
#include "lyxcursor.h"
#include "lyxfunc.h"
#include <sigc++/signal_system.h>
class LyXLex;
class Painter;
@ -107,7 +109,8 @@ public:
///
bool LockInsetInInset(BufferView *, UpdatableInset *);
///
bool UnlockInsetInInset(BufferView *, UpdatableInset *, bool lr = false);
bool UnlockInsetInInset(BufferView *, UpdatableInset *,
bool lr = false);
///
bool UpdateInsetInInset(BufferView *, Inset *);
///
@ -132,7 +135,7 @@ public:
void InsetKeyPress(XKeyEvent *);
///
UpdatableInset::RESULT LocalDispatch(BufferView *, kb_action,
string const &);
string const &);
///
int Latex(Buffer const *, std::ostream &, bool, bool) const;
///
@ -153,7 +156,7 @@ public:
bool TabularFeatures(BufferView * bv, string const & what);
///
void TabularFeatures(BufferView * bv, LyXTabular::Feature feature,
string const & val = string());
string const & val = string());
///
int GetActCell() const { return actcell; }
///
@ -163,7 +166,8 @@ public:
///
Buffer * BufferOwner() const { return const_cast<Buffer *>(buffer); }
///
LyXText * getLyXText(BufferView const *, bool const recursive = false) const;
LyXText * getLyXText(BufferView const *,
bool const recursive = false) const;
///
void resizeLyXText(BufferView *) const;
///
@ -176,7 +180,8 @@ public:
//
// Public structures and variables
///
LyXTabular * tabular;
//LyXTabular * tabular;
boost::scoped_ptr<LyXTabular> tabular;
///
SigC::Signal0<void> hideDialog;

View File

@ -91,7 +91,9 @@ 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;
@ -1268,16 +1270,16 @@ void InsetText::ToggleInsetCursor(BufferView * bv)
return;
}
LyXFont font = TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
LyXFont const font(TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv)));
int asc = lyxfont::maxAscent(font);
int desc = lyxfont::maxDescent(font);
int const asc = lyxfont::maxAscent(font);
int const desc = lyxfont::maxDescent(font);
if (cursor_visible)
if (isCursorVisible())
bv->hideLockedInsetCursor();
else
bv->showLockedInsetCursor(cx(bv), cy(bv), asc, desc);
cursor_visible = !cursor_visible;
toggleCursorVisible();
}
@ -1287,25 +1289,26 @@ void InsetText::ShowInsetCursor(BufferView * bv, bool show)
the_locking_inset->ShowInsetCursor(bv);
return;
}
if (!cursor_visible) {
LyXFont font = TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
if (!isCursorVisible()) {
LyXFont const font =
TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
int asc = lyxfont::maxAscent(font);
int desc = lyxfont::maxDescent(font);
int const asc = lyxfont::maxAscent(font);
int const desc = lyxfont::maxDescent(font);
bv->fitLockedInsetCursor(cx(bv), cy(bv), asc, desc);
if (show)
bv->showLockedInsetCursor(cx(bv), cy(bv), asc, desc);
cursor_visible = true;
setCursorVisible(true);
}
}
void InsetText::HideInsetCursor(BufferView * bv)
{
if (cursor_visible) {
if (isCursorVisible()) {
bv->hideLockedInsetCursor();
cursor_visible = false;
setCursorVisible(false);
}
if (the_locking_inset)
the_locking_inset->HideInsetCursor(bv);

View File

@ -128,7 +128,7 @@ public:
UpdatableInset::RESULT LocalDispatch(BufferView *, kb_action, string const &);
///
int Latex(Buffer const *, std::ostream &,
bool fragile, bool free_spc) const;
bool fragile, bool free_spc) const;
///
int Ascii(Buffer const *, std::ostream &, int linelen) const;
///
@ -209,18 +209,18 @@ private:
void HideInsetCursor(BufferView *);
///
UpdatableInset::RESULT moveRight(BufferView *, bool activate_inset = true,
bool selecting = false);
bool selecting = false);
///
UpdatableInset::RESULT moveLeft(BufferView *, bool activate_inset = true,
bool selecting = false);
bool selecting = false);
///
UpdatableInset::RESULT moveRightIntern(BufferView *, bool behind,
bool activate_inset = true,
bool selecting = false);
bool activate_inset = true,
bool selecting = false);
///
UpdatableInset::RESULT moveLeftIntern(BufferView *, bool behind,
bool activate_inset = true,
bool selecting = false);
bool activate_inset = true,
bool selecting = false);
///
UpdatableInset::RESULT moveUp(BufferView *);
@ -234,7 +234,7 @@ private:
bool checkAndActivateInset(BufferView * bv, bool behind);
///
bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
int button = 0);
int button = 0);
void removeNewlines();
///