+2000-09-28 Juergen Vigna <jug@sad.it>
+
+ * src/insets/insettabular.C (update): fixed cursor setting when
+ the_locking_inset changed.
+ (draw): made this a bit cleaner.
+
+ * various files: added LyXText Parameter to fitCursor call.
+
+ * src/BufferView.C (fitCursor): added LyXText parameter.
+
+ * src/insets/insettabular.C (draw): small draw fix.
+
+ * src/tabular.C: right setting of left/right celllines.
+
+ * src/tabular.[Ch]: fixed various types in funcions and structures.
+ * src/insets/insettabular.C: ditto
+ * src/frontends/xforms/FormTabular.C: ditto
+
2000-09-28 Allan Rae <rae@lyx.org>
* src/paragraph.C (TeXOnePar): fixed output of '\n'. The problem was
}
-void BufferView::fitCursor()
+void BufferView::fitCursor(LyXText * text)
{
- pimpl_->fitCursor();
+ pimpl_->fitCursor(text);
}
///
void redraw();
///
- void fitCursor();
+ void fitCursor(LyXText *);
///
void update();
//
// if we are in a locking inset we should try to insert the
// inset there otherwise this is a illegal function now
if (the_locking_inset) {
- if (the_locking_inset->InsertInsetAllowed(inset) &&
- the_locking_inset->InsertInset(this, inset))
- return true;
+ if (the_locking_inset->InsertInsetAllowed(inset))
+ return the_locking_inset->InsertInset(this, inset);
return false;
}
}
text->InsertInset(this, inset);
-#if 1
- // if we enter a text-inset the cursor should be to the left side
- // of it! This couldn't happen before as Undo was not handled inside
- // inset now after the Undo LyX tries to call inset->Edit(...) again
- // and cannot do this as the cursor is behind the inset and GetInset
- // does not return the inset!
- if (inset->IsTextInset()) {
- if (text->cursor.par()->isRightToLeftPar(buffer()->params))
- text->CursorRight(this);
- else
- text->CursorLeft(this);
- }
-#endif
update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
text->UnFreezeUndo();
text->SetCursorIntern(this, cursor.par(), cursor.pos());
redraw();
- fitCursor();
- //updateScrollbar();
+ fitCursor(text);
}
#endif
}
-bool BufferView::Pimpl::fitCursor()
+bool BufferView::Pimpl::fitCursor(LyXText * text)
{
Assert(screen_); // it is a programming error to call fitCursor
// without a valid screen.
- bool ret = screen_->FitCursor(bv_->text);
- if (ret) updateScrollbar();
+ bool ret = screen_->FitCursor(text);
+ if (ret)
+ updateScrollbar();
return ret;
}
bv_->text->SetSelection();
screen_->ToggleToggle(bv_->text);
- fitCursor();
+ fitCursor(bv_->text);
screen_->ShowCursor(bv_->text);
}
return;
bv_->text->cursor.x_fix(bv_->text->cursor.x());
owner_->updateLayoutChoice();
- if (fitCursor()) {
+ if (fitCursor(bv_->text)) {
selection_possible = false;
}
// fitCursor() ensures we don't jump back
// to the start of the document on vertical
// resize
- fitCursor();
+ fitCursor(bv_->text);
// The main window size has changed, repaint most stuff
redraw();
update();
if ((f & FITCUR)) {
- fitCursor();
+ fitCursor(bv_->text);
}
if ((f & CHANGE)) {
///
void redraw();
/// Return true if the cursor was fitted.
- bool fitCursor();
+ bool fitCursor(LyXText *);
///
void redoCurrentBuffer();
///
// error insets after we ran LaTeX this must be run:
if (removedErrorInsets || (res & Literate::ERRORS)){
users->redraw();
- users->fitCursor();
+ users->fitCursor(users->text);
//users->updateScrollbar();
}
AllowInput(users);
// must be run:
if (removedErrorInsets || (res & Literate::ERRORS)){
users->redraw();
- users->fitCursor();
+ users->fitCursor(users->text);
//users->updateScrollbar();
}
AllowInput(users);
// error insets after we ran chktex, this must be run:
if (removedErrorInsets || res){
users->redraw();
- users->fitCursor();
- //users->updateScrollbar();
+ users->fitCursor(users->text);
}
AllowInput(users);
///
void redraw() {
users->redraw();
- users->fitCursor();
+ users->fitCursor(users->text);
//users->updateScrollbar();
}
// error insets after we ran LaTeX this must be run:
if (a || (result & LaTeX::ERRORS)){
bv->redraw();
- bv->fitCursor();
- //bv->updateScrollbar();
+ bv->fitCursor(bv->text);
}
// check return value from latex.run().
* tabular = inset_->tabular;
int
cell,
- s,
- num = 0;
+ s;
+ LyXTabular::Feature
+ num = LyXTabular::LAST_ACTION;
string
special,
str;
bv->text->RedoParagraph(bv);
if (flag) {
bv->redraw();
- bv->fitCursor();
- //bv->updateScrollbar();
+ bv->fitCursor(getLyXText(bv));
} else
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
struct tabular_features {
- int action;
+ LyXTabular::Feature action;
string feature;
};
{ LyXTabular::M_VALIGN_TOP, "m-valign-top" },
{ LyXTabular::M_VALIGN_BOTTOM, "m-valign-bottom" },
{ LyXTabular::M_VALIGN_CENTER, "m-valign-center" },
- { LyXTabular::DELETE_TABULAR, "delete-tabular" },
{ LyXTabular::MULTICOLUMN, "multicolumn" },
{ LyXTabular::SET_ALL_LINES, "set-all-lines" },
{ LyXTabular::UNSET_ALL_LINES, "unset-all-lines" },
return;
bool dodraw;
x += ADD_TO_TABULAR_WIDTH;
- if (cleared || (need_update == FULL) || (need_update == CELL)) {
+ if (cleared) {
for(i = 0; i < tabular->rows(); ++i) {
nx = int(x);
dodraw = ((baseline + tabular->GetDescentOfRow(i)) > 0) &&
- (baseline - tabular->GetAscentOfRow(i)) < pain.paperHeight();
+ (baseline - tabular->GetAscentOfRow(i))<pain.paperHeight();
for(j = 0; j < tabular->columns(); ++j) {
if (tabular->IsPartOfMultiColumn(i, j))
continue;
cx = nx + tabular->GetBeginningOfTextInCell(cell);
- if (hasSelection())
- DrawCellSelection(pain, nx, baseline, i, j, cell);
- if (dodraw && !cleared && locked && the_locking_inset) {
- if (the_locking_inset == tabular->GetCellInset(cell)) {
- LyXText::text_status st = bv->text->status;
- do {
- bv->text->status = st;
- if (need_update == CELL) {
- // clear before the inset
- pain.fillRectangle(
- nx + 1,
- baseline - tabular->GetAscentOfRow(i) + 1,
- int(cx - nx - 1),
- tabular->GetAscentOfRow(i) +
- tabular->GetDescentOfRow(i) - 1);
- // clear behind the inset
- pain.fillRectangle(
- int(cx + the_locking_inset->width(bv,font) + 1),
- baseline - tabular->GetAscentOfRow(i) + 1,
- tabular->GetWidthOfColumn(cell) -
- tabular->GetBeginningOfTextInCell(cell) -
- the_locking_inset->width(bv,font) - 1,
- tabular->GetAscentOfRow(i) +
- tabular->GetDescentOfRow(i) - 1);
- }
- tabular->GetCellInset(cell)->draw(
- bv, font, baseline, cx, false);
- } while(bv->text->status == LyXText::CHANGED_IN_DRAW);
- }
- } else if (dodraw) {
+ if (dodraw) {
+ if (hasSelection())
+ DrawCellSelection(pain, nx, baseline, i, j, cell);
tabular->GetCellInset(cell)->draw(bv, font, baseline, cx,
cleared);
DrawCellLines(pain, nx, baseline, i, cell);
}
baseline += tabular->GetDescentOfRow(i) +
tabular->GetAscentOfRow(i + 1) +
- tabular->GetAdditionalHeight(cell + 1);
+ tabular->GetAdditionalHeight(cell);
+ }
+ } else if (need_update == CELL) {
+ nx = int(x);
+ for(i = 0; (cell < actcell) && (i < tabular->rows()); ++i) {
+ nx = int(x);
+ for(j = 0; (cell < actcell) && (j < tabular->columns()); ++j) {
+ if (tabular->IsPartOfMultiColumn(i, j))
+ continue;
+ nx += tabular->GetWidthOfColumn(cell);
+ ++cell;
+ }
+ baseline += tabular->GetDescentOfRow(i) +
+ tabular->GetAscentOfRow(i + 1) +
+ tabular->GetAdditionalHeight(cell);
+ }
+ if (the_locking_inset == tabular->GetCellInset(cell)) {
+ cx = nx + tabular->GetBeginningOfTextInCell(cell);
+ LyXText::text_status st = bv->text->status;
+ do {
+ bv->text->status = st;
+ if (need_update == CELL) {
+ // clear before the inset
+ pain.fillRectangle(
+ nx + 1,
+ baseline - tabular->GetAscentOfRow(i) + 1,
+ int(cx - nx - 1),
+ tabular->GetAscentOfRow(i) +
+ tabular->GetDescentOfRow(i) - 1);
+ // clear behind the inset
+ pain.fillRectangle(
+ int(cx + the_locking_inset->width(bv,font) + 1),
+ baseline - tabular->GetAscentOfRow(i) + 1,
+ tabular->GetWidthOfColumn(cell) -
+ tabular->GetBeginningOfTextInCell(cell) -
+ the_locking_inset->width(bv,font) - 1,
+ tabular->GetAscentOfRow(i) +
+ tabular->GetDescentOfRow(i) - 1);
+ }
+ tabular->GetCellInset(cell)->draw(bv,font,baseline, cx, false);
+ } while(bv->text->status == LyXText::CHANGED_IN_DRAW);
}
}
x -= ADD_TO_TABULAR_WIDTH;
owner()->update(bv, font, true);
return;
}
- if (the_locking_inset)
+ if (the_locking_inset) {
the_locking_inset->update(bv, font, reinit);
+ resetPos(bv);
+ inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell);
+ inset_y = cursor.y();
+ }
switch(need_update) {
case INIT:
case FULL:
if (hs)
UpdateLocal(bv, SELECTION, false);
break;
-#if 0
- case LFUN_LAYOUT_TABLE:
- {
- dialogs_ = bv->owner()->getDialogs();
- dialogs_->showTabular(this);
- }
- break;
-#else
-#warning Jürgen, have a look. Is this correct? (Lgb)
case LFUN_LAYOUT_TABULAR:
{
dialogs_ = bv->owner()->getDialogs();
dialogs_->showTabular(this);
}
break;
-#endif
case LFUN_TABULAR_FEATURE:
if (!TabularFeatures(bv, arg))
result = UNDISPATCHED;
bool InsetTabular::TabularFeatures(BufferView * bv, string const & what)
{
- int action = LyXTabular::LAST_ACTION;
+ LyXTabular::Feature action = LyXTabular::LAST_ACTION;
int i = 0;
for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
}
-void InsetTabular::TabularFeatures(BufferView * bv, int feature,
+void InsetTabular::TabularFeatures(BufferView * bv,
+ LyXTabular::Feature feature,
string const & value)
{
int i;
int sel_row_end;
int setLines = 0;
LyXAlignment setAlign = LYX_ALIGN_LEFT;
+ LyXTabular::VAlignment setVAlign = LyXTabular::LYX_VALIGN_TOP;
int lineSet;
bool what;
break;
case LyXTabular::M_VALIGN_TOP:
case LyXTabular::VALIGN_TOP:
- setAlign=LyXTabular::LYX_VALIGN_TOP;
+ setVAlign=LyXTabular::LYX_VALIGN_TOP;
break;
case LyXTabular::M_VALIGN_BOTTOM:
case LyXTabular::VALIGN_BOTTOM:
- setAlign=LyXTabular::LYX_VALIGN_BOTTOM;
+ setVAlign=LyXTabular::LYX_VALIGN_BOTTOM;
break;
case LyXTabular::M_VALIGN_CENTER:
case LyXTabular::VALIGN_CENTER:
- setAlign=LyXTabular::LYX_VALIGN_CENTER;
+ setVAlign=LyXTabular::LYX_VALIGN_CENTER;
break;
default:
break;
case LyXTabular::VALIGN_CENTER:
for(i = sel_row_start; i <= sel_row_end; ++i)
for(j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetVAlignment(tabular->GetCellNumber(i, j), setAlign,
- flag);
+ tabular->SetVAlignment(tabular->GetCellNumber(i, j),
+ setVAlign, flag);
if (hasSelection())
UpdateLocal(bv, INIT, true);
else
what = !tabular->GetLTNewPage(actcell);
tabular->SetLTNewPage(actcell, what);
break;
+ // dummy stuff just to avoid warnings
+ case LyXTabular::LAST_ACTION:
+ break;
}
}
///
bool TabularFeatures(BufferView * bv, string const & what);
///
- void TabularFeatures(BufferView * bv, int feature,
+ void TabularFeatures(BufferView * bv, LyXTabular::Feature feature,
string const & val = string());
///
int GetActCell() const { return actcell; }
UpdatableInset * i = static_cast<UpdatableInset *>(inset);
i->setOwner(static_cast<UpdatableInset *>(this));
}
+ HideInsetCursor(bv);
TEXT(bv)->InsertInset(bv, inset);
TEXT(bv)->selection = 0;
+ bv->fitCursor(TEXT(bv));
UpdateLocal(bv, CURSOR_PAR, true);
static_cast<UpdatableInset*>(inset)->Edit(bv, 0, 0, 0);
+ ShowInsetCursor(bv);
return true;
}
case LFUN_REMOVEERRORS:
if (owner->view()->removeAutoInsets()) {
owner->view()->redraw();
- owner->view()->fitCursor();
- //owner->view()->updateScrollbar();
+ owner->view()->fitCursor(owner->view()->text);
}
break;
bool is_rtl = txt->cursor.par()->isRightToLeftPar(owner->buffer()->params);
if(!txt->mark_set) owner->view()->beforeChange();
owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
+ LyXCursor cur = txt->cursor;
if (!is_rtl)
txt->CursorLeft(owner->view(), false);
- if (txt->cursor.pos() < txt->cursor.par()->Last()
- && txt->cursor.par()->GetChar(txt->cursor.pos())
- == LyXParagraph::META_INSET
- && txt->cursor.par()->GetInset(txt->cursor.pos())
- && txt->cursor.par()->GetInset(txt->cursor.pos())->Editable() == Inset::HIGHLY_EDITABLE) {
+ if ((cur != txt->cursor) && // only if really moved!
+ txt->cursor.pos() < txt->cursor.par()->Last() &&
+ (txt->cursor.par()->GetChar(txt->cursor.pos()) ==
+ LyXParagraph::META_INSET) &&
+ txt->cursor.par()->GetInset(txt->cursor.pos()) &&
+ (txt->cursor.par()->GetInset(txt->cursor.pos())->Editable()
+ == Inset::HIGHLY_EDITABLE))
+ {
Inset * tmpinset = txt->cursor.par()->GetInset(txt->cursor.pos());
setMessage(tmpinset->EditMessage());
LyXFont font = txt->GetFont(owner->view()->buffer(),
multicolumn = LyXTabular::CELL_NORMAL;
alignment = LYX_ALIGN_CENTER;
valignment = LYX_VALIGN_TOP;
- top_line = false;
+ top_line = true;
bottom_line = false;
- left_line = false;
+ left_line = true;
right_line = false;
usebox = BOX_NONE;
rotate = false;
cell_info[i][j].inset.SetDrawFrame(0, InsetText::LOCKED);
cell_info[i][j].cellno = cellno++;
}
+ cell_info[i][columns_-1].right_line = true;
}
//row_info[i - 1].bottom_line = true;
//row_info[0].bottom_line = true;
}
-void LyXTabular::set_row_column_number_info()
+void LyXTabular::set_row_column_number_info(bool oldformat)
{
int c = 0;
int column = 0;
for (column = 0; column<columns_; ++column) {
if (IsPartOfMultiColumn(row,column))
continue;
+ // now set the right line of multicolumns right for oldformat read
+ if (oldformat &&
+ cell_info[row][column].multicolumn==CELL_BEGIN_OF_MULTICOLUMN)
+ {
+ int cn=cells_in_multicolumn(cell_info[row][column].cellno);
+ cell_info[row][column].right_line =
+ cell_info[row][column+cn-1].right_line;
+ }
cell_info[row][column].inset.SetAutoBreakRows(
!GetPWidth(GetCellNumber(row, column)).empty());
}
int const row = row_of_cell(cell);
if (!row) return 0;
-#warning Jürgen, should the types change? (Lgb)
- int top = 1; // bool top = true; ??
- int bottom = 1; // bool bottom = true; ??
+ bool top = true;
+ bool bottom = true;
for (int column = 0; column < columns_ - 1 && bottom; ++column) {
switch (cell_info[row - 1][column].multicolumn) {
bool LyXTabular::SetAlignment(int cell, LyXAlignment align, bool onlycolumn)
{
-#warning Please fix align type. (Lgb)
if (!IsMultiColumn(cell) || onlycolumn)
column_info[column_of_cell(cell)].alignment = align;
if (!onlycolumn)
}
-bool LyXTabular::SetVAlignment(int cell, char align, bool onlycolumn)
+bool LyXTabular::SetVAlignment(int cell, VAlignment align, bool onlycolumn)
{
-#warning Please fix align type. (Lgb)
if (!IsMultiColumn(cell) || onlycolumn)
column_info[column_of_cell(cell)].valignment = align;
if (!onlycolumn)
}
-bool LyXTabular::SetAlignSpecial(int cell, string const & special, int what)
+bool LyXTabular::SetAlignSpecial(int cell, string const & special,
+ LyXTabular::Feature what)
{
-#warning Fix the "what" type. (Lgb)
if (what == SET_SPECIAL_MULTI)
cellinfo_of_cell(cell)->align_special = special;
else
}
-char LyXTabular::GetAlignment(int cell, bool onlycolumn) const
+LyXAlignment LyXTabular::GetAlignment(int cell, bool onlycolumn) const
{
-#warning Fix return type. (Lgb)
if (!onlycolumn && IsMultiColumn(cell))
return cellinfo_of_cell(cell)->alignment;
else
}
-char LyXTabular::GetVAlignment(int cell, bool onlycolumn) const
+LyXTabular::VAlignment LyXTabular::GetVAlignment(int cell, bool onlycolumn) const
{
-#warning Fix return type. (Lgb)
if (!onlycolumn && IsMultiColumn(cell))
return cellinfo_of_cell(cell)->valignment;
else
}
+static
+bool getTokenValue(string const str, const char * token, LyXAlignment & num)
+{
+ int tmp;
+ bool ret = getTokenValue(str, token, tmp);
+ num = static_cast<LyXAlignment>(tmp);
+ return ret;
+}
+
+
+static
+bool getTokenValue(string const str, const char * token,
+ LyXTabular::VAlignment & num)
+{
+ int tmp;
+ bool ret = getTokenValue(str, token, tmp);
+ num = static_cast<LyXTabular::VAlignment>(tmp);
+ return ret;
+}
+
+
+static
+bool getTokenValue(string const str, const char * token,
+ LyXTabular::BoxType & num)
+{
+ int tmp;
+ bool ret = getTokenValue(str, token, tmp);
+ num = static_cast<LyXTabular::BoxType>(tmp);
+ return ret;
+}
+
+
static
bool getTokenValue(string const str, const char * token, bool & flag)
{
getline(is, s1, '"');
is >> ch; // skip '"'
getline(is, s2, '"');
- column_info[i].alignment = static_cast<char>(a);
+ column_info[i].alignment = static_cast<LyXAlignment>(a);
column_info[i].left_line = b;
column_info[i].right_line = c;
column_info[i].p_width = s1;
is >> ch; // skip '"'
getline(is, s2, '"');
cell_info[i][j].multicolumn = static_cast<char>(a);
- cell_info[i][j].alignment = static_cast<char>(b);
+ cell_info[i][j].alignment = static_cast<LyXAlignment>(b);
cell_info[i][j].top_line = static_cast<char>(c);
cell_info[i][j].bottom_line = static_cast<char>(d);
+ cell_info[i][j].left_line = column_info[j].left_line;
+ cell_info[i][j].right_line = column_info[j].right_line;
cell_info[i][j].rotate = static_cast<bool>(f);
- cell_info[i][j].usebox = static_cast<bool>(g);
+ cell_info[i][j].usebox = static_cast<BoxType>(g);
cell_info[i][j].align_special = s1;
cell_info[i][j].p_width = s2;
}
}
}
- set_row_column_number_info();
+ set_row_column_number_info(true);
LyXParagraph * par = new LyXParagraph;
LyXParagraph * return_par = 0;
}
-void LyXTabular::SetLongTabular(int what)
+void LyXTabular::SetLongTabular(bool what)
{
-#warning Should what be bool? (Lgb)
is_long_tabular = what;
}
}
-int LyXTabular::GetUsebox(int cell) const
+LyXTabular::BoxType LyXTabular::GetUsebox(int cell) const
{
-#warning should the return type change? (Lgb)
if (column_info[column_of_cell(cell)].p_width.empty() &&
!(IsMultiColumn(cell) && !cellinfo_of_cell(cell)->p_width.empty()))
return BOX_NONE;
int LyXTabular::TeXTopHLine(ostream & os, int row) const
{
-#warning should this return a bool? (Lgb)
int const fcell = GetFirstCellInRow(row);
int const n = NumberOfCellsInRow(fcell) + fcell;
int tmp = 0;
int LyXTabular::TeXBottomHLine(ostream & os, int row) const
{
-#warning should this return a bool? (Lgb)
int const fcell = GetFirstCellInRow(row);
int const n = NumberOfCellsInRow(fcell) + fcell;
int tmp = 0;
}
-bool LyXTabular::UseParbox(int cell) const
+LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
{
LyXParagraph * par = GetCellInset(cell)->par;
for(; par; par = par->next) {
for(int i = 0; i < par->Last(); ++i) {
if (par->GetChar(i) == LyXParagraph::META_NEWLINE)
- return true;
+ return BOX_PARBOX;
}
}
- return false;
+ return BOX_NONE;
}
class LyXTabular {
public:
///
- enum {
+ enum Feature {
///
APPEND_ROW = 0,
///
///
M_VALIGN_CENTER,
///
- DELETE_TABULAR,
- ///
MULTICOLUMN,
///
SET_ALL_LINES,
/// Returns true if a complete update is necessary, otherwise false
bool SetRightLine(int cell, bool line, bool onlycolumn=false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetAlignment(int cell, char align, bool onlycolumn = false);
+ bool SetAlignment(int cell, LyXAlignment align, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetVAlignment(int cell, char align, bool onlycolumn = false);
+ bool SetVAlignment(int cell, VAlignment align, bool onlycolumn = false);
///
bool SetColumnPWidth(int cell, string const & width);
///
bool SetMColumnPWidth(int cell, string const & width);
///
- bool SetAlignSpecial(int cell, string const & special, int what);
+ bool SetAlignSpecial(int cell, string const & special, Feature what);
///
- char GetAlignment(int cell, bool onlycolumn = false) const;
+ LyXAlignment GetAlignment(int cell, bool onlycolumn = false) const;
///
- char GetVAlignment(int cell, bool onlycolumn = false) const;
+ VAlignment GetVAlignment(int cell, bool onlycolumn = false) const;
///
string const GetPWidth(int cell) const;
///
///
int right_column_of_cell(int cell) const;
///
- void SetLongTabular(int what);
+ void SetLongTabular(bool);
///
bool IsLongTabular() const;
///
///
void SetUsebox(int cell, BoxType);
///
- int GetUsebox(int cell) const;
+ BoxType GetUsebox(int cell) const;
//
// Long Tabular Options
///
///
int multicolumn;
///
- int alignment;
+ LyXAlignment alignment;
///
- int valignment;
+ VAlignment valignment;
///
bool top_line;
///
///
bool right_line;
///
- int usebox;
+ BoxType usebox;
///
bool rotate;
///
///
columnstruct();
///
- int alignment;
+ LyXAlignment alignment;
///
- int valignment;
+ VAlignment valignment;
///
bool left_line;
///
///
void Reinit();
///
- void set_row_column_number_info();
+ void set_row_column_number_info(bool oldformat=false);
/// Returns true if a complete update is necessary, otherwise false
bool SetWidthOfMulticolCell(int cell, int new_width);
///
///
int cells_in_multicolumn(int cell) const;
///
- bool UseParbox(int cell) const;
+ BoxType UseParbox(int cell) const;
};
#endif
GetFont(bview->buffer(),
row_ptr->par(), 0));
int w = (inset_owner ? inset_owner->width(bview, font) : ww);
- int xp = (inset_owner ? x : 0);
+ int xp = static_cast<int>(inset_owner ? x : 0);
pain.line(xp, y_offset + y_top,
w, y_offset + y_top,
LColor::topline,
y_bottom -= lyxfont::ascent('x', GetFont(bview->buffer(),
par, par->Last() - 1));
int w = (inset_owner ? inset_owner->width(bview, font) : ww);
- int xp = (inset_owner ? x : 0);
+ int xp = static_cast<int>(inset_owner ? x : 0);
pain.line(xp, y_offset + y_bottom,
w, y_offset + y_bottom,
LColor::topline, Painter::line_solid,
InsertChar(bview, LyXParagraph::META_INSET); /* just to rebreak and refresh correctly.
* The character will not be inserted a
* second time */
+#if 1
+ // if we enter a text-inset the cursor should be to the left side
+ // of it! This couldn't happen before as Undo was not handled inside
+ // inset now after the Undo LyX tries to call inset->Edit(...) again
+ // and cannot do this as the cursor is behind the inset and GetInset
+ // does not return the inset!
+ if (inset->IsTextInset()) {
+ if (cursor.par()->isRightToLeftPar(bview->buffer()->params))
+ CursorRight(bview);
+ else
+ CursorLeft(bview);
+ }
+#endif
}