}
-void Buffer::changeRefsIfUnique(string const & from, string const & to, InsetBase::Code code)
+void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
+ InsetBase::Code code)
{
//FIXME: This does not work for child documents yet.
BOOST_ASSERT(code == InsetBase::CITE_CODE || code == InsetBase::REF_CODE);
getLabelList(labels);
// FIXME UNICODE
- if (lyx::count(labels.begin(), labels.end(), from_utf8(from)) > 1)
+ if (lyx::count(labels.begin(), labels.end(), from) > 1)
return;
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == code) {
InsetCommand & inset = dynamic_cast<InsetCommand &>(*it);
- inset.replaceContents(from, to);
+ inset.replaceContents(to_utf8(from), to_utf8(to));
}
}
}
-void Buffer::getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end, bool full_source)
+void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
+ pit_type par_end, bool full_source)
{
OutputParams runparams;
runparams.nice = true;
if (par_begin + 1 == par_end)
os << "% Preview source code for paragraph " << par_begin << "\n\n";
else
- os << "% Preview source code from paragraph " << par_begin << " to " << par_end - 1 << "\n\n";
+ os << "% Preview source code from paragraph " << par_begin
+ << " to " << par_end - 1 << "\n\n";
// output paragraphs
if (isLatex()) {
texrow().reset();
///
StableDocIterator getAnchor() const { return anchor_; }
///
- void changeRefsIfUnique(std::string const & from, std::string const & to, InsetBase::Code code);
- /// get source code (latex/docbook) for some paragraphs, or all paragraphs
- /// including preamble
+ void changeRefsIfUnique(docstring const & from, docstring const & to,
+ InsetBase::Code code);
+/// get source code (latex/docbook) for some paragraphs, or all paragraphs
+/// including preamble
void getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end, bool full_source);
/// errorLists_ accessors.
break;
}
if (p["key"] != params()["key"])
- // FIXME UNICODE
- cur.bv().buffer()->changeRefsIfUnique(to_utf8(params()["key"]),
- to_utf8(p["key"]), InsetBase::CITE_CODE);
+ cur.bv().buffer()->changeRefsIfUnique(params()["key"],
+ p["key"], InsetBase::CITE_CODE);
setParams(p);
}
docstring const InsetBibitem::getBibLabel() const
{
docstring const & label = getParam("label");
- return label.empty() ? convert<docstring>(counter) : label;
+ return label.empty() ? convert<docstring>(counter) : label;
}
InsetGraphics::InsetGraphics()
- : graphic_label(sgml::uniqueID("graph")),
+ : graphic_label(sgml::uniqueID(from_ascii("graph"))),
graphic_(new RenderGraphic(this))
{}
InsetGraphics::InsetGraphics(InsetGraphics const & ig)
: InsetOld(ig),
boost::signals::trackable(),
- graphic_label(sgml::uniqueID("graph")),
+ graphic_label(sgml::uniqueID(from_ascii("graph"))),
graphic_(new RenderGraphic(*ig.graphic_, this))
{
setParams(ig.params());
}
if (p["name"] != params()["name"])
// FIXME UNICODE
- cur.bv().buffer()->changeRefsIfUnique(to_utf8(params()["name"]),
- to_utf8(p["name"]), InsetBase::REF_CODE);
+ cur.bv().buffer()->changeRefsIfUnique(params()["name"],
+ p["name"], InsetBase::REF_CODE);
setParams(p);
break;
}
{
// FIXME UNICODE
os << "<!-- anchor id=\""
- << from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("name"))))
+ << sgml::cleanID(buf, runparams, getParam("name"))
<< "\" -->";
return 0;
}
if (name.empty()) {
if (runparams.flavor == OutputParams::XML) {
os << "<xref linkend=\""
- << from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference"))))
+ << sgml::cleanID(buf, runparams, getParam("reference"))
<< "\" />";
} else {
os << "<xref linkend=\""
- << from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference"))))
+ << sgml::cleanID(buf, runparams, getParam("reference"))
<< "\">";
}
} else {
os << "<link linkend=\""
- << from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference"))))
+ << sgml::cleanID(buf, runparams, getParam("reference"))
<< "\">"
<< getParam("name")
<< "</link>";
numbered(r, true);
docstring old = label(r);
if (str != old) {
- cur.bv().buffer()->changeRefsIfUnique(to_utf8(old), to_utf8(str),
+ cur.bv().buffer()->changeRefsIfUnique(old, str,
InsetBase::REF_CODE);
label(r, str);
}
docstring bname = name;
if (!label(0).empty())
- bname += from_ascii(" id='" + sgml::cleanID(buf, runparams, to_utf8(label(0))) + "'");
+ bname += " id='" + sgml::cleanID(buf, runparams, label(0)) + "'";
ms << MTag(bname);
odocstringstream ls;
ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<"));
ms << ETag(from_ascii("alt"));
ms << MTag(from_ascii("math"));
+ ms << ETag(from_ascii("alt"));
+ ms << MTag(from_ascii("math"));
InsetMathGrid::mathmlize(ms);
ms << ETag(from_ascii("math"));
} else {
ms << from_ascii("<graphic fileref=\"eqn/");
if (!label(0).empty())
- ms << from_utf8(sgml::cleanID(buf, runparams, to_utf8(label(0))));
+ ms << sgml::cleanID(buf, runparams, label(0));
else
- ms << from_utf8(sgml::uniqueID("anon"));
+ ms << sgml::uniqueID(from_ascii("anon"));
if (runparams.flavor == OutputParams::XML)
ms << from_ascii("\"/>");
}
-int RefInset::docbook(Buffer const & buf, odocstream & os, OutputParams const & runparams) const
+int RefInset::docbook(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
{
if (cell(1).empty()) {
- // FIXME UNICODE
os << "<xref linkend=\""
- << from_utf8(sgml::cleanID(buf, runparams, to_utf8(asString(cell(0)))));
+ << sgml::cleanID(buf, runparams, asString(cell(0)));
if (runparams.flavor == OutputParams::XML)
os << "\"/>";
else
os << "\">";
} else {
- // FIXME UNICODE
os << "<link linkend=\""
- << from_ascii(sgml::cleanID(buf, runparams, to_utf8(asString(cell(0)))))
+ << sgml::cleanID(buf, runparams, asString(cell(0)))
<< "\">"
<< asString(cell(1))
<< "</link>";
MathMacroTable.h \
MathMacroTemplate.C \
MathMacroTemplate.h \
- MathMLStream.C \
- MathMLStream.h \
MathParser.C \
MathParser.h \
MathReplace.h \
docstring escapeString(docstring const & raw);
/// replaces illegal characters from SGML/XML ID attributes
-std::string cleanID(Buffer const & buf, OutputParams const & runparams,
- std::string const & orig);
+docstring cleanID(Buffer const & buf, OutputParams const & runparams,
+ docstring const & orig);
/// returns a unique numeric id
-docstring const uniqueID(std::string const label);
+docstring const uniqueID(docstring const label);
/// Opens tag
void openTag(odocstream & os, std::string const & name,