}
if (in->getInsetFromID(id)) {
actcell = i;
- the_locking_inset = in;
- locked = true;
- resetPos(bv);
+ in->edit(bv);
+// the_locking_inset = in;
+// locked = true;
+// resetPos(bv);
return the_locking_inset->lockInsetInInset(bv, inset);
}
}
int InsetTabular::linuxdoc(Buffer const * buf, ostream & os) const
{
- return tabular->ascii(buf,os, (int)parOwner()->params().depth(), false, 0);
+ os << "<![CDATA[";
+ int const ret = tabular->ascii(buf,os,
+ (int)parOwner()->params().depth(),
+ false, 0);
+ os << "]]>";
+ return ret;
}
if (len.zero())
return -1;
-#ifdef WITH_WARNINGS
-#warning Remove use of VSpace as soon as LyXLength::inPixels exists (JMarc)
-#endif
- return VSpace(len).inPixels(bv);
+ return len.inPixels(latexTextWidth(bv), bv->text->defaultHeight());
}
int InsetTabular::getMaxWidth(BufferView * bv,
UpdatableInset const * inset) const
{
- int cell = tabular->cur_cell;
- if (tabular->GetCellInset(cell) != inset) {
- cell = actcell;
- if (tabular->GetCellInset(cell) != inset) {
-
- lyxerr[Debug::INSETTEXT] << "Actcell not equal to actual cell!\n";
- cell = -1;
- }
- }
-
- int const n = tabular->GetNumberOfCells();
+ int cell = tabular->GetCellFromInset(inset, actcell);
if (cell == -1) {
- for (cell = 0; cell < n; ++cell) {
- if (tabular->GetCellInset(cell) == inset)
- break;
- }
- }
-
- if (cell >= n) {
- lyxerr << "Own inset not found, shouldn't really happen!\n";
+ lyxerr << "Own inset not found, shouldn't really happen!"
+ << endl;
return -1;
}
bool InsetTabular::forceDefaultParagraphs(Inset const * in) const
{
- int const n = tabular->GetNumberOfCells();
- static int last = 0;
+ const int cell = tabular->GetCellFromInset(in, actcell);
- // maybe some speedup
- if ((last < n) && tabular->GetCellInset(last) == in) {
- if (tabular->GetPWidth(last+1).zero())
- return true;
- return false;
- }
- if ((++last < n) && tabular->GetCellInset(last) == in) {
- if (tabular->GetPWidth(last).zero())
- return true;
- return false;
- }
+ if (cell != -1)
+ return tabular->GetPWidth(cell).zero();
- for(int i=0; i < n; ++i) {
- if (tabular->GetCellInset(i) == in) {
- last = i;
- if (tabular->GetPWidth(i).zero())
- return true;
- return false;
- }
- }
- last = 0;
// well we didn't obviously find it so maybe our owner knows more
if (owner())
return owner()->forceDefaultParagraphs(in);