]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcharstyle.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / insetcharstyle.C
index c187b4f4e9e4cbd5345b1b304ce3f99422fa8a8d..6d953726c8ed08ec2d0e3413b32808c11071b9aa 100644 (file)
@@ -38,7 +38,8 @@
 
 #include <sstream>
 
-using lyx::docstring;
+
+namespace lyx {
 
 using std::string;
 using std::auto_ptr;
@@ -50,7 +51,7 @@ using std::ostringstream;
 
 void InsetCharStyle::init()
 {
-       setInsetName("CharStyle");
+       setInsetName(from_utf8("CharStyle"));
        setInlined();
        setDrawFrame(false);
 }
@@ -156,12 +157,11 @@ void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
                int w = 0;
                int a = 0;
                int d = 0;
-               string s(params_.type);
+               // FIXME UNICODE
+               docstring s(from_utf8(params_.type));
                if (undefined())
-                       // FIXME UNICODE
-                       s = lyx::to_utf8(_("Undef: ")) + s;
-               docstring ds(s.begin(), s.end());
-               theFontMetrics(font).rectText(ds, w, a, d);
+                       s = _("Undef: ") + s;
+               theFontMetrics(font).rectText(s, w, a, d);
                dim.wid = max(dim.wid, w);
        }
        dim.asc += TEXT_TO_INSET_OFFSET;
@@ -204,14 +204,13 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
                int w = 0;
                int a = 0;
                int d = 0;
-               string s(params_.type);
+               // FIXME UNICODE
+               docstring s(from_utf8(params_.type));
                if (undefined())
-                       // FIXME UNICODE
-                       s = lyx::to_utf8(_("Undef: ")) + s;
-               docstring ds(s.begin(), s.end());
-               theFontMetrics(font).rectText(ds, w, a, d);
+                       s = _("Undef: ") + s;
+               theFontMetrics(font).rectText(s, w, a, d);
                pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
-                       ds, font, LColor::none, LColor::none);
+                       s, font, LColor::none, LColor::none);
        }
 
        // a visual clue when the cursor is inside the inset
@@ -282,14 +281,15 @@ bool InsetCharStyle::getStatus(LCursor & cur, FuncRequest const & cmd,
 }
 
 
-int InsetCharStyle::latex(Buffer const & buf, ostream & os,
+int InsetCharStyle::latex(Buffer const & buf, odocstream & os,
                     OutputParams const & runparams) const
 {
        if (!undefined()) {
-               os << "\\" << params_.latexname;
+               // FIXME UNICODE
+               os << '\\' << from_utf8(params_.latexname);
                if (!params_.latexparam.empty())
-                       os << params_.latexparam;
-               os << "{";
+                       os << from_utf8(params_.latexparam);
+               os << '{';
        }
        int i = InsetText::latex(buf, os, runparams);
        if (!undefined())
@@ -298,7 +298,7 @@ int InsetCharStyle::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetCharStyle::docbook(Buffer const & buf, ostream & os,
+int InsetCharStyle::docbook(Buffer const & buf, odocstream & os,
                            OutputParams const & runparams) const
 {
        ParagraphList::const_iterator beg = paragraphs().begin();
@@ -306,8 +306,9 @@ int InsetCharStyle::docbook(Buffer const & buf, ostream & os,
        ParagraphList::const_iterator end = paragraphs().end();
 
        if (!undefined())
-               sgml::openTag(os, params_.latexname,
-                       par->getID(buf, runparams) + params_.latexparam);
+                // FIXME UNICODE
+                sgml::openTag(os, params_.latexname,
+                              par->getID(buf, runparams) + params_.latexparam);
 
        for (; par != end; ++par) {
                par->simpleDocBookOnePar(buf, os, runparams,
@@ -322,14 +323,14 @@ int InsetCharStyle::docbook(Buffer const & buf, ostream & os,
 }
 
 
-int InsetCharStyle::plaintext(Buffer const & buf, lyx::odocstream & os,
+int InsetCharStyle::plaintext(Buffer const & buf, odocstream & os,
                              OutputParams const & runparams) const
 {
        return InsetText::plaintext(buf, os, runparams);
 }
 
 
-int InsetCharStyle::textString(Buffer const & buf, lyx::odocstream & os,
+int InsetCharStyle::textString(Buffer const & buf, odocstream & os,
                       OutputParams const & op) const
 {
        return plaintext(buf, os, op);
@@ -373,3 +374,6 @@ void InsetCharStyleParams::read(LyXLex & lex)
                }
        }
 }
+
+
+} // namespace lyx