simplify some, ws, begin minibuffer simplification

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1905 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-04-06 12:47:50 +00:00
parent a3a1d06f72
commit 4314e0e5cf
12 changed files with 262 additions and 193 deletions

View File

@ -10,8 +10,8 @@ src/CutAndPaste.C
src/debug.C src/debug.C
src/exporter.C src/exporter.C
src/ext_l10n.h src/ext_l10n.h
src/figureForm.C
src/figure_form.C src/figure_form.C
src/figureForm.C
src/FontLoader.C src/FontLoader.C
src/frontends/controllers/ButtonController.h src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C src/frontends/controllers/character.C
@ -90,67 +90,67 @@ src/frontends/qt2/paragraphdlgimpl.C
src/frontends/qt2/tabularcreatedlgimpl.C src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibtex.C src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C src/frontends/xforms/form_browser.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C src/frontends/xforms/form_character.C
src/frontends/xforms/FormCitation.C src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_copyright.C src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormCredits.C src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_credits.C src/frontends/xforms/form_credits.C
src/frontends/xforms/FormDocument.C src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_document.C src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C src/frontends/xforms/form_error.C
src/frontends/xforms/FormExternal.C src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C src/frontends/xforms/form_external.C
src/frontends/xforms/FormFiledialog.C src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormGraphics.C src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormInclude.C src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C src/frontends/xforms/form_include.C
src/frontends/xforms/FormIndex.C src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDelim.C src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsMatrix.C src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsPanel.C src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsSpace.C src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMinipage.C src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormParagraph.C src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreamble.C src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreferences.C src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C src/frontends/xforms/form_ref.C
src/frontends/xforms/FormSearch.C src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C src/frontends/xforms/form_search.C
src/frontends/xforms/FormTabular.C src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_tabular.C src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C src/frontends/xforms/Menubar_pimpl.C

View File

@ -864,9 +864,11 @@ void BufferView::updateInset(Inset * inset, bool mark_dirty)
if (text->UpdateInset(this, inset)) { if (text->UpdateInset(this, inset)) {
update(); update();
if (mark_dirty) { if (mark_dirty) {
#if 0
if (buffer()->isLyxClean()) if (buffer()->isLyxClean())
owner()->getMiniBuffer()-> owner()->getMiniBuffer()->
setTimer(4); setTimer(4);
#endif
buffer()->markDirty(); buffer()->markDirty();
} }
updateScrollbar(); updateScrollbar();
@ -876,9 +878,11 @@ void BufferView::updateInset(Inset * inset, bool mark_dirty)
if (text->UpdateInset(this, theLockingInset())) { if (text->UpdateInset(this, theLockingInset())) {
update(); update();
if (mark_dirty){ if (mark_dirty){
#if 0
if (buffer()->isLyxClean()) if (buffer()->isLyxClean())
owner()->getMiniBuffer()-> owner()->getMiniBuffer()->
setTimer(4); setTimer(4);
#endif
buffer()->markDirty(); buffer()->markDirty();
} }
updateScrollbar(); updateScrollbar();

View File

@ -1102,7 +1102,9 @@ void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f)
if ((f & CHANGE)) { if ((f & CHANGE)) {
if (buffer_->isLyxClean()) { if (buffer_->isLyxClean()) {
buffer_->markDirty(); buffer_->markDirty();
#if 0
owner_->getMiniBuffer()->setTimer(4); owner_->getMiniBuffer()->setTimer(4);
#endif
} else { } else {
buffer_->markDirty(); buffer_->markDirty();
} }
@ -1217,7 +1219,7 @@ void BufferView::Pimpl::savePosition(unsigned int i)
bv_->text->cursor.par()->id(), bv_->text->cursor.par()->id(),
bv_->text->cursor.pos()); bv_->text->cursor.pos());
if (i > 0) if (i > 0)
owner_->getMiniBuffer()->Set(_("Saved bookmark ") + tostr(i)); owner_->getMiniBuffer()->Set(_("Saved bookmark"), tostr(i));
} }
@ -1250,7 +1252,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
#endif #endif
update(bv_->text, BufferView::SELECT|BufferView::FITCUR); update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
if (i > 0) if (i > 0)
owner_->getMiniBuffer()->Set(_("Moved to bookmark ") + tostr(i)); owner_->getMiniBuffer()->Set(_("Moved to bookmark"), tostr(i));
} }

View File

@ -1,3 +1,20 @@
2001-04-06 Lars Gullik Bjønnes <larsbj@birdstep.com>
* tabular.[Ch] (getLabelList): implement new method
* minibuffer.h: comment ouf setTiimer
* minibuffer.C (ExecutingCB): constify res
(peek_event): constify s
(Set): constify ntext
(Init): constify nicename
* BufferView2.C (updateInset): comment out Minibuffer::setTimer
* BufferView_pimpl.C (update): comment out Minibuffer::setTimer
(savePosition): use two params to Minibuffer::Set
(restorePosition): ditto
2001-04-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2001-04-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_main.C: include language.h * lyx_main.C: include language.h

