diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 9d7f71f8fd..3af13dfaef 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -125,7 +125,7 @@ bool ControlBibtex::usingBibtopic() const bool ControlBibtex::bibtotoc() const { - return prefixIs(params().getOptions(), "bibtotoc"); + return prefixIs(lyx::to_utf8(params()["options"]), "bibtotoc"); } @@ -135,27 +135,27 @@ string const ControlBibtex::getStylefile() const // own "plain" stylefiles biblio::CiteEngine_enum const & engine = biblio::getEngine(kernel().buffer()); - string defaultstyle; + docstring defaultstyle; switch (engine) { case biblio::ENGINE_BASIC: - defaultstyle = "plain"; + defaultstyle = lyx::from_ascii("plain"); break; case biblio::ENGINE_NATBIB_AUTHORYEAR: - defaultstyle = "plainnat"; + defaultstyle = lyx::from_ascii("plainnat"); break; case biblio::ENGINE_NATBIB_NUMERICAL: - defaultstyle = "plainnat"; + defaultstyle = lyx::from_ascii("plainnat"); break; case biblio::ENGINE_JURABIB: - defaultstyle = "jurabib"; + defaultstyle = lyx::from_ascii("jurabib"); break; } - string bst = params().getOptions(); + docstring bst = params()["btprint"]; if (bibtotoc()){ // bibstyle exists? - if (contains(bst,',')) { - string bibtotoc = "bibtotoc"; + if (contains(bst, ',')) { + docstring bibtotoc = lyx::from_ascii("bibtotoc"); bst = split(bst, bibtotoc, ','); } else bst.erase(); @@ -164,10 +164,11 @@ string const ControlBibtex::getStylefile() const // propose default style file for new insets // existing insets might have (legally) no bst files // (if the class already provides a style) - if (bst.empty() && params().getContents().empty()) + if (bst.empty() && params()["bibfiles"].empty()) bst = defaultstyle; - return bst; + // FIXME UNICODE + return lyx::to_utf8(bst); } } // namespace frontend diff --git a/src/frontends/gtk/GBibItem.C b/src/frontends/gtk/GBibItem.C index 5b589c44a6..58f6e733eb 100644 --- a/src/frontends/gtk/GBibItem.C +++ b/src/frontends/gtk/GBibItem.C @@ -62,15 +62,15 @@ void GBibItem::update() { bc().refreshReadOnly(); - keyentry_->set_text (controller().params().getContents()); - labelentry_->set_text (controller().params().getOptions()); + keyentry_->set_text (lyx::to_utf8(controller().params()["key"])); + labelentry_->set_text (lyx::to_utf8(controller().params()["label"])); } void GBibItem::apply() { - controller().params().setContents(keyentry_->get_text()); - controller().params().setOptions(labelentry_->get_text()); + controller().params()["key"] = lyx::from_utf8(keyentry_->get_text()); + controller().params()["label"] = lyx::from_utf8(labelentry_->get_text()); } void GBibItem::changed() diff --git a/src/frontends/gtk/GBibtex.C b/src/frontends/gtk/GBibtex.C index c902f21f2d..e5f492a595 100644 --- a/src/frontends/gtk/GBibtex.C +++ b/src/frontends/gtk/GBibtex.C @@ -95,7 +95,7 @@ void GBibtex::doBuild() void GBibtex::update() { - string bibs(controller().params().getContents()); + string bibs(lyx::to_utf8(controller().params()["bibfiles"])); string bib; databasesstore_->clear(); @@ -118,7 +118,7 @@ void GBibtex::update() toccheck_->set_sensitive(!bibtopic); - string btprint(controller().params().getSecOptions()); + string btprint(lyx::to_ascii(controller().params()["btprint"])); int btp = 0; if (btprint == "btPrintNotCited") btp = 1; @@ -169,7 +169,7 @@ void GBibtex::apply() dblist += ","; } - controller().params().setContents(dblist); + controller().params()["bibfiles"] = lyx::from_utf8(dblist); string const bibstyle = stylecombo_.get_active_text(); bool const bibtotoc = toccheck_->get_active(); @@ -177,15 +177,15 @@ void GBibtex::apply() if (!bibtopic && bibtotoc && (!bibstyle.empty())) { // both bibtotoc and style - controller().params().setOptions("bibtotoc," + bibstyle); + controller().params()["options"] = lyx::from_utf8("bibtotoc," + bibstyle); } else if (!bibtopic && bibtotoc) { // bibtotoc and no style - controller().params().setOptions("bibtotoc"); + controller().params()["options"] = lyx::from_ascii("bibtotoc"); } else { // only style. An empty one is valid, because some // documentclasses have an own \bibliographystyle{} // command! - controller().params().setOptions(bibstyle); + controller().params()["options"] = lyx::from_utf8(bibstyle); } // bibtopic allows three kinds of sections: @@ -196,18 +196,20 @@ void GBibtex::apply() switch (btp) { case 0: - controller().params().setSecOptions("btPrintCited"); + controller().params()["btprint"] = lyx::from_ascii("btPrintCited"); break; case 1: - controller().params().setSecOptions("btPrintNotCited"); + + controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited"); break; case 2: - controller().params().setSecOptions("btPrintAll"); + + controller().params()["btprint"] = lyx::from_ascii("btPrintAll"); break; } if (!bibtopic) - controller().params().setSecOptions(""); + controller().params()["btprint"] = docstring(); } diff --git a/src/frontends/gtk/GInclude.C b/src/frontends/gtk/GInclude.C index a6cf0db6a4..910457cc49 100644 --- a/src/frontends/gtk/GInclude.C +++ b/src/frontends/gtk/GInclude.C @@ -72,7 +72,7 @@ void GInclude::doBuild() void GInclude::update() { - string const filename = controller().params().getContents(); + string const filename = lyx::to_utf8(controller().params()["filename"]); fileentry_->set_text(filename); string const cmdname = controller().params().getCmdName(); @@ -113,7 +113,7 @@ void GInclude::apply() InsetCommandParams params = controller().params(); params.preview(previewcheck_->get_active()); - params.setContents(fileentry_->get_text()); + params["filename"] = lyx::from_utf8(fileentry_->get_text()); if (includeradio_->get_active()) params.setCmdName("include"); diff --git a/src/frontends/gtk/GRef.C b/src/frontends/gtk/GRef.C index 691d34f5a5..c230ba5f49 100644 --- a/src/frontends/gtk/GRef.C +++ b/src/frontends/gtk/GRef.C @@ -168,8 +168,8 @@ void GRef::update() bc().refreshReadOnly(); jumptobutton_->set_sensitive(true); backbutton_->set_sensitive(false); - labelentry_->set_text(controller().params().getContents()); - nameentry_->set_text(controller().params().getOptions()); + labelentry_->set_text(lyx::to_utf8(controller().params()["reference"])); + nameentry_->set_text(lyx::to_utf8(controller().params()["name"])); // Name is irrelevant to LaTeX/Literate documents Kernel::DocType doctype = kernel().docType(); @@ -240,8 +240,8 @@ void GRef::apply() if (applylock_) return; - controller().params().setContents(labelentry_->get_text()); - controller().params().setOptions(nameentry_->get_text()); + controller().params()["reference"] = lyx::from_utf8(labelentry_->get_text()); + controller().params()["name"] = lyx::from_utf8(nameentry_->get_text()); int const type = formatcombo_->get_active_row_number(); controller().params().setCmdName(InsetRef::getName(type)); } diff --git a/src/frontends/gtk/GText.C b/src/frontends/gtk/GText.C index 9c10d9fb00..6ec6b33598 100644 --- a/src/frontends/gtk/GText.C +++ b/src/frontends/gtk/GText.C @@ -44,14 +44,14 @@ GText::GText(Dialog & parent, docstring const & title, docstring const & label) void GText::apply() { - controller().params().setContents(entry_->get_text()); + controller().params()["name"] = lyx::from_utf8(entry_->get_text()); } void GText::update() { string const contents = support::trim( - controller().params().getContents()); + lyx::to_utf8(controller().params()["name"])); entry_->set_text(contents); } diff --git a/src/frontends/gtk/GUrl.C b/src/frontends/gtk/GUrl.C index 6b762dd65a..8d7e150cc4 100644 --- a/src/frontends/gtk/GUrl.C +++ b/src/frontends/gtk/GUrl.C @@ -77,10 +77,8 @@ void GUrl::onEntryChanged() void GUrl::update() { - url_->set_text(Glib::locale_to_utf8( - controller().params().getContents())); - name_->set_text(Glib::locale_to_utf8( - controller().params().getOptions())); + url_->set_text(lyx::to_utf8(controller().params()["target"])); + name_->set_text(lyx::to_utf8(controller().params()["name"])); if (controller().params().getCmdName() == "url") htmlType_->set_active(false); else @@ -90,10 +88,8 @@ void GUrl::update() void GUrl::apply() { - controller().params().setContents( - Glib::locale_to_utf8(url_->get_text())); - controller().params().setOptions( - Glib::locale_to_utf8(name_->get_text())); + controller().params()["target"] = lyx::from_utf8(url_->get_text()); + controller().params()["name"] = lyx::from_utf8(name_->get_text()); if (htmlType_->get_active()) controller().params().setCmdName("htmlurl"); else diff --git a/src/frontends/qt3/QBibitem.C b/src/frontends/qt3/QBibitem.C index 5d4ea733a5..435ec1f3ef 100644 --- a/src/frontends/qt3/QBibitem.C +++ b/src/frontends/qt3/QBibitem.C @@ -46,15 +46,15 @@ void QBibitem::build_dialog() void QBibitem::update_contents() { - dialog_->keyED->setText(toqstr(controller().params().getContents())); - dialog_->labelED->setText(toqstr(controller().params().getOptions())); + dialog_->keyED->setText(toqstr(controller().params()["key"])); + dialog_->labelED->setText(toqstr(controller().params()["label"])); } void QBibitem::apply() { - controller().params().setContents(fromqstr(dialog_->keyED->text())); - controller().params().setOptions(fromqstr(dialog_->labelED->text())); + controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text()); + controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text()); } diff --git a/src/frontends/qt3/QBibtex.C b/src/frontends/qt3/QBibtex.C index 2a1e30b826..7ff7bb28d6 100644 --- a/src/frontends/qt3/QBibtex.C +++ b/src/frontends/qt3/QBibtex.C @@ -76,8 +76,8 @@ void QBibtex::update_contents() dialog_->databaseLB->clear(); - string bibs(controller().params().getContents()); - string bib; + docstring bibs(controller().params()["bibfiles"]); + docstring bib; while (!bibs.empty()) { bibs = split(bibs, bib, ','); @@ -99,7 +99,7 @@ void QBibtex::update_contents() dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic); dialog_->bibtocCB->setEnabled(!bibtopic); - string btprint(controller().params().getSecOptions()); + docstring btprint(controller().params()["bibfiles"]); int btp = 0; if (btprint == "btPrintNotCited") btp = 1; @@ -138,30 +138,30 @@ void QBibtex::update_contents() void QBibtex::apply() { - string dbs(fromqstr(dialog_->databaseLB->text(0))); + docstring dbs(qstring_to_ucs4(dialog_->databaseLB->text(0))); unsigned int maxCount = dialog_->databaseLB->count(); for (unsigned int i = 1; i < maxCount; i++) { dbs += ','; - dbs += fromqstr(dialog_->databaseLB->text(i)); + dbs += qstring_to_ucs4(dialog_->databaseLB->text(i)); } - controller().params().setContents(dbs); + controller().params()["bibfiles"] = dbs; - string const bibstyle(fromqstr(dialog_->styleCB->currentText())); + docstring const bibstyle(qstring_to_ucs4(dialog_->styleCB->currentText())); bool const bibtotoc(dialog_->bibtocCB->isChecked()); if (bibtotoc && (!bibstyle.empty())) { // both bibtotoc and style - controller().params().setOptions("bibtotoc," + bibstyle); + controller().params()["options"] = "bibtotoc," + bibstyle; } else if (bibtotoc) { // bibtotoc and no style - controller().params().setOptions("bibtotoc"); + controller().params()["options"] = lyx::from_ascii("bibtotoc"); } else { // only style. An empty one is valid, because some // documentclasses have an own \bibliographystyle{} // command! - controller().params().setOptions(bibstyle); + controller().params()["options"] = bibstyle; } // bibtopic allows three kinds of sections: @@ -172,18 +172,18 @@ void QBibtex::apply() switch (btp) { case 0: - controller().params().setSecOptions("btPrintCited"); + controller().params()["btprint"] = lyx::from_ascii("btPrintCited"); break; case 1: - controller().params().setSecOptions("btPrintNotCited"); + controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited"); break; case 2: - controller().params().setSecOptions("btPrintAll"); + controller().params()["btprint"] = lyx::from_ascii("btPrintAll"); break; } if (!controller().usingBibtopic()) - controller().params().setSecOptions(""); + controller().params()["btprint"] = docstring(); } diff --git a/src/frontends/qt3/QInclude.C b/src/frontends/qt3/QInclude.C index efafd2433c..270100b166 100644 --- a/src/frontends/qt3/QInclude.C +++ b/src/frontends/qt3/QInclude.C @@ -63,7 +63,7 @@ void QInclude::update_contents() InsetCommandParams const & params = controller().params(); - dialog_->filenameED->setText(toqstr(params.getContents())); + dialog_->filenameED->setText(toqstr(params["filename"])); dialog_->visiblespaceCB->setChecked(false); dialog_->visiblespaceCB->setEnabled(false); @@ -100,7 +100,7 @@ void QInclude::apply() { InsetCommandParams params = controller().params(); - params.setContents(fromqstr(dialog_->filenameED->text())); + params["filename"] = qstring_to_ucs4(dialog_->filenameED->text()); params.preview(dialog_->previewCB->isChecked()); int const item = dialog_->typeCO->currentItem(); diff --git a/src/frontends/qt3/QIndex.C b/src/frontends/qt3/QIndex.C index 0bcae0cdcd..5dd923a400 100644 --- a/src/frontends/qt3/QIndex.C +++ b/src/frontends/qt3/QIndex.C @@ -50,16 +50,16 @@ void QIndex::build_dialog() void QIndex::update_contents() { - string const contents = controller().params().getContents(); - dialog_->keywordED->setText(toqstr(contents)); + docstring const & name = controller().params()["name"]; + dialog_->keywordED->setText(toqstr(name)); - bc().valid(!contents.empty()); + bc().valid(!name.empty()); } void QIndex::apply() { - controller().params().setContents(fromqstr(dialog_->keywordED->text())); + controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text()); } diff --git a/src/frontends/qt3/QRef.C b/src/frontends/qt3/QRef.C index a444683e3b..7552516382 100644 --- a/src/frontends/qt3/QRef.C +++ b/src/frontends/qt3/QRef.C @@ -71,13 +71,13 @@ void QRef::update_contents() int orig_type = dialog_->typeCO->currentItem(); - dialog_->referenceED->setText(toqstr(params.getContents())); + dialog_->referenceED->setText(toqstr(params["reference"])); - dialog_->nameED->setText(toqstr(params.getOptions())); + dialog_->nameED->setText(toqstr(params["name"])); dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly()); // restore type settings for new insets - if (params.getContents().empty()) + if (params["reference"].empty()) dialog_->typeCO->setCurrentItem(orig_type); else dialog_->typeCO->setCurrentItem(InsetRef::getType(params.getCmdName())); @@ -95,7 +95,7 @@ void QRef::update_contents() dialog_->bufferCO->insertItem(toqstr(*it)); } // restore the buffer combo setting for new insets - if (params.getContents().empty() && restored_buffer_ != -1 + if (params["reference"].empty() && restored_buffer_ != -1 && restored_buffer_ < dialog_->bufferCO->count()) dialog_->bufferCO->setCurrentItem(restored_buffer_); else @@ -111,8 +111,8 @@ void QRef::apply() InsetCommandParams & params = controller().params(); params.setCmdName(InsetRef::getName(dialog_->typeCO->currentItem())); - params.setContents(fromqstr(dialog_->referenceED->text())); - params.setOptions(fromqstr(dialog_->nameED->text())); + params["reference"] = qstring_to_ucs4(dialog_->referenceED->text()); + params["name"] = qstring_to_ucs4(dialog_->nameED->text()); restored_buffer_ = dialog_->bufferCO->currentItem(); } diff --git a/src/frontends/qt3/QURL.C b/src/frontends/qt3/QURL.C index cd8324df1e..2f9739b6f0 100644 --- a/src/frontends/qt3/QURL.C +++ b/src/frontends/qt3/QURL.C @@ -51,8 +51,8 @@ void QURL::update_contents() { InsetCommandParams const & params = controller().params(); - dialog_->urlED->setText(toqstr(params.getContents())); - dialog_->nameED->setText(toqstr(params.getOptions())); + dialog_->urlED->setText(toqstr(params["target"])); + dialog_->nameED->setText(toqstr(params["name"])); dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url"); bc().valid(isValid()); @@ -63,8 +63,8 @@ void QURL::apply() { InsetCommandParams & params = controller().params(); - params.setContents(fromqstr(dialog_->urlED->text())); - params.setOptions(fromqstr(dialog_->nameED->text())); + params["target"] = qstring_to_ucs4(dialog_->urlED->text()); + params["name"] = qstring_to_ucs4(dialog_->nameED->text()); if (dialog_->hyperlinkCB->isChecked()) params.setCmdName("htmlurl"); diff --git a/src/frontends/qt4/QBibitem.C b/src/frontends/qt4/QBibitem.C index 5d4ea733a5..435ec1f3ef 100644 --- a/src/frontends/qt4/QBibitem.C +++ b/src/frontends/qt4/QBibitem.C @@ -46,15 +46,15 @@ void QBibitem::build_dialog() void QBibitem::update_contents() { - dialog_->keyED->setText(toqstr(controller().params().getContents())); - dialog_->labelED->setText(toqstr(controller().params().getOptions())); + dialog_->keyED->setText(toqstr(controller().params()["key"])); + dialog_->labelED->setText(toqstr(controller().params()["label"])); } void QBibitem::apply() { - controller().params().setContents(fromqstr(dialog_->keyED->text())); - controller().params().setOptions(fromqstr(dialog_->labelED->text())); + controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text()); + controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text()); } diff --git a/src/frontends/qt4/QBibtex.C b/src/frontends/qt4/QBibtex.C index fbc12f9e02..74008c9513 100644 --- a/src/frontends/qt4/QBibtex.C +++ b/src/frontends/qt4/QBibtex.C @@ -75,8 +75,8 @@ void QBibtex::update_contents() dialog_->databaseLW->clear(); - string bibs(controller().params().getContents()); - string bib; + docstring bibs(controller().params()["bibfiles"]); + docstring bib; while (!bibs.empty()) { bibs = split(bibs, bib, ','); @@ -100,7 +100,7 @@ void QBibtex::update_contents() dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic); dialog_->bibtocCB->setEnabled(!bibtopic); - string btprint(controller().params().getSecOptions()); + docstring btprint(controller().params()["btprint"]); int btp = 0; if (btprint == "btPrintNotCited") btp = 1; @@ -138,30 +138,30 @@ void QBibtex::update_contents() void QBibtex::apply() { - string dbs(fromqstr(dialog_->databaseLW->item(0)->text())); + docstring dbs(qstring_to_ucs4(dialog_->databaseLW->item(0)->text())); unsigned int maxCount = dialog_->databaseLW->count(); for (unsigned int i = 1; i < maxCount; i++) { dbs += ','; - dbs += fromqstr(dialog_->databaseLW->item(i)->text()); + dbs += qstring_to_ucs4(dialog_->databaseLW->item(i)->text()); } - controller().params().setContents(dbs); + controller().params()["bibfiles"] = dbs; - string const bibstyle(fromqstr(dialog_->styleCB->currentText())); + docstring const bibstyle(qstring_to_ucs4(dialog_->styleCB->currentText())); bool const bibtotoc(dialog_->bibtocCB->isChecked()); if (bibtotoc && (!bibstyle.empty())) { // both bibtotoc and style - controller().params().setOptions("bibtotoc," + bibstyle); + controller().params()["options"] = "bibtotoc," + bibstyle; } else if (bibtotoc) { // bibtotoc and no style - controller().params().setOptions("bibtotoc"); + controller().params()["options"] = lyx::from_ascii("bibtotoc"); } else { // only style. An empty one is valid, because some // documentclasses have an own \bibliographystyle{} // command! - controller().params().setOptions(bibstyle); + controller().params()["options"] = bibstyle; } // bibtopic allows three kinds of sections: @@ -172,18 +172,18 @@ void QBibtex::apply() switch (btp) { case 0: - controller().params().setSecOptions("btPrintCited"); + controller().params()["btprint"] = lyx::from_ascii("btPrintCited"); break; case 1: - controller().params().setSecOptions("btPrintNotCited"); + controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited"); break; case 2: - controller().params().setSecOptions("btPrintAll"); + controller().params()["btprint"] = lyx::from_ascii("btPrintAll"); break; } if (!controller().usingBibtopic()) - controller().params().setSecOptions(""); + controller().params()["btprint"] = docstring(); } diff --git a/src/frontends/qt4/QInclude.C b/src/frontends/qt4/QInclude.C index 60a4762306..38d01156ad 100644 --- a/src/frontends/qt4/QInclude.C +++ b/src/frontends/qt4/QInclude.C @@ -62,7 +62,7 @@ void QInclude::update_contents() InsetCommandParams const & params = controller().params(); - dialog_->filenameED->setText(toqstr(params.getContents())); + dialog_->filenameED->setText(toqstr(params["filename"])); dialog_->visiblespaceCB->setChecked(false); dialog_->visiblespaceCB->setEnabled(false); @@ -99,7 +99,7 @@ void QInclude::apply() { InsetCommandParams params = controller().params(); - params.setContents(fromqstr(dialog_->filenameED->text())); + params["filename"] = qstring_to_ucs4(dialog_->filenameED->text()); params.preview(dialog_->previewCB->isChecked()); int const item = dialog_->typeCO->currentIndex(); diff --git a/src/frontends/qt4/QIndex.C b/src/frontends/qt4/QIndex.C index 0bcae0cdcd..47ba8ab94c 100644 --- a/src/frontends/qt4/QIndex.C +++ b/src/frontends/qt4/QIndex.C @@ -50,7 +50,7 @@ void QIndex::build_dialog() void QIndex::update_contents() { - string const contents = controller().params().getContents(); + docstring const contents = controller().params()["name"]; dialog_->keywordED->setText(toqstr(contents)); bc().valid(!contents.empty()); @@ -59,7 +59,7 @@ void QIndex::update_contents() void QIndex::apply() { - controller().params().setContents(fromqstr(dialog_->keywordED->text())); + controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text()); } diff --git a/src/frontends/qt4/QRef.C b/src/frontends/qt4/QRef.C index 2dc65b6671..17495ca176 100644 --- a/src/frontends/qt4/QRef.C +++ b/src/frontends/qt4/QRef.C @@ -72,13 +72,13 @@ void QRef::update_contents() int orig_type = dialog_->typeCO->currentIndex(); - dialog_->referenceED->setText(toqstr(params.getContents())); + dialog_->referenceED->setText(toqstr(params["reference"])); - dialog_->nameED->setText(toqstr(params.getOptions())); + dialog_->nameED->setText(toqstr(params["name"])); dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly()); // restore type settings for new insets - if (params.getContents().empty()) + if (params["reference"].empty()) dialog_->typeCO->setCurrentIndex(orig_type); else dialog_->typeCO->setCurrentIndex(InsetRef::getType(params.getCmdName())); @@ -96,7 +96,7 @@ void QRef::update_contents() dialog_->bufferCO->addItem(toqstr(*it)); } // restore the buffer combo setting for new insets - if (params.getContents().empty() && restored_buffer_ != -1 + if (params["reference"].empty() && restored_buffer_ != -1 && restored_buffer_ < dialog_->bufferCO->count()) dialog_->bufferCO->setCurrentIndex(restored_buffer_); else @@ -112,8 +112,8 @@ void QRef::apply() InsetCommandParams & params = controller().params(); params.setCmdName(InsetRef::getName(dialog_->typeCO->currentIndex())); - params.setContents(fromqstr(dialog_->referenceED->text())); - params.setOptions(fromqstr(dialog_->nameED->text())); + params["reference"] = qstring_to_ucs4(dialog_->referenceED->text()); + params["name"] = qstring_to_ucs4(dialog_->nameED->text()); restored_buffer_ = dialog_->bufferCO->currentIndex(); } diff --git a/src/frontends/qt4/UrlView.C b/src/frontends/qt4/UrlView.C index e416d96ac5..f69c4e8443 100644 --- a/src/frontends/qt4/UrlView.C +++ b/src/frontends/qt4/UrlView.C @@ -51,8 +51,8 @@ void UrlView::update_contents() { InsetCommandParams const & params = controller().params(); - dialog_->urlED->setText(toqstr(params.getContents())); - dialog_->nameED->setText(toqstr(params.getOptions())); + dialog_->urlED->setText(toqstr(params["target"])); + dialog_->nameED->setText(toqstr(params["name"])); dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url"); bc().valid(isValid()); @@ -63,8 +63,8 @@ void UrlView::apply() { InsetCommandParams & params = controller().params(); - params.setContents(fromqstr(dialog_->urlED->text())); - params.setOptions(fromqstr(dialog_->nameED->text())); + params["target"] = qstring_to_ucs4(dialog_->urlED->text()); + params["name"] = qstring_to_ucs4(dialog_->nameED->text()); if (dialog_->hyperlinkCB->isChecked()) params.setCmdName("htmlurl");