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 bool 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()));
42 void ControlTabular::clearParams()
49 int ControlTabular::getActiveCell() const
55 LyXTabular const & ControlTabular::tabular() const
57 lyx::Assert(params_.get());
58 return *params_.get();
62 void ControlTabular::set(LyXTabular::Feature f, string const & arg)
64 string const data = featureAsString(f) + ' ' + arg;
65 kernel().dispatch(FuncRequest(LFUN_TABULAR_FEATURE, data));
69 bool ControlTabular::useMetricUnits() const
71 return lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER;