*
* Copyright 2000 The LyX Team.
*
- *======================================================
+ * ======================================================
*/
#include <config.h>
using std::ifstream;
using std::max;
using std::endl;
+using std::swap;
#define cellstart(p) ((p % 2) == 0)
float & x, bool cleared) const
{
Painter & pain = bv->painter();
- int i, j, cell=0;
+ int i, j, cell = 0;
int nx;
float cx;
void InsetTabular::DrawCellSelection(Painter & pain, int x, int baseline,
int row, int column, int cell) const
{
- int tmp;
-
int cs = tabular->column_of_cell(sel_cell_start);
int ce = tabular->column_of_cell(sel_cell_end);
if (cs > ce) {
int rs = tabular->row_of_cell(sel_cell_start);
int re = tabular->row_of_cell(sel_cell_end);
- if (rs > re) {
- tmp = rs;
- rs = re;
- re = tmp;
- }
+ if (rs > re) swap(rs, re);
if ((column >= cs) && (column <= ce) && (row >= rs) && (row <= re)) {
int w = tabular->GetWidthOfColumn(cell);
locked = false;
}
+
void InsetTabular::UpdateLocal(BufferView * bv, UpdateCodes what,
bool mark_dirty)
{
resetPos(bv);
}
+
bool InsetTabular::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
{
lyxerr[Debug::INSETS] << "InsetTabular::LockInsetInInset(" <<inset<< "): ";
return false;
}
+
bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
bool lr)
{
return false;
}
+
bool InsetTabular::UpdateInsetInInset(BufferView * bv, Inset * inset)
{
if (!the_locking_inset)
}
-int InsetTabular::Latex(Buffer const * buf, ostream & os, bool fragile, bool fp) const
+int InsetTabular::Latex(Buffer const * buf, ostream & os,
+ bool fragile, bool fp) const
{
return tabular->Latex(buf, os, fragile, fp);
}
return 0;
}
+
int InsetTabular::Linuxdoc(Buffer const *, ostream &) const
{
return 0;
resetPos(bv);
}
+
int InsetTabular::getCellXPos(int cell) const
{
int c;
ADD_TO_TABULAR_WIDTH);
}
+
void InsetTabular::resetPos(BufferView * bv) const
{
if (!locked)
}
}
+
bool InsetTabular::ActivateCellInset(BufferView * bv, int x, int y, int button,
bool behind)
{
return true;
}
+
bool InsetTabular::InsetHit(BufferView * bv, int x, int ) const
{
InsetText * inset = tabular->GetCellInset(actcell);
}
}
+
// This returns paperWidth() if the cell-width is unlimited or the width
// in pixels if we have a pwidth for this cell.
int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const
return VSpace(s).inPixels( 0, 0);
}
+
int InsetTabular::getMaxWidth(Painter & pain,
UpdatableInset const * inset) const
{
return w;
}
-void InsetTabular::recomputeTextInsets(BufferView * bv, const LyXFont & font) const
+
+void InsetTabular::recomputeTextInsets(BufferView * bv,
+ LyXFont const & font) const
{
InsetText * inset;
int cell;