From 2caff468e5aca8b20649487f837a739215d015c9 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 22 Dec 2006 10:06:40 +0000 Subject: [PATCH] convert more GUI strings to docstring git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16377 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LColor.C | 6 +- src/LColor.h | 2 +- src/frontends/controllers/ControlExternal.C | 4 +- src/frontends/controllers/ControlExternal.h | 2 +- src/frontends/controllers/ControlGraphics.C | 3 +- src/frontends/controllers/ControlGraphics.h | 2 +- src/frontends/controllers/ControlToc.C | 8 +- src/frontends/controllers/ControlToc.h | 2 +- src/frontends/controllers/character.C | 90 ++++++++++----------- src/frontends/controllers/character.h | 12 +-- src/frontends/qt4/QGraphics.C | 5 +- src/frontends/qt4/QParagraph.C | 2 +- 12 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/LColor.C b/src/LColor.C index 18f2a0fbd5..1288b1d9d3 100644 --- a/src/LColor.C +++ b/src/LColor.C @@ -250,12 +250,14 @@ bool LColor::setColor(string const & lyxname, string const &x11name) } -LColor::color LColor::getFromGUIName(string const & guiname) const +LColor::color LColor::getFromGUIName(docstring const & guiname) const { Pimpl::InfoTab::const_iterator it = pimpl_->infotab.begin(); Pimpl::InfoTab::const_iterator end = pimpl_->infotab.end(); for (; it != end; ++it) { - if (!compare_ascii_no_case(to_utf8(_(it->second.guiname)), guiname)) + // FIXME comparison of translated strings is problematic, + // and compare_ascii_no_case is probably not correct + if (!compare_ascii_no_case(_(it->second.guiname), guiname)) return it->first; } return LColor::inherit; diff --git a/src/LColor.h b/src/LColor.h index d11b291ecb..e76de45360 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -216,7 +216,7 @@ public: std::string const getLyXName(LColor::color c) const; /// \returns the LColor::color associated with the GUI name. - LColor::color getFromGUIName(std::string const & guiname) const; + LColor::color getFromGUIName(docstring const & guiname) const; /// \returns the LColor::color associated with the LyX name. LColor::color getFromLyXName(std::string const & lyxname) const; /// \returns the LColor::color associated with the LaTeX name. diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index 2fc9eb107d..fccc440c59 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -245,9 +245,9 @@ vector const & all_origins() return origins; } -string const origin_gui_str(size_type i) +docstring const origin_gui_str(size_type i) { - return lyx::to_utf8(_(origin_gui_strs[i])); + return _(origin_gui_strs[i]); } } // namespace external diff --git a/src/frontends/controllers/ControlExternal.h b/src/frontends/controllers/ControlExternal.h index 6d9d7dff3f..432924c02e 100644 --- a/src/frontends/controllers/ControlExternal.h +++ b/src/frontends/controllers/ControlExternal.h @@ -88,7 +88,7 @@ private: namespace external { std::vector const & all_origins(); -std::string const origin_gui_str(size_type i); +docstring const origin_gui_str(size_type i); } // namespace external } // namespace lyx diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index a1b90cd20b..72ae744b7e 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -191,8 +191,7 @@ vector getRotationOriginData() data.resize(rorigin_size); for (size_type i = 0; i < rorigin_size; ++i) { - // FIXME UNICODE - data[i] = make_pair(lyx::to_utf8(_(rorigin_gui_strs[i])), + data[i] = make_pair(_(rorigin_gui_strs[i]), rorigin_lyx_strs[i]); } diff --git a/src/frontends/controllers/ControlGraphics.h b/src/frontends/controllers/ControlGraphics.h index d0844e9a49..a668943ca3 100644 --- a/src/frontends/controllers/ControlGraphics.h +++ b/src/frontends/controllers/ControlGraphics.h @@ -70,7 +70,7 @@ private: std::vector const getBBUnits(); /// The (tranlated) GUI std::string and it's LaTeX equivalent. -typedef std::pair RotationOriginPair; +typedef std::pair RotationOriginPair; /// std::vector getRotationOriginData(); diff --git a/src/frontends/controllers/ControlToc.C b/src/frontends/controllers/ControlToc.C index 08018b820c..a3c099be92 100644 --- a/src/frontends/controllers/ControlToc.C +++ b/src/frontends/controllers/ControlToc.C @@ -93,17 +93,17 @@ TocIterator const ControlToc::getCurrentTocItem( } -string const ControlToc::getGuiName(string const & type) const +docstring const ControlToc::getGuiName(string const & type) const { if (type == "tableofcontents") - return lyx::to_utf8(_("Table of Contents")); + return _("Table of Contents"); FloatList const & floats = kernel().buffer().params().getLyXTextClass().floats(); if (floats.typeExist(type)) - return floats.getType(type).name(); + return from_utf8(floats.getType(type).name()); else - return lyx::to_utf8(_(type)); + return _(type); } diff --git a/src/frontends/controllers/ControlToc.h b/src/frontends/controllers/ControlToc.h index 58f1396ba4..9f30415154 100644 --- a/src/frontends/controllers/ControlToc.h +++ b/src/frontends/controllers/ControlToc.h @@ -35,7 +35,7 @@ public: std::vector const & getTypes() const; /// Return the guiname from a given cmdName of the TOC param - std::string const getGuiName(std::string const & type) const; + docstring const getGuiName(std::string const & type) const; /// Return the first TocItem before the cursor TocIterator const getCurrentTocItem(std::string const & type) const; diff --git a/src/frontends/controllers/character.C b/src/frontends/controllers/character.C index a39e435a10..d13387cf66 100644 --- a/src/frontends/controllers/character.C +++ b/src/frontends/controllers/character.C @@ -26,23 +26,23 @@ vector const getFamilyData() FamilyPair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = LyXFont::IGNORE_FAMILY; family[0] = pr; - pr.first = lyx::to_utf8(_("Roman")); + pr.first = _("Roman"); pr.second = LyXFont::ROMAN_FAMILY; family[1] = pr; - pr.first = lyx::to_utf8(_("Sans Serif")); + pr.first = _("Sans Serif"); pr.second = LyXFont::SANS_FAMILY; family[2] = pr; - pr.first = lyx::to_utf8(_("Typewriter")); + pr.first = _("Typewriter"); pr.second = LyXFont::TYPEWRITER_FAMILY; family[3] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = LyXFont::INHERIT_FAMILY; family[4] = pr; @@ -56,19 +56,19 @@ vector const getSeriesData() SeriesPair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = LyXFont::IGNORE_SERIES; series[0] = pr; - pr.first = lyx::to_utf8(_("Medium")); + pr.first = _("Medium"); pr.second = LyXFont::MEDIUM_SERIES; series[1] = pr; - pr.first = lyx::to_utf8(_("Bold")); + pr.first = _("Bold"); pr.second = LyXFont::BOLD_SERIES; series[2] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SERIES; series[3] = pr; @@ -82,27 +82,27 @@ vector const getShapeData() ShapePair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = LyXFont::IGNORE_SHAPE; shape[0] = pr; - pr.first = lyx::to_utf8(_("Upright")); + pr.first = _("Upright"); pr.second = LyXFont::UP_SHAPE; shape[1] = pr; - pr.first = lyx::to_utf8(_("Italic")); + pr.first = _("Italic"); pr.second = LyXFont::ITALIC_SHAPE; shape[2] = pr; - pr.first = lyx::to_utf8(_("Slanted")); + pr.first = _("Slanted"); pr.second = LyXFont::SLANTED_SHAPE; shape[3] = pr; - pr.first = lyx::to_utf8(_("Small Caps")); + pr.first = _("Small Caps"); pr.second = LyXFont::SMALLCAPS_SHAPE; shape[4] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SHAPE; shape[5] = pr; @@ -116,59 +116,59 @@ vector const getSizeData() SizePair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = LyXFont::IGNORE_SIZE; size[0] = pr; - pr.first = lyx::to_utf8(_("Tiny")); + pr.first = _("Tiny"); pr.second = LyXFont::SIZE_TINY; size[1] = pr; - pr.first = lyx::to_utf8(_("Smallest")); + pr.first = _("Smallest"); pr.second = LyXFont::SIZE_SCRIPT; size[2] = pr; - pr.first = lyx::to_utf8(_("Smaller")); + pr.first = _("Smaller"); pr.second = LyXFont::SIZE_FOOTNOTE; size[3] = pr; - pr.first = lyx::to_utf8(_("Small")); + pr.first = _("Small"); pr.second = LyXFont::SIZE_SMALL; size[4] = pr; - pr.first = lyx::to_utf8(_("Normal")); + pr.first = _("Normal"); pr.second = LyXFont::SIZE_NORMAL; size[5] = pr; - pr.first = lyx::to_utf8(_("Large")); + pr.first = _("Large"); pr.second = LyXFont::SIZE_LARGE; size[6] = pr; - pr.first = lyx::to_utf8(_("Larger")); + pr.first = _("Larger"); pr.second = LyXFont::SIZE_LARGER; size[7] = pr; - pr.first = lyx::to_utf8(_("Largest")); + pr.first = _("Largest"); pr.second = LyXFont::SIZE_LARGEST; size[8] = pr; - pr.first = lyx::to_utf8(_("Huge")); + pr.first = _("Huge"); pr.second = LyXFont::SIZE_HUGE; size[9] = pr; - pr.first = lyx::to_utf8(_("Huger")); + pr.first = _("Huger"); pr.second = LyXFont::SIZE_HUGER; size[10] = pr; - pr.first = lyx::to_utf8(_("Increase")); + pr.first = _("Increase"); pr.second = LyXFont::INCREASE_SIZE; size[11] = pr; - pr.first = lyx::to_utf8(_("Decrease")); + pr.first = _("Decrease"); pr.second = LyXFont::DECREASE_SIZE; size[12] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SIZE; size[13] = pr; @@ -182,23 +182,23 @@ vector const getBarData() BarPair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = IGNORE; bar[0] = pr; - pr.first = lyx::to_utf8(_("Emph")); + pr.first = _("Emph"); pr.second = EMPH_TOGGLE; bar[1] = pr; - pr.first = lyx::to_utf8(_("Underbar")); + pr.first = _("Underbar"); pr.second = UNDERBAR_TOGGLE; bar[2] = pr; - pr.first = lyx::to_utf8(_("Noun")); + pr.first = _("Noun"); pr.second = NOUN_TOGGLE; bar[3] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = INHERIT; bar[4] = pr; @@ -212,47 +212,47 @@ vector const getColorData() ColorPair pr; - pr.first = lyx::to_utf8(_("No change")); + pr.first = _("No change"); pr.second = LColor::ignore; color[0] = pr; - pr.first = lyx::to_utf8(_("No color")); + pr.first = _("No color"); pr.second = LColor::none; color[1] = pr; - pr.first = lyx::to_utf8(_("Black")); + pr.first = _("Black"); pr.second = LColor::black; color[2] = pr; - pr.first = lyx::to_utf8(_("White")); + pr.first = _("White"); pr.second = LColor::white; color[3] = pr; - pr.first = lyx::to_utf8(_("Red")); + pr.first = _("Red"); pr.second = LColor::red; color[4] = pr; - pr.first = lyx::to_utf8(_("Green")); + pr.first = _("Green"); pr.second = LColor::green; color[5] = pr; - pr.first = lyx::to_utf8(_("Blue")); + pr.first = _("Blue"); pr.second = LColor::blue; color[6] = pr; - pr.first = lyx::to_utf8(_("Cyan")); + pr.first = _("Cyan"); pr.second = LColor::cyan; color[7] = pr; - pr.first = lyx::to_utf8(_("Magenta")); + pr.first = _("Magenta"); pr.second = LColor::magenta; color[8] = pr; - pr.first = lyx::to_utf8(_("Yellow")); + pr.first = _("Yellow"); pr.second = LColor::yellow; color[9] = pr; - pr.first = lyx::to_utf8(_("Reset")); + pr.first = _("Reset"); pr.second = LColor::inherit; color[10] = pr; diff --git a/src/frontends/controllers/character.h b/src/frontends/controllers/character.h index 9e4f2cc79e..a63f432aef 100644 --- a/src/frontends/controllers/character.h +++ b/src/frontends/controllers/character.h @@ -41,17 +41,17 @@ enum FONT_STATE { }; /// -typedef std::pair FamilyPair; +typedef std::pair FamilyPair; /// -typedef std::pair SeriesPair; +typedef std::pair SeriesPair; /// -typedef std::pair ShapePair; +typedef std::pair ShapePair; /// -typedef std::pair SizePair; +typedef std::pair SizePair; /// -typedef std::pair BarPair; +typedef std::pair BarPair; /// -typedef std::pair ColorPair; +typedef std::pair ColorPair; /// std::vector const getFamilyData(); diff --git a/src/frontends/qt4/QGraphics.C b/src/frontends/qt4/QGraphics.C index e9b872b131..5de55f52b1 100644 --- a/src/frontends/qt4/QGraphics.C +++ b/src/frontends/qt4/QGraphics.C @@ -241,12 +241,11 @@ void QGraphics::update_contents() dialog_->origin->clear(); - using namespace frontend; vector origindata = getRotationOriginData(); - vector const origin_lang = getFirst(origindata); + vector const origin_lang = getFirst(origindata); QGraphics::origin_ltx = getSecond(origindata); - for (vector::const_iterator it = origin_lang.begin(); + for (vector::const_iterator it = origin_lang.begin(); it != origin_lang.end(); ++it) dialog_->origin->addItem(toqstr(*it)); diff --git a/src/frontends/qt4/QParagraph.C b/src/frontends/qt4/QParagraph.C index 5c326e06d7..1c6d7add91 100644 --- a/src/frontends/qt4/QParagraph.C +++ b/src/frontends/qt4/QParagraph.C @@ -114,7 +114,7 @@ void QParagraph::update_contents() // label width docstring const & labelwidth = params.labelWidthString(); - // lyx::to_utf8(_() is correct here (this is stupid though !)) + // FIXME We should not compare translated strings if (labelwidth != _("Senseless with this layout!")) { dialog_->labelwidthGB->setEnabled(true); dialog_->labelWidth->setText(toqstr(labelwidth)); -- 2.39.5