+/////////////////////////////////////////////////////////////////////
+//
+// InsetTableCell
+//
+/////////////////////////////////////////////////////////////////////
+
+InsetTableCell::InsetTableCell(Buffer const & buf,
+ Tabular::CellData const * cell, Tabular const * table)
+ : InsetText(buf), cell_data_(cell), table_(table)
+{}
+
+
+bool InsetTableCell::forceEmptyLayout(idx_type) const
+{
+ BOOST_ASSERT(table_);
+ BOOST_ASSERT(cell_data_);
+ return table_->getPWidth(cell_data_->cellno).zero();
+}
+
+bool InsetTableCell::allowParagraphCustomization(idx_type) const
+{
+ BOOST_ASSERT(table_);
+ BOOST_ASSERT(cell_data_);
+ return !table_->getPWidth(cell_data_->cellno).zero();
+}
+
+bool InsetTableCell::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ bool enabled;
+ switch (cmd.action) {
+ case LFUN_LAYOUT:
+ enabled = !forceEmptyLayout();
+ break;
+ case LFUN_LAYOUT_PARAGRAPH:
+ enabled = allowParagraphCustomization();
+ break;
+ default:
+ return InsetText::getStatus(cur, cmd, status);
+ }
+ status.enabled(enabled);
+ return true;
+}
+