mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-03 14:13:58 +00:00
Fix metrics of varwidth cells (#12089)
This commit is contained in:
parent
8d09fb5bf0
commit
7f78050957
@ -1385,6 +1385,7 @@ bool Tabular::setMColumnPWidth(Cursor & cur, idx_type cell,
|
||||
bool Tabular::toggleVarwidth(idx_type cell, bool const varwidth)
|
||||
{
|
||||
column_info[cellColumn(cell)].varwidth = varwidth;
|
||||
cellInset(cell).get()->toggleVarWidth(varwidth);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4194,7 +4195,7 @@ Tabular::BoxType Tabular::useBox(idx_type cell) const
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
InsetTableCell::InsetTableCell(Buffer * buf)
|
||||
: InsetText(buf, InsetText::PlainLayout), isFixedWidth(false),
|
||||
: InsetText(buf, InsetText::PlainLayout), isFixedWidth(false), isVarwidth(false),
|
||||
isMultiColumn(false), isMultiRow(false), contentAlign(LYX_ALIGN_CENTER)
|
||||
{}
|
||||
|
||||
@ -4288,7 +4289,7 @@ void InsetTableCell::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
|
||||
// We tell metrics here not to expand on multiple pars
|
||||
// This is the difference to InsetText::Metrics
|
||||
if (hasFixedWidth())
|
||||
if (hasFixedWidth() || isVarwidth)
|
||||
tm.metrics(mi, dim, mi.base.textwidth, false);
|
||||
else
|
||||
tm.metrics(mi, dim, 0, false);
|
||||
|
@ -68,6 +68,8 @@ public:
|
||||
///
|
||||
void toggleFixedWidth(bool fw) { isFixedWidth = fw; }
|
||||
///
|
||||
void toggleVarWidth(bool vw) { isVarwidth = vw; }
|
||||
///
|
||||
void toggleMultiCol(bool m) { isMultiColumn = m; }
|
||||
///
|
||||
void toggleMultiRow(bool m) { isMultiRow = m; }
|
||||
@ -123,6 +125,8 @@ private:
|
||||
///
|
||||
bool isFixedWidth;
|
||||
///
|
||||
bool isVarwidth;
|
||||
///
|
||||
bool isMultiColumn;
|
||||
///
|
||||
bool isMultiRow;
|
||||
|
Loading…
Reference in New Issue
Block a user