OK.. here we go.. The diff is against rev 15393. I made a couple of
updates after your commit.
ugras
On 10/20/06, Georg Baum <[EMAIL PROTECTED]> wrote:
Am Freitag, 20. Oktober 2006 10:39 schrieben Sie:
> Sure.. Is there something similar that I can put instead of
>
> lyx::from_utf8(Glib::locale_to_utf8())
Yes: Simply remove Glib::locale_to_utf8. Glib::ustring is in utf8 encoding,
and it is compatible to std::string, so we can simply use
lyx::from_utf8/lyx::to_utf8 when converting between Glib::ustring and
docstring or vice versa.
Georg
Index: src/insets/insetindex.C
===================================================================
--- src/insets/insetindex.C (revision 15393)
+++ src/insets/insetindex.C (working copy)
@@ -48,7 +48,7 @@
{
// FIXME UNICODE
os << "<indexterm><primary>"
- << lyx::from_ascii(sgml::escapeString(getContents()))
+ << lyx::from_ascii(sgml::escapeString(lyx::to_utf8(getParam("name"))))
<< "</primary></indexterm>";
return 0;
}
Index: src/insets/insetbibtex.C
===================================================================
--- src/insets/insetbibtex.C (revision 15393)
+++ src/insets/insetbibtex.C (working copy)
@@ -154,7 +154,8 @@
typedef boost::tokenizer<Separator> Tokenizer;
Separator const separator(",");
- Tokenizer const tokens(getContents(), separator);
+ Tokenizer const tokens(lyx::to_utf8(
+ getParam("bibfiles")), separator);
Tokenizer::const_iterator const begin = tokens.begin();
Tokenizer::const_iterator const end = tokens.end();
@@ -201,7 +202,7 @@
}
// Style-Options
- string style = getOptions(); // maybe empty! and with bibtotoc
+ string style = lyx::to_utf8(getParam("options")); // maybe empty! and with bibtotoc
string bibtotoc;
if (prefixIs(style, "bibtotoc")) {
bibtotoc = "bibtotoc";
@@ -305,7 +306,7 @@
vector<string> vec;
string tmp;
- string bibfiles = getContents();
+ string bibfiles = lyx::to_utf8(getParam("bibfiles"));
bibfiles = split(bibfiles, tmp, ',');
while (!tmp.empty()) {
string file = findtexfile(changeExtension(tmp, "bib"), "bib");
@@ -362,11 +363,11 @@
bool InsetBibtex::addDatabase(string const & db)
{
- string contents(getContents());
+ string contents(lyx::to_utf8(getParam("bibfiles")));
if (tokenPos(contents, ',', db) == -1) {
if (!contents.empty())
contents += ',';
- setContents(contents + db);
+ setParam("bibfiles", lyx::from_utf8(contents + db));
return true;
}
return false;
@@ -375,17 +376,17 @@
bool InsetBibtex::delDatabase(string const & db)
{
- string contents(getContents());
+ string contents(lyx::to_utf8(getParam("bibfiles")));
if (contains(contents, db)) {
int const n = tokenPos(contents, ',', db);
string bd = db;
if (n > 0) {
// this is not the first database
string tmp = ',' + bd;
- setContents(subst(contents, tmp, ""));
+ setParam("bibfiles", lyx::from_utf8(subst(contents, tmp, "")));
} else if (n == 0)
// this is the first (or only) database
- setContents(split(contents, bd, ','));
+ setParam("bibfiles", lyx::from_utf8(split(contents, bd, ',')));
else
return false;
}
Index: src/insets/insetbibitem.C
===================================================================
--- src/insets/insetbibitem.C (revision 15393)
+++ src/insets/insetbibitem.C (working copy)
@@ -40,8 +40,8 @@
InsetBibitem::InsetBibitem(InsetCommandParams const & p)
: InsetCommand(p, "bibitem"), counter(1)
{
- if (getContents().empty())
- setContents(key_prefix + convert<string>(++key_counter));
+ if (getParam("key").empty())
+ setParam("key", lyx::from_utf8(key_prefix + convert<string>(++key_counter)));
}
@@ -64,9 +64,9 @@
cur.noUpdate();
break;
}
- if (p.getContents() != params().getContents())
- cur.bv().buffer()->changeRefsIfUnique(params().getContents(),
- p.getContents(), InsetBase::CITE_CODE);
+ if (p["key"] != params()["key"])
+ cur.bv().buffer()->changeRefsIfUnique(lyx::to_utf8(params()["key"]),
+ lyx::to_utf8(p["key"]), InsetBase::CITE_CODE);
setParams(p);
}
@@ -87,8 +87,8 @@
{
InsetCommand::read(buf, lex);
- if (prefixIs(getContents(), key_prefix)) {
- int const key = convert<int>(getContents().substr(key_prefix.length()));
+ if (prefixIs(lyx::to_utf8(getParam("key")), key_prefix)) {
+ int const key = convert<int>(lyx::to_utf8(getParam("key")).substr(key_prefix.length()));
key_counter = max(key_counter, key);
}
}
@@ -97,16 +97,16 @@
docstring const InsetBibitem::getBibLabel() const
{
// FIXME UNICODE
- return getOptions().empty() ?
+ return getParam("label").empty() ?
convert<docstring>(counter) :
- lyx::from_utf8(getOptions());
+ getParam("label");
}
docstring const InsetBibitem::getScreenLabel(Buffer const &) const
{
// FIXME UNICODE
- return lyx::from_utf8(getContents()) + " [" + getBibLabel() + ']';
+ return getParam("key") + " [" + getBibLabel() + ']';
}
Index: src/insets/insetlabel.C
===================================================================
--- src/insets/insetlabel.C (revision 15393)
+++ src/insets/insetlabel.C (working copy)
@@ -49,14 +49,14 @@
void InsetLabel::getLabelList(Buffer const &, std::vector<docstring> & list) const
{
// FIXME UNICODE
- list.push_back(lyx::from_utf8(getContents()));
+ list.push_back(getParam("name"));
}
docstring const InsetLabel::getScreenLabel(Buffer const &) const
{
// FIXME UNICODE
- return lyx::from_utf8(getContents());
+ return getParam("name");
}
@@ -71,9 +71,9 @@
cur.noUpdate();
break;
}
- if (p.getContents() != params().getContents())
- cur.bv().buffer()->changeRefsIfUnique(params().getContents(),
- p.getContents(), InsetBase::REF_CODE);
+ if (p["name"] != params()["name"])
+ cur.bv().buffer()->changeRefsIfUnique(lyx::to_utf8(params()["name"]),
+ lyx::to_utf8(p["name"]), InsetBase::REF_CODE);
setParams(p);
break;
}
@@ -97,7 +97,7 @@
OutputParams const &) const
{
// FIXME UNICODE
- os << '<' << lyx::from_utf8(getContents()) << '>';
+ os << '<' << getParam("name") << '>';
return 0;
}
@@ -107,7 +107,7 @@
{
// FIXME UNICODE
os << "<!-- anchor id=\""
- << lyx::from_ascii(sgml::cleanID(buf, runparams, getContents()))
+ << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_utf8(getParam("name"))))
<< "\" -->";
return 0;
}
Index: src/insets/insethfill.C
===================================================================
--- src/insets/insethfill.C (revision 15393)
+++ src/insets/insethfill.C (working copy)
@@ -42,7 +42,7 @@
docstring const InsetHFill::getScreenLabel(Buffer const &) const
{
- return lyx::from_ascii(getContents());
+ return getParam("");
}
Index: src/insets/inseturl.C
===================================================================
--- src/insets/inseturl.C (revision 15393)
+++ src/insets/inseturl.C (working copy)
@@ -40,12 +40,13 @@
docstring const temp =
(getCmdName() == "url") ? _("Url: ") : _("HtmlUrl: ");
+ //TODO docstring
string url;
- if (!getOptions().empty())
- url += getOptions();
+ if (!getParam("name").empty())
+ url += lyx::to_utf8(getParam("name"));
else
- url += getContents();
+ url += lyx::to_utf8(getParam("target"));
// elide if long
if (url.length() > 30) {
@@ -74,12 +75,12 @@
OutputParams const &) const
{
// FIXME UNICODE
- os << '[' << lyx::from_utf8(getContents());
- if (getOptions().empty())
+ os << '[' << getParam("target");
+ if (getParam("name").empty())
os << ']';
else
// FIXME UNICODE
- os << "||" << lyx::from_utf8(getOptions()) << ']';
+ os << "||" << getParam("name") << ']';
return 0;
}
@@ -88,11 +89,11 @@
OutputParams const &) const
{
// FIXME UNICODE
- os << "<ulink url=\""
- << lyx::from_ascii(subst(getContents(), "&", "&"))
- << "\">"
- << lyx::from_ascii(getOptions())
- << "</ulink>";
+ os << "<ulink url=\""
+ << lyx::from_ascii(subst(lyx::to_utf8(getParam("target")),"&","&"))
+ << "\">"
+ << getParam("name")
+ << "</ulink>";
return 0;
}
Index: src/insets/insetref.C
===================================================================
--- src/insets/insetref.C (revision 15393)
+++ src/insets/insetref.C (working copy)
@@ -48,7 +48,7 @@
case LFUN_MOUSE_PRESS:
// Eventually trigger dialog with button 3 not 1
if (cmd.button() == mouse_button::button3)
- lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getContents()));
+ lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
else {
InsetCommandMailer("ref", *this).showDialog(&cur.bv());
cur.undispatched();
@@ -74,12 +74,12 @@
}
}
// FIXME UNICODE
- temp += lyx::from_utf8(getContents());
+ temp += getParam("reference");
- if (!isLatex && !getOptions().empty()) {
+ if (!isLatex && !getParam("name").empty()) {
temp += "||";
// FIXME UNICODE
- temp += lyx::from_utf8(getOptions());
+ temp += getParam("name");
}
return temp;
}
@@ -100,7 +100,7 @@
OutputParams const &) const
{
// FIXME UNICODE
- os << '[' << lyx::from_utf8(getContents()) << ']';
+ os << '[' << getParam("reference") << ']';
return 0;
}
@@ -108,21 +108,20 @@
int InsetRef::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
- // FIXME UNICODE
- if (getOptions().empty() && runparams.flavor == OutputParams::XML) {
- os << "<xref linkend=\""
- << lyx::from_ascii(sgml::cleanID(buf, runparams, getContents()))
- << "\" />";
- } else if (getOptions().empty()) {
- os << "<xref linkend=\""
- << lyx::from_ascii(sgml::cleanID(buf, runparams, getContents()))
- << "\">";
+ if (getParam("name").empty() && runparams.flavor == OutputParams::XML) {
+ os << "<xref linkend=\""
+ << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_utf8(getParam("reference"))))
+ << "\" />";
+ } else if (getParam("name").empty()) {
+ os << "<xref linkend=\""
+ << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_utf8(getParam("reference"))))
+ << "\">";
} else {
- os << "<link linkend=\""
- << lyx::from_ascii(sgml::cleanID(buf, runparams, getContents()))
- << "\">"
- << lyx::from_ascii(getOptions())
- << "</link>";
+ os << "<link linkend=\""
+ << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_utf8(getParam("reference"))))
+ << "\">"
+ << getParam("name")
+ << "</link>";
}
return 0;
Index: src/insets/insetinclude.C
===================================================================
--- src/insets/insetinclude.C (revision 15393)
+++ src/insets/insetinclude.C (working copy)
@@ -222,7 +222,7 @@
string const includedFilename(Buffer const & buffer,
InsetCommandParams const & params)
{
- return makeAbsPath(params.getContents(),
+ return makeAbsPath(lyx::to_utf8(params["filename"]),
onlyPath(parentFilename(buffer)));
}
@@ -297,11 +297,11 @@
temp += ": ";
- if (params_.getContents().empty())
+ if (params_["filename"].empty())
temp += "???";
else
// FIXME: We don't know the encoding of the filename
- temp += lyx::from_ascii(onlyFilename(params_.getContents()));
+ temp += lyx::from_ascii(onlyFilename(lyx::to_utf8(params_["filename"])));
return temp;
}
@@ -354,7 +354,7 @@
int InsetInclude::latex(Buffer const & buffer, odocstream & os,
OutputParams const & runparams) const
{
- string incfile(params_.getContents());
+ string incfile(lyx::to_utf8(params_["filename"]));
// Do nothing if no file name has been specified
if (incfile.empty())
@@ -491,7 +491,7 @@
int InsetInclude::docbook(Buffer const & buffer, odocstream & os,
OutputParams const & runparams) const
{
- string incfile(params_.getContents());
+ string incfile(lyx::to_utf8(params_["filename"]));
// Do nothing if no file name has been specified
if (incfile.empty())
@@ -538,7 +538,7 @@
void InsetInclude::validate(LaTeXFeatures & features) const
{
- string incfile(params_.getContents());
+ string incfile(lyx::to_utf8(params_["filename"]));
string writefile;
Buffer const & buffer = features.buffer();
Index: src/mathed/InsetMathHull.C
===================================================================
--- src/mathed/InsetMathHull.C (revision 15393)
+++ src/mathed/InsetMathHull.C (working copy)
@@ -55,6 +55,7 @@
#include "support/lyxlib.h"
#include "support/lstrings.h"
+#include "support/docstring.h"
#include <boost/bind.hpp>
@@ -1118,17 +1119,17 @@
if (name == "label") {
InsetCommandParams p("label");
InsetCommandMailer::string2params(name, lyx::to_utf8(cmd.argument()), p);
- string str = p.getContents();
+ docstring str = p["name"];
recordUndoInset(cur);
row_type const r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
str = lyx::support::trim(str);
if (!str.empty())
numbered(r, true);
- string old = label(r);
+ docstring old = lyx::from_utf8(label(r));
if (str != old) {
- cur.bv().buffer()->changeRefsIfUnique(old, str,
+ cur.bv().buffer()->changeRefsIfUnique(lyx::to_utf8(old), lyx::to_utf8(str),
InsetBase::REF_CODE);
- label(r, str);
+ label(r, lyx::to_utf8(str));
}
break;
}
Index: src/factory.C
===================================================================
--- src/factory.C (revision 15393)
+++ src/factory.C (working copy)
@@ -165,7 +165,7 @@
string const contents = cmd.argument().empty() ?
bv->getLyXText()->getStringToIndex(bv->cursor()) :
lyx::to_utf8(cmd.argument());
- icp.setContents(contents);
+ icp["name"] = lyx::from_utf8(contents);
return new InsetIndex(icp);
}
@@ -380,8 +380,8 @@
|| cmdName == "vref"
|| cmdName == "vpageref"
|| cmdName == "prettyref") {
- if (!inscmd.getOptions().empty()
- || !inscmd.getContents().empty()) {
+ if (!inscmd["name"].empty()
+ || !inscmd["reference"].empty()) {
inset.reset(new InsetRef(inscmd, buf));
}
} else if (cmdName == "tableofcontents") {
Index: src/frontends/gtk/GBibItem.C
===================================================================
--- src/frontends/gtk/GBibItem.C (revision 15393)
+++ src/frontends/gtk/GBibItem.C (working copy)
@@ -62,15 +62,15 @@
{
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()
Index: src/frontends/gtk/GBibtex.C
===================================================================
--- src/frontends/gtk/GBibtex.C (revision 15393)
+++ src/frontends/gtk/GBibtex.C (working copy)
@@ -95,7 +95,7 @@
void GBibtex::update()
{
- string bibs(controller().params().getContents());
+ string bibs(lyx::to_utf8(controller().params()["bibfiles"]));
string bib;
databasesstore_->clear();
@@ -118,7 +118,7 @@
toccheck_->set_sensitive(!bibtopic);
- string btprint(controller().params().getSecOptions());
+ string btprint(lyx::to_utf8(controller().params()["btprint"]));
int btp = 0;
if (btprint == "btPrintNotCited")
btp = 1;
@@ -169,7 +169,7 @@
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 @@
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_utf8("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,21 @@
switch (btp) {
case 0:
- controller().params().setSecOptions("btPrintCited");
+ controller().params()["btprint"] = lyx::from_utf8("btPrintCited");
break;
case 1:
- controller().params().setSecOptions("btPrintNotCited");
+
+ controller().params()["btprint"] = lyx::from_utf8("btPrintNotCited");
break;
case 2:
- controller().params().setSecOptions("btPrintAll");
+
+ controller().params()["btprint"] = lyx::from_utf8("btPrintAll");
break;
}
if (!bibtopic)
- controller().params().setSecOptions("");
+
+ controller().params()["btprint"] = lyx::from_utf8("");
}
Index: src/frontends/gtk/GInclude.C
===================================================================
--- src/frontends/gtk/GInclude.C (revision 15393)
+++ src/frontends/gtk/GInclude.C (working copy)
@@ -72,7 +72,7 @@
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 @@
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");
Index: src/frontends/gtk/GRef.C
===================================================================
--- src/frontends/gtk/GRef.C (revision 15393)
+++ src/frontends/gtk/GRef.C (working copy)
@@ -168,8 +168,10 @@
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 +242,8 @@
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));
}
Index: src/frontends/gtk/GUrl.C
===================================================================
--- src/frontends/gtk/GUrl.C (revision 15393)
+++ src/frontends/gtk/GUrl.C (working copy)
@@ -77,10 +77,10 @@
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 +90,8 @@
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
Index: src/frontends/gtk/GText.C
===================================================================
--- src/frontends/gtk/GText.C (revision 15393)
+++ src/frontends/gtk/GText.C (working copy)
@@ -44,14 +44,14 @@
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);
}
Index: src/frontends/qt3/QBibitem.C
===================================================================
--- src/frontends/qt3/QBibitem.C (revision 15393)
+++ src/frontends/qt3/QBibitem.C (working copy)
@@ -46,15 +46,15 @@
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());
}
Index: src/frontends/qt3/QBibtex.C
===================================================================
--- src/frontends/qt3/QBibtex.C (revision 15393)
+++ src/frontends/qt3/QBibtex.C (working copy)
@@ -76,7 +76,7 @@
dialog_->databaseLB->clear();
- string bibs(controller().params().getContents());
+ string bibs(lyx::to_utf8(controller().params()["bibfiles"]));
string bib;
while (!bibs.empty()) {
@@ -99,7 +99,7 @@
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
dialog_->bibtocCB->setEnabled(!bibtopic);
- string btprint(controller().params().getSecOptions());
+ string bibs(lyx::to_utf8(controller().params()["bibfiles"]));
int btp = 0;
if (btprint == "btPrintNotCited")
btp = 1;
@@ -146,22 +146,22 @@
dbs += fromqstr(dialog_->databaseLB->text(i));
}
- controller().params().setContents(dbs);
+ controller().params()["bibfiles"] = lyx::from_utf8(dbs);
string const bibstyle(fromqstr(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"] = lyx::from_utf8("bibtotoc," + bibstyle);
} else if (bibtotoc) {
// bibtotoc and no style
- controller().params().setOptions("bibtotoc");
+ controller().params()["options"] = lyx::from_utf8("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:
@@ -172,18 +172,18 @@
switch (btp) {
case 0:
- controller().params().setSecOptions("btPrintCited");
+ controller().params()["btprint"] = lyx::from_utf8("btPrintCited");
break;
case 1:
- controller().params().setSecOptions("btPrintNotCited");
+ controller().params()["btprint"]= lyx::from_utf8("btPrintNotCited");
break;
case 2:
- controller().params().setSecOptions("btPrintAll");
+ controller().params()["btprint"]= lyx::from_utf8("btPrintAll");
break;
}
if (!controller().usingBibtopic())
- controller().params().setSecOptions("");
+ controller().params()["btprint"]= lyx::from_utf8("");
}
Index: src/frontends/qt3/QURL.C
===================================================================
--- src/frontends/qt3/QURL.C (revision 15393)
+++ src/frontends/qt3/QURL.C (working copy)
@@ -51,8 +51,8 @@
{
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 @@
{
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");
Index: src/frontends/qt3/QRef.C
===================================================================
--- src/frontends/qt3/QRef.C (revision 15393)
+++ src/frontends/qt3/QRef.C (working copy)
@@ -71,13 +71,13 @@
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 @@
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 @@
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();
}
Index: src/frontends/qt3/QInclude.C
===================================================================
--- src/frontends/qt3/QInclude.C (revision 15393)
+++ src/frontends/qt3/QInclude.C (working copy)
@@ -63,7 +63,7 @@
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 @@
{
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();
Index: src/frontends/qt3/QIndex.C
===================================================================
--- src/frontends/qt3/QIndex.C (revision 15393)
+++ src/frontends/qt3/QIndex.C (working copy)
@@ -50,7 +50,7 @@
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::apply()
{
- controller().params().setContents(fromqstr(dialog_->keywordED->text()));
+ controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
}
Index: src/frontends/qt4/QBibitem.C
===================================================================
--- src/frontends/qt4/QBibitem.C (revision 15393)
+++ src/frontends/qt4/QBibitem.C (working copy)
@@ -46,15 +46,15 @@
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());
}
Index: src/frontends/qt4/QBibtex.C
===================================================================
--- src/frontends/qt4/QBibtex.C (revision 15393)
+++ src/frontends/qt4/QBibtex.C (working copy)
@@ -75,7 +75,7 @@
dialog_->databaseLW->clear();
- string bibs(controller().params().getContents());
+ string bibs(lyx::to_utf8(controller().params()["bibfiles"]));
string bib;
while (!bibs.empty()) {
@@ -100,7 +100,7 @@
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
dialog_->bibtocCB->setEnabled(!bibtopic);
- string btprint(controller().params().getSecOptions());
+ string btprint(lyx::to_utf8(controller().params()["btprint"]));
int btp = 0;
if (btprint == "btPrintNotCited")
btp = 1;
@@ -146,22 +146,22 @@
dbs += fromqstr(dialog_->databaseLW->item(i)->text());
}
- controller().params().setContents(dbs);
+ controller().params()["bibfiles"] = lyx::from_utf8(dbs);
string const bibstyle(fromqstr(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"] = lyx::from_utf8("bibtotoc," + bibstyle);
} else if (bibtotoc) {
// bibtotoc and no style
- controller().params().setOptions("bibtotoc");
+ controller().params()["options"] = lyx::from_utf8("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:
@@ -172,18 +172,18 @@
switch (btp) {
case 0:
- controller().params().setSecOptions("btPrintCited");
+ controller().params()["btprint"]= lyx::from_utf8("btPrintCited");
break;
case 1:
- controller().params().setSecOptions("btPrintNotCited");
+ controller().params()["btprint"]= lyx::from_utf8("btPrintNotCited");
break;
case 2:
- controller().params().setSecOptions("btPrintAll");
+ controller().params()["btprint"]= lyx::from_utf8("btPrintAll");
break;
}
if (!controller().usingBibtopic())
- controller().params().setSecOptions("");
+ controller().params()["btprint"]= lyx::from_utf8("");
}
Index: src/frontends/qt4/QRef.C
===================================================================
--- src/frontends/qt4/QRef.C (revision 15393)
+++ src/frontends/qt4/QRef.C (working copy)
@@ -72,13 +72,13 @@
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 @@
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 @@
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();
}
Index: src/frontends/qt4/UrlView.C
===================================================================
--- src/frontends/qt4/UrlView.C (revision 15393)
+++ src/frontends/qt4/UrlView.C (working copy)
@@ -51,8 +51,8 @@
{
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 @@
{
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");
Index: src/frontends/qt4/QInclude.C
===================================================================
--- src/frontends/qt4/QInclude.C (revision 15393)
+++ src/frontends/qt4/QInclude.C (working copy)
@@ -62,7 +62,7 @@
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 @@
{
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();
Index: src/frontends/qt4/QIndex.C
===================================================================
--- src/frontends/qt4/QIndex.C (revision 15393)
+++ src/frontends/qt4/QIndex.C (working copy)
@@ -50,7 +50,7 @@
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::apply()
{
- controller().params().setContents(fromqstr(dialog_->keywordED->text()));
+ controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
}
Index: src/frontends/controllers/ControlBibtex.C
===================================================================
--- src/frontends/controllers/ControlBibtex.C (revision 15393)
+++ src/frontends/controllers/ControlBibtex.C (working copy)
@@ -125,7 +125,7 @@
bool ControlBibtex::bibtotoc() const
{
- return prefixIs(params().getOptions(), "bibtotoc");
+ return prefixIs(lyx::to_utf8(params()["options"]), "bibtotoc");
}
@@ -151,7 +151,7 @@
break;
}
- string bst = params().getOptions();
+ string bst = lyx::to_utf8(params()["btprint"]);
if (bibtotoc()){
// bibstyle exists?
if (contains(bst,',')) {
@@ -164,7 +164,7 @@
// 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;
Index: src/BufferView.C
===================================================================
--- src/BufferView.C (revision 15393)
+++ src/BufferView.C (working copy)
@@ -772,7 +772,7 @@
getInsetByCode<InsetRef>(cursor_,
InsetBase::REF_CODE);
if (inset) {
- label = lyx::from_utf8(inset->getContents());
+ label = inset->getParam("reference");
savePosition(0);
}
}