]> git.lyx.org Git - features.git/commitdiff
some compile fixes, more to be expected
authorAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 11:00:04 +0000 (11:00 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 11:00:04 +0000 (11:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15465 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer.C
src/buffer.h
src/insets/insetbibitem.C
src/insets/insetgraphics.C
src/insets/insetlabel.C
src/insets/insetref.C
src/mathed/InsetMathHull.C
src/mathed/InsetMathRef.C
src/mathed/Makefile.am
src/sgml.h

index 6de77efc09a8c2216a38e09cb3bcc4b380e3d044..a8e90a4b289227e0d1fdbfdccb9dfcd8c27eca10 100644 (file)
@@ -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<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;
@@ -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();
index 90a36be7ef097f2d1620cba82f420cee5777497b..a58eb3f79e0dc76b123c44085ae7dffebb6428a4 100644 (file)
@@ -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.
index 41a162e7e89eaa056143b69f62dcd32d0ffe4572..89346660f835a460c6f43fd67d8cc08e06bbaa38 100644 (file)
@@ -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<docstring>(counter) : label;
+       return label.empty() ? convert<docstring>(counter) : label;
 }
 
 
index 82c0876aa1bd24f013ca0701263cbb81201e0cc6..da3ff8dbe98992c8f94cb446d05783ad0f0b358e 100644 (file)
@@ -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());
index 57c245056667e2527f012d21f88334c17de15b67..e578dd5ed92837c3190e1c966feadb5e8e88fc3c 100644 (file)
@@ -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 << "<!-- anchor id=\""
-           << from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("name"))))
+           << sgml::cleanID(buf, runparams, getParam("name"))
            << "\" -->";
        return 0;
 }
index a182a94fb5b3832350ccaa85823859095ac0f369..5eaf34a8f32a3c9b5aac9a8ef73f1d71cbea0b7a 100644 (file)
@@ -109,16 +109,16 @@ int InsetRef::docbook(Buffer const & buf, odocstream & os,
        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>";
index d57620f534a92e8eca909d27fa90c32011d93fbb..f6151fbf146dcc43cb5ceaef2c485ebca9de5c8d 100644 (file)
@@ -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()), "&", "&amp;"), "<", "&lt;"));
                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("<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("\"/>");
index 67635a313444bc31453136936439aaf8c6467e13..eb4a14466b06181e121b59d0bbfd0a974abe757a 100644 (file)
@@ -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 << "<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>";
index ec08b84041aae2c3384eca245fb5242f0ec2e281..d71a8f1f1790845489f5c343b7e5bef151e54574 100644 (file)
@@ -144,8 +144,6 @@ libmathed_la_SOURCES = \
        MathMacroTable.h \
        MathMacroTemplate.C \
        MathMacroTemplate.h \
-       MathMLStream.C \
-       MathMLStream.h \
        MathParser.C \
        MathParser.h \
        MathReplace.h \
index 8c60e24bc8023745424fe82cd2501887cc0f3419..d32b799b4997211b1b8d9f41fce60ffb3eeb3fa3 100644 (file)
@@ -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,