X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormTabular.C;h=cfb81319dc542ebf0962d541646a11d9f0cb7fbd;hb=d5443737342903de489d527802cd2cdd38987d74;hp=96fc8631d70a7addd001cbe72647971eefe29016;hpb=b538a4c8fefd6831cd660265c7ba04ad4cf0d0f2;p=lyx.git diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 96fc8631d7..cfb81319dc 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -11,24 +11,34 @@ #include #include "FormTabular.h" -#include "ControlTabular.h" #include "forms/form_tabular.h" #include "xforms_helpers.h" #include "xformsBC.h" #include "controllers/ButtonController.h" +#include "controllers/ControlTabular.h" #include "controllers/helper_funcs.h" +#include "support/convert.h" #include "support/lstrings.h" #include "lyx_forms.h" -using namespace lyx::support; +#include -using std::bind2nd; +using boost::bind; + +using std::string; using std::vector; +namespace lyx { + +using support::contains; +using support::getStringFromVector; +using support::isStrDbl; + +namespace frontend { namespace { @@ -45,7 +55,7 @@ typedef FormController > base_class; FormTabular::FormTabular(Dialog & parent) : base_class(parent, _("Table Settings"), scalableTabfolders), - closing_(false), actCell_(-1) + closing_(false), actCell_(LyXTabular::npos) { } @@ -78,7 +88,7 @@ void FormTabular::build() vector units_vec = getLatexUnits(); vector::iterator ret = remove_if(units_vec.begin(), units_vec.end(), - bind2nd(contains_functor(), "%")); + bind(contains, _1, '%')); units_vec.erase(ret, units_vec.end()); string const units = getStringFromVector(units_vec, "|"); @@ -143,24 +153,23 @@ void FormTabular::update() LyXTabular const & tabular = controller().tabular(); int align; - char buf[12]; LyXLength pwidth; string special; - int const cell = controller().getActiveCell(); + LyXTabular::idx_type const cell = controller().getActiveCell(); actCell_ = cell; - int column = tabular.column_of_cell(cell) + 1; + LyXTabular::col_type column = tabular.column_of_cell(cell) + 1; clearMessage(); fl_activate_object(column_options_->input_special_alignment); fl_activate_object(cell_options_->input_special_multialign); fl_activate_object(column_options_->input_column_width); fl_activate_object(column_options_->choice_value_column_width); - sprintf(buf, "%d", column); - fl_set_input(dialog_->input_tabular_column, buf); + fl_set_input(dialog_->input_tabular_column, + convert(column).c_str()); fl_deactivate_object(dialog_->input_tabular_column); - int row = tabular.row_of_cell(cell); - sprintf(buf, "%d", row + 1); - fl_set_input(dialog_->input_tabular_row, buf); + LyXTabular::row_type row = tabular.row_of_cell(cell); + fl_set_input(dialog_->input_tabular_row, + convert(row + 1).c_str()); fl_deactivate_object(dialog_->input_tabular_row); if (tabular.isMultiColumn(cell)) { fl_set_button(cell_options_->check_multicolumn, 1); @@ -482,7 +491,7 @@ ButtonPolicy::SMInput FormTabular::input(FL_OBJECT * ob, long) LyXTabular const & tabular = controller().tabular(); - int const cell = controller().getActiveCell(); + LyXTabular::idx_type const cell = controller().getActiveCell(); // ugly hack to auto-apply the stuff that hasn't been // yet. don't let this continue to exist ... @@ -724,3 +733,6 @@ int FormTabular::checkLongtableOptions(FL_OBJECT * ob, string & special) return LyXTabular::LAST_ACTION; } + +} // namespace frontend +} // namespace lyx