3 * \file ControlTabular.C
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
14 #include "ControlTabular.h"
15 #include "funcrequest.h"
17 #include "insets/insettabular.h"
18 #include "support/LAssert.h"
21 ControlTabular::ControlTabular(Dialog & parent)
22 : Dialog::Controller(parent), active_cell_(-1)
26 void ControlTabular::initialiseParams(string const & data)
28 Buffer * buffer = kernel().buffer();
32 InsetTabular tmp(*buffer);
33 int cell = InsetTabularMailer::string2params(data, tmp);
35 params_.reset(new LyXTabular(*tmp.tabular.get()));
41 void ControlTabular::clearParams()
48 int ControlTabular::getActiveCell() const
54 LyXTabular const & ControlTabular::tabular() const
56 lyx::Assert(params_.get());
57 return *params_.get();
61 void ControlTabular::set(LyXTabular::Feature f, string const & arg)
63 string const data = featureAsString(f) + ' ' + arg;
64 kernel().dispatch(FuncRequest(LFUN_TABULAR_FEATURE, data));
68 bool ControlTabular::useMetricUnits() const
70 return lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER;