-std::string const InsetCommandParams::getOptions() const
-{
- for (size_t i = 0; i < info_->n; ++i)
- if (info_->optional[i])
- return to_utf8(params_[i]);
- lyxerr << "Programming error: get nonexisting option in "
- << name_ << " inset." << endl;;
- return string();
-}
-
-
-std::string const InsetCommandParams::getSecOptions() const
-{
- bool first = true;
- for (size_t i = 0; i < info_->n; ++i)
- if (info_->optional[i]) {
- if (first)
- first = false;
- else
- return to_utf8(params_[i]);
- }
- // Happens in InsetCitation
- lyxerr << "Programming error: get nonexisting second option in "
- << name_ << " inset." << endl;;
- return string();
-}
-
-
-std::string const InsetCommandParams::getContents() const
-{
- for (size_t i = 0; i < info_->n; ++i)
- if (!info_->optional[i])
- return to_utf8(params_[i]);
- BOOST_ASSERT(false);
- return string();
-}
-
-
-void InsetCommandParams::setOptions(std::string const & o)
-{
- for (size_t i = 0; i < info_->n; ++i)
- if (info_->optional[i]) {
- params_[i] = from_utf8(o);
- return;
- }
- lyxerr << "Programming error: set nonexisting option in "
- << name_ << " inset." << endl;;
-}
-
-
-void InsetCommandParams::setSecOptions(std::string const & s)
-{
- bool first = true;
- for (size_t i = 0; i < info_->n; ++i)
- if (info_->optional[i]) {
- if (first)
- first = false;
- else {
- params_[i] = from_utf8(s);
- return;
- }
- }
- // Happens in InsetCitation
- lyxerr << "Programming error: set nonexisting second option in "
- << name_ << " inset." << endl;;