]> git.lyx.org Git - lyx.git/commitdiff
convert LyXFont::stateText and LColor::getGUIName to docstring,
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 21 Dec 2006 14:31:19 +0000 (14:31 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 21 Dec 2006 14:31:19 +0000 (14:31 +0000)
saving again some utf8 conversions

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16365 a592a061-630c-0410-9148-cb99ea01b6c8

src/LColor.C
src/LColor.h
src/frontends/qt4/GuiFontLoader.C
src/lyxfont.C
src/lyxfont.h
src/paragraph_pimpl.C
src/text.C

index 2f2a9ff06f57b6ed41e0947f28d83f4be9198a11..18f2a0fbd5282b4b183e420708893356fd9030e3 100644 (file)
@@ -174,12 +174,12 @@ LColor & LColor::operator=(LColor tmp)
 }
 
 
 }
 
 
-string const LColor::getGUIName(LColor::color c) const
+docstring const LColor::getGUIName(LColor::color c) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
-               return to_utf8(_(it->second.guiname));
-       return "none";
+               return _(it->second.guiname);
+       return from_ascii("none");
 }
 
 
 }
 
 
index 95a4cf7cd4b5f239144bb02a1ff427e535ac4ae6..d11b291ecbc83957c1e50c077e14c90e59632f66 100644 (file)
@@ -19,8 +19,9 @@
 #ifndef LCOLOR_H
 #define LCOLOR_H
 
 #ifndef LCOLOR_H
 #define LCOLOR_H
 
+#include "support/docstring.h"
+
 #include <boost/scoped_ptr.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <string>
 
 
 namespace lyx {
 
 
 namespace lyx {
@@ -203,7 +204,7 @@ public:
        bool setColor(std::string const & lyxname, std::string const & x11name);
 
        /// Get the GUI name of \c color.
        bool setColor(std::string const & lyxname, std::string const & x11name);
 
        /// Get the GUI name of \c color.
-       std::string const getGUIName(LColor::color c) const;
+       docstring const getGUIName(LColor::color c) const;
 
        /// Get the X11 name of \c color.
        std::string const getX11Name(LColor::color c) const;
 
        /// Get the X11 name of \c color.
        std::string const getX11Name(LColor::color c) const;
index fd07c8cd56c8b906790f9d6d7fc8a3f4860f1b40..ac0819bafe2a57b6040fe8e16548aef744a60890 100644 (file)
@@ -262,7 +262,7 @@ QLFontInfo::QLFontInfo(LyXFont const & f)
        }
 
        if (lyxerr.debugging(Debug::FONT)) {
        }
 
        if (lyxerr.debugging(Debug::FONT)) {
-               lyxerr[Debug::FONT] << "Font '" << f.stateText(0)
+               lyxerr[Debug::FONT] << "Font '" << to_utf8(f.stateText(0))
                        << "' matched by\n" << fromqstr(font.family()) << endl;
        }
 
                        << "' matched by\n" << fromqstr(font.family()) << endl;
        }
 
index ab6dc162b972f10288627e660324043ddb31018f..fb02fdced841b16cec9b8cb459cc98b659a59982 100644 (file)
@@ -37,7 +37,6 @@ using support::subst;
 using std::endl;
 using std::string;
 using std::ostream;
 using std::endl;
 using std::string;
 using std::ostream;
-using std::ostringstream;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::strlen;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::strlen;
@@ -493,37 +492,36 @@ bool LyXFont::resolved() const
 }
 
 
 }
 
 
