From eaa81aa13efc832ec9080556c496e6912cb1c058 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sun, 22 Oct 2006 11:00:04 +0000 Subject: [PATCH] some compile fixes, more to be expected git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15465 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/buffer.C | 13 ++++++++----- src/buffer.h | 7 ++++--- src/insets/insetbibitem.C | 7 +++---- src/insets/insetgraphics.C | 4 ++-- src/insets/insetlabel.C | 6 +++--- src/insets/insetref.C | 6 +++--- src/mathed/InsetMathHull.C | 10 ++++++---- src/mathed/InsetMathRef.C | 9 ++++----- src/mathed/Makefile.am | 2 -- src/sgml.h | 6 +++--- 10 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/buffer.C b/src/buffer.C index 6de77efc09..a8e90a4b28 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1562,7 +1562,8 @@ void Buffer::saveCursor(StableDocIterator cur, StableDocIterator anc) } -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); @@ -1582,19 +1583,20 @@ void Buffer::changeRefsIfUnique(string const & from, string const & to, InsetBas 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(*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; @@ -1617,7 +1619,8 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end 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(); diff --git a/src/buffer.h b/src/buffer.h index 90a36be7ef..a58eb3f79e 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -343,9 +343,10 @@ public: /// 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. diff --git a/src/insets/insetbibitem.C b/src/insets/insetbibitem.C index 41a162e7e8..89346660f8 100644 --- a/src/insets/insetbibitem.C +++ b/src/insets/insetbibitem.C @@ -66,9 +66,8 @@ void InsetBibitem::doDispatch(LCursor & cur, FuncRequest & cmd) 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); } @@ -99,7 +98,7 @@ void InsetBibitem::read(Buffer const & buf, LyXLex & lex) docstring const InsetBibitem::getBibLabel() const { docstring const & label = getParam("label"); - return label.empty() ? convert(counter) : label; + return label.empty() ? convert(counter) : label; } diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 82c0876aa1..da3ff8dbe9 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -148,7 +148,7 @@ string findTargetFormat(string const & format, OutputParams const & runparams) InsetGraphics::InsetGraphics() - : graphic_label(sgml::uniqueID("graph")), + : graphic_label(sgml::uniqueID(from_ascii("graph"))), graphic_(new RenderGraphic(this)) {} @@ -156,7 +156,7 @@ InsetGraphics::InsetGraphics() 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()); diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index 57c2450566..e578dd5ed9 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -72,8 +72,8 @@ void InsetLabel::doDispatch(LCursor & cur, FuncRequest & cmd) } 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; } @@ -106,7 +106,7 @@ int InsetLabel::docbook(Buffer const & buf, odocstream & os, { // FIXME UNICODE os << ""; return 0; } diff --git a/src/insets/insetref.C b/src/insets/insetref.C index a182a94fb5..5eaf34a8f3 100644 --- a/src/insets/insetref.C +++ b/src/insets/insetref.C @@ -109,16 +109,16 @@ int InsetRef::docbook(Buffer const & buf, odocstream & os, if (name.empty()) { if (runparams.flavor == OutputParams::XML) { os << ""; } else { os << ""; } } else { os << "" << getParam("name") << ""; diff --git a/src/mathed/InsetMathHull.C b/src/mathed/InsetMathHull.C index d57620f534..f6151fbf14 100644 --- a/src/mathed/InsetMathHull.C +++ b/src/mathed/InsetMathHull.C @@ -1122,7 +1122,7 @@ void InsetMathHull::doDispatch(LCursor & cur, FuncRequest & cmd) 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); } @@ -1462,7 +1462,7 @@ int InsetMathHull::docbook(Buffer const & buf, odocstream & os, 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; @@ -1476,6 +1476,8 @@ int InsetMathHull::docbook(Buffer const & buf, odocstream & os, 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 { @@ -1487,9 +1489,9 @@ int InsetMathHull::docbook(Buffer const & buf, odocstream & os, ms << from_ascii(""); diff --git a/src/mathed/InsetMathRef.C b/src/mathed/InsetMathRef.C index 67635a3134..eb4a14466b 100644 --- a/src/mathed/InsetMathRef.C +++ b/src/mathed/InsetMathRef.C @@ -157,20 +157,19 @@ int RefInset::plaintext(odocstream & os, OutputParams const &) const } -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 << ""; else os << "\">"; } else { - // FIXME UNICODE os << "" << asString(cell(1)) << ""; diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index ec08b84041..d71a8f1f17 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -144,8 +144,6 @@ libmathed_la_SOURCES = \ MathMacroTable.h \ MathMacroTemplate.C \ MathMacroTemplate.h \ - MathMLStream.C \ - MathMLStream.h \ MathParser.C \ MathParser.h \ MathReplace.h \ diff --git a/src/sgml.h b/src/sgml.h index 8c60e24bc8..d32b799b49 100644 --- a/src/sgml.h +++ b/src/sgml.h @@ -39,11 +39,11 @@ docstring escapeChar(char_type c); 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, -- 2.39.2