case LFUN_MOUSE_RELEASE:
//lyxerr << "# InsetTabular::MouseRelease\n" << bvcur << endl;
if (cmd.button() == mouse_button::button1) {
- if (bvcur.selection() && !tablemode(bvcur))
- saveSelection(bvcur);
+ if (bvcur.selection()) {
+ // Bug3238: disable persistent selection for table cells for now
+ if (tablemode(bvcur))
+ theSelection().haveSelection(true);
+ else
+ saveSelection(bvcur);
+ }
} else if (cmd.button() == mouse_button::button3)
InsetTabularMailer(*this).showDialog(&cur.bv());
break;
TextMetrics const & tm =
cur.bv().textMetrics(cell(cur.idx())->getText(0));
cur.pos() = tm.x2pos(cur.pit(), 0, cur.targetX());
- if (cmd.action == LFUN_DOWN_SELECT && !tablemode(cur))
- saveSelection(cur);
+ if (cmd.action == LFUN_DOWN_SELECT) {
+ // Bug3238: disable persistent selection for table cells for now
+ if (tablemode(cur))
+ theSelection().haveSelection(true);
+ else
+ saveSelection(cur);
+ }
}
if (sl == cur.top()) {
// we trick it to go to the RIGHT after leaving the
ParagraphMetrics const & pm =
tm.parMetrics(cur.lastpit());
cur.pos() = tm.x2pos(cur.pit(), pm.rows().size()-1, cur.targetX());
- if (cmd.action == LFUN_UP_SELECT && !tablemode(cur))
- saveSelection(cur);
+ if (cmd.action == LFUN_UP_SELECT) {
+ // Bug3238: disable persistent selection for table cells for now
+ if (tablemode(cur))
+ theSelection().haveSelection(true);
+ else
+ saveSelection(cur);
+ }
}
if (sl == cur.top()) {
cmd = FuncRequest(LFUN_FINISHED_UP);
int InsetTabular::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
return tabular.latex(buf, os, runparams);
}
int InsetTabular::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
- int const dp = runparams.linelen ? runparams.depth : 0;
- return tabular.plaintext(buf, os, runparams, dp, false, 0);
+ os << '\n'; // output table on a new line
+ int const dp = runparams.linelen > 0 ? runparams.depth : 0;
+ tabular.plaintext(buf, os, runparams, dp, false, 0);
+ return PLAINTEXT_NEWLINE;
}
int InsetTabular::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
int ret = 0;
InsetBase * master = 0;
true, true);
odocstringstream os;
- OutputParams const runparams;
+ OutputParams const runparams(0);
paste_tabular->plaintext(cur.buffer(), os, runparams, 0, true, '\t');
// Needed for the "Edit->Paste recent" menu and the system clipboard.
cap::copySelection(cur, os.str());