-/// Build GUI description of font state
-string const LyXFont::stateText(BufferParams * params) const
+docstring const LyXFont::stateText(BufferParams * params) const
 {
 {
-       ostringstream os;
+       odocstringstream os;
        if (family() != INHERIT_FAMILY)
        if (family() != INHERIT_FAMILY)
-               os << to_utf8(_(GUIFamilyNames[family()])) << ", ";
+               os << _(GUIFamilyNames[family()]) << ", ";
        if (series() != INHERIT_SERIES)
        if (series() != INHERIT_SERIES)
-               os << to_utf8(_(GUISeriesNames[series()])) << ", ";
+               os << _(GUISeriesNames[series()]) << ", ";
        if (shape() != INHERIT_SHAPE)
        if (shape() != INHERIT_SHAPE)
-               os << to_utf8(_(GUIShapeNames[shape()])) << ", ";
+               os << _(GUIShapeNames[shape()]) << ", ";
        if (size() != INHERIT_SIZE)
        if (size() != INHERIT_SIZE)
-               os << to_utf8(_(GUISizeNames[size()])) << ", ";
+               os << _(GUISizeNames[size()]) << ", ";
        if (color() != LColor::inherit)
                os << lcolor.getGUIName(color()) << ", ";
        if (emph() != INHERIT)
        if (color() != LColor::inherit)
                os << lcolor.getGUIName(color()) << ", ";
        if (emph() != INHERIT)
-               os << to_utf8(bformat(_("Emphasis %1$s, "),
-                             _(GUIMiscNames[emph()])));
+               os << bformat(_("Emphasis %1$s, "),
+                             _(GUIMiscNames[emph()]));
        if (underbar() != INHERIT)
        if (underbar() != INHERIT)
-               os << to_utf8(bformat(_("Underline %1$s, "),
-                             _(GUIMiscNames[underbar()])));
+               os << bformat(_("Underline %1$s, "),
+                             _(GUIMiscNames[underbar()]));
        if (noun() != INHERIT)
        if (noun() != INHERIT)
-               os << to_utf8(bformat(_("Noun %1$s, "),
-                             _(GUIMiscNames[noun()])));
+               os << bformat(_("Noun %1$s, "),
+                             _(GUIMiscNames[noun()]));
        if (bits == inherit)
        if (bits == inherit)
-               os << to_utf8(_("Default")) << ", ";
+               os << _("Default") << ", ";
        if (!params || (language() != params->language))
        if (!params || (language() != params->language))
-               os << to_utf8(bformat(_("Language: %1$s, "),
-                             _(language()->display())));
+               os << bformat(_("Language: %1$s, "),
+                             _(language()->display()));
        if (number() != OFF)
        if (number() != OFF)
-               os << to_utf8(bformat(_("  Number %1$s"),
-                               _(GUIMiscNames[number()])));
+               os << bformat(_("  Number %1$s"),
+                             _(GUIMiscNames[number()]));
        return rtrim(os.str(), ", ");
 }
 
        return rtrim(os.str(), ", ");
 }
 
index 34a0b24325f9851fd4acc8b38bd73b949db94058..b8ac5516557aa9f4d300a1c81f7cd273704513c5 100644 (file)
@@ -310,7 +310,7 @@ public:
                                 LyXFont const & next) const;
 
        /// Build GUI description of font state
                                 LyXFont const & next) const;
 
        /// Build GUI description of font state
-       std::string const stateText(BufferParams * params) const;
+       docstring const stateText(BufferParams * params) const;
 
        ///
        LColor_color realColor() const;
 
        ///
        LColor_color realColor() const;
index e0ccc92fbff29c9fcf28478edb92aa11d5dea499..21436798c52a7facb9bf633eb001b8ab161975c6 100644 (file)
@@ -821,7 +821,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
                                             << endl;
                        features.require("noun");
                        lyxerr[Debug::LATEX] << "Noun enabled. Font: "
                                             << endl;
                        features.require("noun");
                        lyxerr[Debug::LATEX] << "Noun enabled. Font: "
-                                            << fcit->font().stateText(0)
+                                            << to_utf8(fcit->font().stateText(0))
                                             << endl;
                }
                switch (fcit->font().color()) {
                                             << endl;
                }
                switch (fcit->font().color()) {
@@ -836,7 +836,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
                default:
                        features.require("color");
                        lyxerr[Debug::LATEX] << "Color enabled. Font: "
                default:
                        features.require("color");
                        lyxerr[Debug::LATEX] << "Color enabled. Font: "
-                                            << fcit->font().stateText(0)
+                                            << to_utf8(fcit->font().stateText(0))
                                             << endl;
                }
 
                                             << endl;
                }
 
index cab2ac41353cbda9c2ad9bf847c2dffd8a361e22..63975523216815f625c9535ceeb07fa37e597ae8 100644 (file)
@@ -2330,8 +2330,7 @@ docstring LyXText::currentState(LCursor & cur)
        LyXFont font = real_current_font;
        font.reduce(buf.params().getFont());
 
        LyXFont font = real_current_font;
        font.reduce(buf.params().getFont());
 
-       // FIXME UNICODE
-       os << bformat(_("Font: %1$s"), from_utf8(font.stateText(&buf.params())));
+       os << bformat(_("Font: %1$s"), font.stateText(&buf.params()));
 
        // The paragraph depth
        int depth = cur.paragraph().getDepth();
 
        // The paragraph depth
        int depth = cur.paragraph().getDepth();