View File

@ -1,3 +1,12 @@
2001-04-06 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insettext.C (InsetText): fix new
(InsetText): reindent some, simplify deletion of par list
(clear): simplify deletion of par list, fix new
(SetParagraphData): simplify deletion of par list
* insettabular.[Ch] (getLabelList): implement new method
2001-04-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2001-04-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyxinset.h: do not include gettext.h... * lyxinset.h: do not include gettext.h...

View File

@ -2161,6 +2161,12 @@ LyXFunc::func_status InsetTabular::getStatus(string const & what) const
} }
std::vector<string> const InsetTabular::getLabelList() const
{
return tabular->getLabelList();
}
bool InsetTabular::copySelection(BufferView * bv) bool InsetTabular::copySelection(BufferView * bv)
{ {
if (!hasSelection()) if (!hasSelection())

View File

@ -176,7 +176,8 @@ public:
bool ShowInsetDialog(BufferView *) const; bool ShowInsetDialog(BufferView *) const;
/// ///
LyXFunc::func_status getStatus(string const & argument) const; LyXFunc::func_status getStatus(string const & argument) const;
///
std::vector<string> const getLabelList() const;
// //
// Public structures and variables // Public structures and variables
/// ///
@ -188,13 +189,13 @@ public:
private: private:
/// ///
bool calculate_dimensions_of_cells(BufferView *, LyXFont const &, bool calculate_dimensions_of_cells(BufferView *, LyXFont const &,
bool = false) const; bool = false) const;
/// ///
void DrawCellLines(Painter &, int x, int baseline, void DrawCellLines(Painter &, int x, int baseline,
int row, int cell) const; int row, int cell) const;
/// ///
void DrawCellSelection(Painter &, int x, int baseline, void DrawCellSelection(Painter &, int x, int baseline,
int row, int column, int cell) const; int row, int column, int cell) const;
/// ///
void ShowInsetCursor(BufferView *, bool show=true); void ShowInsetCursor(BufferView *, bool show=true);
/// ///
@ -223,17 +224,19 @@ private:
void RemoveTabularRow(); void RemoveTabularRow();
/// ///
bool hasSelection() const { bool hasSelection() const {
return sel_cell_start != sel_cell_end; return sel_cell_start != sel_cell_end;
} }
/// ///
void clearSelection() const { void clearSelection() const {
sel_cell_start = sel_cell_end = 0; sel_cell_start = sel_cell_end = 0;
} }
/// ///
bool ActivateCellInset(BufferView *, int x = 0, int y = 0, int button = 0, bool ActivateCellInset(BufferView *, int x = 0, int y = 0,
bool behind = false); int button = 0,
bool behind = false);
/// ///
bool ActivateCellInsetAbs(BufferView *, int x = 0, int y=0, int button=0); bool ActivateCellInsetAbs(BufferView *, int x = 0, int y = 0,
int button = 0);
/// ///
bool InsetHit(BufferView * bv, int x, int y) const; bool InsetHit(BufferView * bv, int x, int y) const;
/// ///

View File

@ -60,7 +60,7 @@ extern int greek_kb_flag;
InsetText::InsetText() InsetText::InsetText()
{ {
par = new LyXParagraph(); par = new LyXParagraph;
init(); init();
} }
@ -119,25 +119,23 @@ InsetText::~InsetText()
{ {
// delete all instances of LyXText before deleting the paragraps used // delete all instances of LyXText before deleting the paragraps used
// by it. // by it.
for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit){ for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit) {
delete (*cit).second; delete (*cit).second;
(*cit).second = 0; (*cit).second = 0;
} }
#ifndef NEW_INSETS #ifndef NEW_INSETS
LyXParagraph * p = par->next_; LyXParagraph * p = par->next_;
delete par; delete par;
while(p) { while(p) {
par = p; par = p;
p = p->next_; p = p->next_;
delete par; delete par;
} }
#else #else
LyXParagraph * p = par->next(); while (par) {
delete par; LyXParagraph * tmp = par->next();
while(p) { delete par;
par = p; par = tmp;
p = p->next();
delete par;
} }
#endif #endif
} }
@ -160,15 +158,13 @@ void InsetText::clear()
delete par; delete par;
} }
#else #else
LyXParagraph * p = par->next(); while (par) {
delete par; LyXParagraph * tmp = par->next();
while(p) {
par = p;
p = p->next();
delete par; delete par;
par = tmp;
} }
#endif #endif
par = new LyXParagraph(); par = new LyXParagraph;
} }
@ -220,12 +216,10 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
delete par; delete par;
} }
#else #else
LyXParagraph * p = par->next(); while (par) {
delete par; LyXParagraph * tmp = par->next();
while(p) {
par = p;
p = p->next();
delete par; delete par;
par = tmp;
} }
#endif #endif
par = new LyXParagraph; par = new LyXParagraph;
@ -237,12 +231,12 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
if (token == "\\end_inset") if (token == "\\end_inset")
break; break;
if (const_cast<Buffer*>(buf)-> if (const_cast<Buffer*>(buf)->
parseSingleLyXformat2Token(lex, par, return_par,token, pos, depth, parseSingleLyXformat2Token(lex, par, return_par,
font token, pos, depth, font
#ifndef NEW_INSETS #ifndef NEW_INSETS
, footnoteflag, footnotekind , footnoteflag, footnotekind
#endif #endif
)) ))
{ {
// the_end read this should NEVER happen // the_end read this should NEVER happen
lex.printError("\\the_end read in inset! Error in document!"); lex.printError("\\the_end read in inset! Error in document!");
@ -312,9 +306,9 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
if ((drawFrame == LOCKED) && !locked && !par->size()) { if ((drawFrame == LOCKED) && !locked && !par->size()) {
if (!cleared && (need_update & CLEAR_FRAME)) { if (!cleared && (need_update & CLEAR_FRAME)) {
pain.rectangle(top_x + 1, baseline - insetAscent + 1, pain.rectangle(top_x + 1, baseline - insetAscent + 1,
width(bv, f) - 1, width(bv, f) - 1,
insetAscent + insetDescent - 1, insetAscent + insetDescent - 1,
LColor::background); LColor::background);
} }
top_x = int(x); top_x = int(x);
top_baseline = baseline; top_baseline = baseline;
@ -333,9 +327,8 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
// if top_x differs we have a rule down and we don't have to clear anything // if top_x differs we have a rule down and we don't have to clear anything
if (!cleared && (top_x == int(x)) && if (!cleared && (top_x == int(x)) &&
((need_update==INIT)||(need_update==FULL)||(top_baseline!=baseline) || ((need_update == INIT) || (need_update == FULL) || (top_baseline != baseline) ||
(last_drawn_width!=insetWidth))) (last_drawn_width!=insetWidth))) {
{
int w = insetWidth; int w = insetWidth;
int h = insetAscent + insetDescent; int h = insetAscent + insetDescent;
int ty = baseline - insetAscent; int ty = baseline - insetAscent;
@ -381,6 +374,8 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
return; return;
} }
x += TEXT_TO_INSET_OFFSET; x += TEXT_TO_INSET_OFFSET;
#warning Jürgen, why is this a block of its own? (Lgb)
{ {
int y = 0; int y = 0;
Row * row = TEXT(bv)->GetRowNearY(y); Row * row = TEXT(bv)->GetRowNearY(y);
@ -432,12 +427,14 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
((drawFrame == ALWAYS) || ((drawFrame == LOCKED) && locked))) ((drawFrame == ALWAYS) || ((drawFrame == LOCKED) && locked)))
{ {
pain.rectangle(top_x + 1, baseline - insetAscent + 1, pain.rectangle(top_x + 1, baseline - insetAscent + 1,
width(bv, f) - 1, insetAscent + insetDescent - 1, width(bv, f) - 1,
frame_color); insetAscent + insetDescent - 1,
frame_color);
} else if (need_update & CLEAR_FRAME) { } else if (need_update & CLEAR_FRAME) {
pain.rectangle(top_x + 1, baseline - insetAscent + 1, pain.rectangle(top_x + 1, baseline - insetAscent + 1,
width(bv, f) - 1, insetAscent + insetDescent - 1, width(bv, f) - 1,
LColor::background); insetAscent + insetDescent - 1,
LColor::background);
} }
x += width(bv, f) - TEXT_TO_INSET_OFFSET; x += width(bv, f) - TEXT_TO_INSET_OFFSET;
if (bv->text->status==LyXText::CHANGED_IN_DRAW) { if (bv->text->status==LyXText::CHANGED_IN_DRAW) {
@ -484,7 +481,7 @@ void InsetText::update(BufferView * bv, LyXFont const & font, bool reinit)
update(bv, font, reinit); update(bv, font, reinit);
return; return;
} }
if ((need_update==CURSOR_PAR) && (TEXT(bv)->status==LyXText::UNCHANGED) && if ((need_update == CURSOR_PAR) && (TEXT(bv)->status == LyXText::UNCHANGED) &&
the_locking_inset) the_locking_inset)
{ {
TEXT(bv)->UpdateInset(bv, the_locking_inset); TEXT(bv)->UpdateInset(bv, the_locking_inset);
@ -500,6 +497,7 @@ void InsetText::update(BufferView * bv, LyXFont const & font, bool reinit)
TEXT_TO_INSET_OFFSET; TEXT_TO_INSET_OFFSET;
} }
void InsetText::SetUpdateStatus(BufferView * bv, int what) void InsetText::SetUpdateStatus(BufferView * bv, int what)
{ {
need_update |= what; need_update |= what;
@ -513,6 +511,7 @@ void InsetText::SetUpdateStatus(BufferView * bv, int what)
TEXT(bv)->ClearSelection(bv); TEXT(bv)->ClearSelection(bv);
} }
void InsetText::UpdateLocal(BufferView * bv, int what, bool mark_dirty) void InsetText::UpdateLocal(BufferView * bv, int what, bool mark_dirty)
{ {
TEXT(bv)->FullRebreak(bv); TEXT(bv)->FullRebreak(bv);
@ -550,8 +549,8 @@ void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button)
inset_par = 0; inset_par = 0;
old_par = 0; old_par = 0;
if (!checkAndActivateInset(bv, x, y, button)) if (!checkAndActivateInset(bv, x, y, button))
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset, TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
y+insetAscent); y + insetAscent);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor; TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
bv->text->FinishUndo(); bv->text->FinishUndo();
ShowInsetCursor(bv); ShowInsetCursor(bv);
@ -584,7 +583,7 @@ void InsetText::InsetUnlock(BufferView * bv)
UpdateLocal(bv, CLEAR_FRAME|CURSOR, false); UpdateLocal(bv, CLEAR_FRAME|CURSOR, false);
if (owner()) if (owner())
bv->owner()->setLayout(owner()->getLyXText(bv) bv->owner()->setLayout(owner()->getLyXText(bv)
->cursor.par()->GetLayout()); ->cursor.par()->GetLayout());
else else
bv->owner()->setLayout(bv->text->cursor.par()->GetLayout()); bv->owner()->setLayout(bv->text->cursor.par()->GetLayout());
} }
@ -592,7 +591,8 @@ void InsetText::InsetUnlock(BufferView * bv)
bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset) bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
{ {
lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset(" << inset << "): "; lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset("
<< inset << "): ";
if (!inset) if (!inset)
return false; return false;
if (inset == cpar(bv)->GetInset(cpos(bv))) { if (inset == cpar(bv)->GetInset(cpos(bv))) {
@ -629,7 +629,7 @@ bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
bool InsetText::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset, bool InsetText::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
bool lr) bool lr)
{ {
if (!the_locking_inset) if (!the_locking_inset)
return false; return false;
@ -707,7 +707,8 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
inset_par = cpar(bv); inset_par = cpar(bv);
inset_boundary = cboundary(bv); inset_boundary = cboundary(bv);
the_locking_inset = uinset; the_locking_inset = uinset;
uinset->InsetButtonPress(bv, x - inset_x, y - inset_y, button); uinset->InsetButtonPress(bv, x - inset_x, y - inset_y,
button);
uinset->Edit(bv, x - inset_x, y - inset_y, 0); uinset->Edit(bv, x - inset_x, y - inset_y, 0);
if (the_locking_inset) if (the_locking_inset)
UpdateLocal(bv, CURSOR, false); UpdateLocal(bv, CURSOR, false);
@ -722,7 +723,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
paste_internally = true; paste_internally = true;
} }
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset, TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
y + insetAscent); y + insetAscent);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor; TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
UpdateLocal(bv, CURSOR, false); UpdateLocal(bv, CURSOR, false);
bv->owner()->setLayout(cpar(bv)->GetLayout()); bv->owner()->setLayout(cpar(bv)->GetLayout());
@ -734,7 +735,8 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
if (paste_internally) if (paste_internally)
LocalDispatch(bv, LFUN_PASTE, ""); LocalDispatch(bv, LFUN_PASTE, "");
else else
LocalDispatch(bv, LFUN_PASTESELECTION, "paragraph"); LocalDispatch(bv, LFUN_PASTESELECTION,
"paragraph");
} }
} }
ShowInsetCursor(bv); ShowInsetCursor(bv);
@ -748,18 +750,23 @@ void InsetText::InsetButtonRelease(BufferView * bv, int x, int y, int button)
if (the_locking_inset) { if (the_locking_inset) {
the_locking_inset->InsetButtonRelease(bv, the_locking_inset->InsetButtonRelease(bv,
x - inset_x, y - inset_y, x - inset_x, y - inset_y,
button); button);
} else { } else {
if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) { if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
inset = static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv))); inset = static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
if (inset->Editable() == Inset::HIGHLY_EDITABLE) { if (inset->Editable() == Inset::HIGHLY_EDITABLE) {
inset->InsetButtonRelease(bv, x - inset_x, y - inset_y,button); inset->InsetButtonRelease(bv,
x - inset_x,
y - inset_y, button);
} else { } else {
inset_x = cx(bv) - top_x + drawTextXOffset; inset_x = cx(bv) - top_x + drawTextXOffset;
inset_y = cy(bv) + drawTextYOffset; inset_y = cy(bv) + drawTextYOffset;
inset->InsetButtonRelease(bv, x - inset_x, y - inset_y,button); inset->InsetButtonRelease(bv,
inset->Edit(bv, x - inset_x, y - inset_y, button); x - inset_x,
y - inset_y, button);
inset->Edit(bv,
x - inset_x, y - inset_y, button);
} }
UpdateLocal(bv, CURSOR_PAR, false); UpdateLocal(bv, CURSOR_PAR, false);
} }
@ -774,12 +781,12 @@ void InsetText::InsetMotionNotify(BufferView * bv, int x, int y, int state)
return; return;
if (the_locking_inset) { if (the_locking_inset) {
the_locking_inset->InsetMotionNotify(bv, x - inset_x, the_locking_inset->InsetMotionNotify(bv, x - inset_x,
y - inset_y,state); y - inset_y,state);
return; return;
} }
HideInsetCursor(bv); HideInsetCursor(bv);
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset, TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
y+insetAscent); y + insetAscent);
TEXT(bv)->SetSelection(bv); TEXT(bv)->SetSelection(bv);
if (TEXT(bv)->toggle_cursor.par()!=TEXT(bv)->toggle_end_cursor.par() || if (TEXT(bv)->toggle_cursor.par()!=TEXT(bv)->toggle_end_cursor.par() ||
TEXT(bv)->toggle_cursor.pos()!=TEXT(bv)->toggle_end_cursor.pos()) TEXT(bv)->toggle_cursor.pos()!=TEXT(bv)->toggle_end_cursor.pos())
@ -799,7 +806,7 @@ void InsetText::InsetKeyPress(XKeyEvent * xke)
UpdatableInset::RESULT UpdatableInset::RESULT
InsetText::LocalDispatch(BufferView * bv, InsetText::LocalDispatch(BufferView * bv,
kb_action action, string const & arg) kb_action action, string const & arg)
{ {
no_selection = false; no_selection = false;
UpdatableInset::RESULT UpdatableInset::RESULT
@ -808,7 +815,7 @@ InsetText::LocalDispatch(BufferView * bv,
return DISPATCHED; return DISPATCHED;
} }
result=DISPATCHED; result = DISPATCHED;
if ((action < 0) && arg.empty()) if ((action < 0) && arg.empty())
return FINISHED; return FINISHED;
@ -862,13 +869,13 @@ InsetText::LocalDispatch(BufferView * bv,
bv->text->SetUndo(bv->buffer(), Undo::INSERT, bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
bv->setState(); bv->setState();
if (lyxrc.auto_region_delete) { if (lyxrc.auto_region_delete) {
if (TEXT(bv)->selection){ if (TEXT(bv)->selection){
@ -892,7 +899,7 @@ InsetText::LocalDispatch(BufferView * bv,
UpdateLocal(bv, CURSOR_PAR, true); UpdateLocal(bv, CURSOR_PAR, true);
result=DISPATCHED_NOUPDATE; result=DISPATCHED_NOUPDATE;
break; break;
// --- Cursor Movements --------------------------------------------- // --- Cursor Movements -----------------------------------
case LFUN_RIGHTSEL: case LFUN_RIGHTSEL:
bv->text->FinishUndo(); bv->text->FinishUndo();
moveRight(bv, false, true); moveRight(bv, false, true);
@ -949,11 +956,11 @@ InsetText::LocalDispatch(BufferView * bv,
case LFUN_BACKSPACE: case LFUN_BACKSPACE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE, bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
if (TEXT(bv)->selection) if (TEXT(bv)->selection)
@ -965,11 +972,11 @@ InsetText::LocalDispatch(BufferView * bv,
case LFUN_DELETE: case LFUN_DELETE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE, bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
if (TEXT(bv)->selection) if (TEXT(bv)->selection)
@ -981,11 +988,11 @@ InsetText::LocalDispatch(BufferView * bv,
case LFUN_CUT: case LFUN_CUT:
bv->text->SetUndo(bv->buffer(), Undo::DELETE, bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
TEXT(bv)->CutSelection(bv); TEXT(bv)->CutSelection(bv);
@ -1023,11 +1030,11 @@ InsetText::LocalDispatch(BufferView * bv,
} }
bv->text->SetUndo(bv->buffer(), Undo::INSERT, bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
TEXT(bv)->PasteSelection(bv); TEXT(bv)->PasteSelection(bv);
@ -1050,11 +1057,11 @@ InsetText::LocalDispatch(BufferView * bv,
return DISPATCHED; return DISPATCHED;
bv->text->SetUndo(bv->buffer(), Undo::INSERT, bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
TEXT(bv)->InsertChar(bv, LyXParagraph::META_NEWLINE); TEXT(bv)->InsertChar(bv, LyXParagraph::META_NEWLINE);
@ -1239,7 +1246,7 @@ void InsetText::Validate(LaTeXFeatures & features) const
int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const
{ {
if (textclasslist.Style(buf->params.textclass, if (textclasslist.Style(buf->params.textclass,
p->GetLayout()).labeltype != LABEL_MANUAL) p->GetLayout()).labeltype != LABEL_MANUAL)
return 0; return 0;
else else
return p->BeginningOfMainBody(); return p->BeginningOfMainBody();
@ -1247,7 +1254,7 @@ int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const
void InsetText::GetCursorPos(BufferView * bv, void InsetText::GetCursorPos(BufferView * bv,
int & x, int & y) const int & x, int & y) const
{ {
x = cx(bv); x = cx(bv);
y = cy(bv); y = cy(bv);
@ -1336,7 +1343,7 @@ InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
UpdatableInset::RESULT UpdatableInset::RESULT
InsetText::moveRightIntern(BufferView * bv, bool behind, InsetText::moveRightIntern(BufferView * bv, bool behind,
bool activate_inset, bool selecting) bool activate_inset, bool selecting)
{ {
#ifndef NEW_INSETS #ifndef NEW_INSETS
if (!cpar(bv)->next_ && (cpos(bv) >= cpar(bv)->Last())) if (!cpar(bv)->next_ && (cpos(bv) >= cpar(bv)->Last()))
@ -1355,7 +1362,7 @@ InsetText::moveRightIntern(BufferView * bv, bool behind,
UpdatableInset::RESULT UpdatableInset::RESULT
InsetText::moveLeftIntern(BufferView * bv, bool behind, InsetText::moveLeftIntern(BufferView * bv, bool behind,
bool activate_inset, bool selecting) bool activate_inset, bool selecting)
{ {
#ifndef NEW_INSETS #ifndef NEW_INSETS
if (!cpar(bv)->previous_ && (cpos(bv) <= 0)) if (!cpar(bv)->previous_ && (cpos(bv) <= 0))
@ -1401,13 +1408,13 @@ bool InsetText::InsertInset(BufferView * bv, Inset * inset)
} }
bv->text->SetUndo(bv->buffer(), Undo::INSERT, bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
inset->setOwner(this); inset->setOwner(this);
HideInsetCursor(bv); HideInsetCursor(bv);
TEXT(bv)->InsertInset(bv, inset); TEXT(bv)->InsertInset(bv, inset);
@ -1470,13 +1477,13 @@ void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
if (TEXT(bv)->selection) { if (TEXT(bv)->selection) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT, bv->text->SetUndo(bv->buffer(), Undo::EDIT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else #else
bv->text->cursor.par()->previous(), bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next() bv->text->cursor.par()->next()
#endif #endif
); );
} }
TEXT(bv)->SetFont(bv, font, toggleall); TEXT(bv)->SetFont(bv, font, toggleall);
bv->fitCursor(TEXT(bv)); bv->fitCursor(TEXT(bv));
@ -1515,7 +1522,7 @@ bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y, bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
int button) int button)
{ {
int dummyx, dummyy; int dummyx, dummyy;
@ -1587,20 +1594,16 @@ void InsetText::SetParagraphData(LyXParagraph * p)
np->SetInsetOwner(this); np->SetInsetOwner(this);
} }
#else #else
LyXParagraph * np; while (par) {
if (par) { LyXParagraph * tmp = par->next();
np = par->next();
delete par; delete par;
while(np) { par = tmp;
par = np;
np = np->next();
delete par;
}
} }
par = p->Clone(); par = p->Clone();
par->SetInsetOwner(this); par->SetInsetOwner(this);
np = par; LyXParagraph * np = par;
while(p->next()) { while (p->next()) {
p = p->next(); p = p->next();
np->next(p->Clone()); np->next(p->Clone());
np->next()->previous(np); np->next()->previous(np);
@ -1616,7 +1619,7 @@ void InsetText::SetText(string const & data)
{ {
clear(); clear();
LyXFont font(LyXFont::ALL_SANE); LyXFont font(LyXFont::ALL_SANE);
for(unsigned int i=0; i < data.length(); ++i) for (unsigned int i=0; i < data.length(); ++i)
par->InsertChar(i, data[i], font); par->InsertChar(i, data[i], font);
} }
@ -1658,7 +1661,8 @@ int InsetText::cx(BufferView * bv) const
int x = text->cursor.x() + top_x + TEXT_TO_INSET_OFFSET; int x = text->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
if (the_locking_inset) { if (the_locking_inset) {
LyXFont font = text->GetFont(bv->buffer(), LyXFont font = text->GetFont(bv->buffer(),
text->cursor.par(), text->cursor.pos()); text->cursor.par(),
text->cursor.pos());
if (font.isVisibleRightToLeft()) if (font.isVisibleRightToLeft())
x -= the_locking_inset->width(bv, font); x -= the_locking_inset->width(bv, font);
} }
@ -1696,7 +1700,8 @@ Row * InsetText::crow(BufferView * bv) const
} }
LyXText * InsetText::getLyXText(BufferView const * lbv, bool const recursive) const LyXText * InsetText::getLyXText(BufferView const * lbv,
bool const recursive) const
{ {
// Super UGLY! (Lgb) // Super UGLY! (Lgb)
BufferView * bv = const_cast<BufferView *>(lbv); BufferView * bv = const_cast<BufferView *>(lbv);
@ -1786,10 +1791,11 @@ void InsetText::resizeLyXText(BufferView * bv) const
* Mechanism when setting the cursor */ * Mechanism when setting the cursor */
TEXT(bv)->mark_set = mark_set; TEXT(bv)->mark_set = mark_set;
if (selection) { if (selection) {
TEXT(bv)->SetCursor(bv, selstartpar, selstartpos,true, TEXT(bv)->SetCursor(bv, selstartpar, selstartpos,
selstartboundary); true, selstartboundary);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor; TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
TEXT(bv)->SetCursor(bv, selendpar, selendpos, true, selendboundary); TEXT(bv)->SetCursor(bv, selendpar, selendpos,
true, selendboundary);
TEXT(bv)->SetSelection(bv); TEXT(bv)->SetSelection(bv);
TEXT(bv)->SetCursor(bv, lpar, pos); TEXT(bv)->SetCursor(bv, lpar, pos);
} else { } else {

View File

@ -62,7 +62,7 @@ void MiniBuffer::ExecutingCB(FL_OBJECT * ob, long)
obj->addHistory(obj->cur_cmd); obj->addHistory(obj->cur_cmd);
// Dispatch only returns requested data for a few commands (ale) // Dispatch only returns requested data for a few commands (ale)
string res = obj->owner->getLyXFunc()->Dispatch(obj->cur_cmd); string const res = obj->owner->getLyXFunc()->Dispatch(obj->cur_cmd);
lyxerr.debug() << "Minibuffer Res: " << res << endl; lyxerr.debug() << "Minibuffer Res: " << res << endl;
obj->shows_no_match = false; obj->shows_no_match = false;
@ -70,7 +70,8 @@ void MiniBuffer::ExecutingCB(FL_OBJECT * ob, long)
} }
extern "C" void C_MiniBuffer_ExecutingCB(FL_OBJECT * ob, long) extern "C"
void C_MiniBuffer_ExecutingCB(FL_OBJECT * ob, long)
{ {
MiniBuffer * obj = static_cast<MiniBuffer*>(ob->u_vdata); MiniBuffer * obj = static_cast<MiniBuffer*>(ob->u_vdata);
obj->Init(); obj->Init();
@ -102,7 +103,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, FL_Coord, FL_Coord,
case XK_Tab: case XK_Tab:
{ {
// complete or increment the command // complete or increment the command
string s(lyxaction.getApproxFuncName(fl_get_input(ob))); string const s(lyxaction.getApproxFuncName(fl_get_input(ob)));
if (!s.empty()) if (!s.empty())
fl_set_input(ob, s.c_str()); fl_set_input(ob, s.c_str());
return 1; return 1;
@ -139,9 +140,10 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, FL_Coord, FL_Coord,
} }
extern "C" int C_MiniBuffer_peek_event(FL_OBJECT * ob, int event, extern "C"
FL_Coord, FL_Coord, int C_MiniBuffer_peek_event(FL_OBJECT * ob, int event,
int key, void * xev) FL_Coord, FL_Coord,
int key, void * xev)
{ {
return MiniBuffer::peek_event(ob, event, 0, 0, key, xev); return MiniBuffer::peek_event(ob, event, 0, 0, key, xev);
} }
@ -189,7 +191,7 @@ void MiniBuffer::Set(string const& s1, string const& s2,
else else
timer.stop(); timer.stop();
string ntext = strip(s1 + ' ' + s2 + ' ' + s3); string const ntext = strip(s1 + ' ' + s2 + ' ' + s3);
if (!the_buffer->focus) { if (!the_buffer->focus) {
fl_set_input(the_buffer, ntext.c_str()); fl_set_input(the_buffer, ntext.c_str());
@ -218,25 +220,25 @@ void MiniBuffer::Init()
// Else, show the buffer state. // Else, show the buffer state.
else if (owner->view()->available()) { else if (owner->view()->available()) {
string nicename = string const nicename =
MakeDisplayPath(owner->buffer()-> MakeDisplayPath(owner->buffer()->
fileName()); fileName());
// Should we do this instead? (kindo like emacs) // Should we do this instead? (kindo like emacs)
// leaves more room for other information // leaves more room for other information
text = "LyX: "; text = "LyX: ";
text += nicename; text += nicename;
if (owner->buffer()->lyxvc.inUse()) { if (owner->buffer()->lyxvc.inUse()) {
text += " ["; text += " [";
text += owner->buffer()->lyxvc.version(); text += owner->buffer()->lyxvc.version();
text += ' '; text += ' ';
text += owner->buffer()->lyxvc.locker(); text += owner->buffer()->lyxvc.locker();
if (owner->buffer()->isReadonly()) if (owner->buffer()->isReadonly())
text += " (RO)"; text += " (RO)";
text += ']'; text += ']';
} else if (owner->buffer()->isReadonly()) } else if (owner->buffer()->isReadonly())
text += " [RO]"; text += " [RO]";
if (!owner->buffer()->isLyxClean()) if (!owner->buffer()->isLyxClean())
text += _(" (Changed)"); text += _(" (Changed)");
} else { } else {
if (text != _("Welcome to LyX!")) // this is a hack if (text != _("Welcome to LyX!")) // this is a hack
text = _("* No document open *"); text = _("* No document open *");

View File

@ -23,11 +23,13 @@ public:
/// ///
bool shows_no_match; bool shows_no_match;
#if 0
/// ///
void setTimer(unsigned int a) { void setTimer(unsigned int a) {
timer.setTimeout(a * 1000); timer.setTimeout(a * 1000);
} }
#endif
/// ///
void Set(string const & = string(), void Set(string const & = string(),
string const & = string(), string const & = string(),

View File

@ -2544,6 +2544,20 @@ void LyXTabular::Validate(LaTeXFeatures & features) const
} }
std::vector<string> const LyXTabular::getLabelList() const
{
std::vector<string> label_list;
for (int i = 0; i < rows_; ++i)
for (int j = 0; j < columns_; ++j) {
std::vector<string> const l =
GetCellInset(i, j)->getLabelList();
label_list.insert(label_list.end(),
l.begin(), l.end());
}
return label_list;
}
#ifndef NEW_INSETS #ifndef NEW_INSETS
LyXTabular::BoxType LyXTabular::UseParbox(int cell) const LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
{ {

View File

@ -206,17 +206,19 @@ public:
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetAllLines(int cell, bool line); bool SetAllLines(int cell, bool line);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetTopLine(int cell, bool line, bool onlycolumn=false); bool SetTopLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetBottomLine(int cell, bool line, bool onlycolumn=false); bool SetBottomLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetLeftLine(int cell, bool line, bool onlycolumn=false); bool SetLeftLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetRightLine(int cell, bool line, bool onlycolumn=false); bool SetRightLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetAlignment(int cell, LyXAlignment align, bool onlycolumn = false); bool SetAlignment(int cell, LyXAlignment align,
bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false /// Returns true if a complete update is necessary, otherwise false
bool SetVAlignment(int cell, VAlignment align, bool onlycolumn = false); bool SetVAlignment(int cell, VAlignment align,
bool onlycolumn = false);
/// ///
bool SetColumnPWidth(int cell, string const & width); bool SetColumnPWidth(int cell, string const & width);
/// ///
@ -283,13 +285,14 @@ public:
// helper function for Latex returns number of newlines // helper function for Latex returns number of newlines
/// ///
int AsciiTopHLine(std::ostream &, int row, int AsciiTopHLine(std::ostream &, int row,
std::vector<unsigned int> const &) const; std::vector<unsigned int> const &) const;
/// ///
int AsciiBottomHLine(std::ostream &, int row, int AsciiBottomHLine(std::ostream &, int row,
std::vector<unsigned int> const &) const; std::vector<unsigned int> const &) const;
/// ///
int AsciiPrintCell(Buffer const *, std::ostream &, int cell, int row, int AsciiPrintCell(Buffer const *, std::ostream &,
int column, std::vector<unsigned int> const &) const; int cell, int row, int column,
std::vector<unsigned int> const &) const;
/// ///
int Ascii(Buffer const *, std::ostream &) const; int Ascii(Buffer const *, std::ostream &) const;
/// ///
@ -366,8 +369,9 @@ public:
InsetTabular * owner() const { return owner_; } InsetTabular * owner() const { return owner_; }
/// ///
void Validate(LaTeXFeatures &) const; void Validate(LaTeXFeatures &) const;
///
private: ////////////////////////////////////////////////////////////////// std::vector<string> const getLabelList() const;
private:
/// ///
struct cellstruct { struct cellstruct {
/// ///