]> git.lyx.org Git - features.git/commitdiff
Get rid of "char const * _(char const *)".
authorAngus Leeming <leeming@lyx.org>
Mon, 19 May 2003 21:08:58 +0000 (21:08 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 19 May 2003 21:08:58 +0000 (21:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6981 a592a061-630c-0410-9148-cb99ea01b6c8

16 files changed:
src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormErrorList.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/forms/fdfixc.sed
src/gettext.C
src/gettext.h

index 956209ce19b9f2fec7808b2e705c405541c8fdac..1a79aca3994361201c768d92648077c244ae0ade 100644 (file)
@@ -1,3 +1,6 @@
+2003-05-19  Angus Leeming  <leeming@lyx.org>
+
+       * gettext.[Ch]: remove "char const * _(char const *)".
 
 2003-05-19  André Pönitz  <poenitz@gmx.net>
 
index 787df107e35845adc9111539d3d04d8d0be53bf8..8c7515af2b6611f0a8fa1df792a6f5b3abd9192a 100644 (file)
@@ -1,3 +1,22 @@
+2003-05-19  Angus Leeming  <leeming@lyx.org>
+
+       * forms/fdfixc.sed:
+       * FormAboutlyx.C (build):
+       * FormCitation.C (update):
+       * FormDocument.C (build):
+       * FormErrorList.C (updateContents):
+       * FormGraphics.C (build):
+       * FormMathsBitmap.C (build):
+       * FormMathsMatrix.C (build):
+       * FormPreferences.C (build, LnFmisc::build, OutputsMisc::build,
+       SpellOptions::build):
+       * FormRef.C (build, updateBrowser, switch_go_button):
+       * FormTabular.C (build):
+       * FormToc.C (updateContents):
+       gettext's _(str) now returns a string rather
+       than char const *, so must add a .c_str() when passing to the xforms
+       lib.
+
 2003-05-19  Angus Leeming  <leeming@lyx.org>
 
        * forms/c_str.sed: removed. Renamed as:
index 295b61c1d35f1ed9730556badc992d079a8db49d..435ac2f85c9005ee5c8b6538f57530b4acc06569 100644 (file)
@@ -78,11 +78,11 @@ void FormAboutlyx::build()
                fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
 
        // Stack tabs
-       fl_addto_tabfolder(dialog_->tabfolder, _("Version"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Version").c_str(),
                           version_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Credits").c_str(),
                           credits_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("License"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("License").c_str(),
                           license_->form);
 
        // Manage the cancel/close button
index c5f2bed904fb0af5f6cc4d6229087ff300d5ec2e..dc3feea29cef848d5ca3f0b85a49269db929c120 100644 (file)
@@ -461,7 +461,7 @@ void FormCitation::update()
        fl_set_input(dialog_->input_after,
                     controller().params().getOptions().c_str());
 
-       fl_set_input(dialog_->input_before, _("Not yet supported"));
+       fl_set_input(dialog_->input_before, _("Not yet supported").c_str());
        setEnabled(dialog_->input_before, false);
 }
 
index dbb92118885b123d16d821b9d3ce3cd8723ea6db..da801fcad9425406ec238f9f84e34be1fa7c6c91 100644 (file)
@@ -152,7 +152,7 @@ void FormDocument::build()
        fl_set_combox_browser_height(obj, 400);
 
        fl_addto_choice(class_->choice_spacing,
-                       _(" Single | OneHalf | Double | Custom "));
+                       _(" Single | OneHalf | Double | Custom ").c_str());
        fl_addto_choice(class_->choice_fontsize, "default|10|11|12");
        for (int n = 0; tex_fonts[n][0]; ++n) {
                fl_addto_choice(class_->choice_fonts,tex_fonts[n]);
@@ -172,7 +172,7 @@ void FormDocument::build()
        fl_addto_choice(class_->choice_pagestyle,
                        "default|empty|plain|headings|fancy");
        fl_addto_choice(class_->choice_skip,
-                       _(" SmallSkip | MedSkip | BigSkip | Length "));
+                       _(" SmallSkip | MedSkip | BigSkip | Length ").c_str());
        fl_addto_choice(class_->choice_skip_units,  units.c_str());
 
        // Set input filters on doc spacing to make it accept only
@@ -237,12 +237,13 @@ void FormDocument::build()
 
        fl_addto_choice(paper_->choice_papersize,
                        _(" Default | Custom | US letter | US legal "
-                         "| US executive | A3 | A4 | A5 | B3 | B4 | B5 "));
+                         "| US executive | A3 | A4 | A5 "
+                         "| B3 | B4 | B5 ").c_str());
        fl_addto_choice(paper_->choice_paperpackage,
                        _(" None "
                          "| Small Margins "
                          "| Very small Margins "
-                         "| Very wide Margins "));
+                         "| Very wide Margins ").c_str());
 
        fl_addto_choice(paper_->choice_custom_width_units,  units.c_str());
        fl_addto_choice(paper_->choice_custom_height_units, units.c_str());
@@ -282,7 +283,7 @@ void FormDocument::build()
 
        fl_addto_choice(language_->choice_quotes_language,
                        _(" ``text'' | ''text'' | ,,text`` | ,,text'' |"
-                         " «text» | »text« "));
+                         " «text» | »text« ").c_str());
 
        // the document options form
        options_.reset(build_document_options(this));
@@ -302,14 +303,14 @@ void FormDocument::build()
        fl_set_input_return(options_->input_float_placement, FL_RETURN_CHANGED);
 
        fl_addto_choice(options_->choice_ams_math,
-                       _("Never | Automatically | Yes "));
+                       _("Never | Automatically | Yes ").c_str());
 
        for (int n = 0; tex_graphics[n][0]; ++n) {
                fl_addto_choice(options_->choice_postscript_driver,
                                tex_graphics[n]);
        }
        fl_addto_choice(options_->choice_citation_format,
-                       _(" Author-year | Numerical "));
+                       _(" Author-year | Numerical ").c_str());
 
        // the document bullets form
        bullets_.reset(build_document_bullet(this));
@@ -335,8 +336,9 @@ void FormDocument::build()
        fl_set_input_return(bullets_->input_latex, FL_RETURN_CHANGED);
 
        fl_addto_choice(bullets_->choice_size,
-                       _(" Default | Tiny | Smallest | Smaller | Small |"
-                         " Normal | Large | Larger | Largest | Huge | Huger "));
+                       _(" Default | Tiny | Smallest | Smaller "
+                         "| Small | Normal | Large | Larger | Largest "
+                         "| Huge | Huger ").c_str());
        fl_set_choice(bullets_->choice_size, 1);
 
        fl_set_input_maxchars(bullets_->input_latex, 80);
@@ -350,15 +352,15 @@ void FormDocument::build()
                fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
 
        // Stack tabs
-       fl_addto_tabfolder(dialog_->tabfolder,_("Document"),
+       fl_addto_tabfolder(dialog_->tabfolder,_("Document").c_str(),
                           class_->form);
-       fl_addto_tabfolder(dialog_->tabfolder,_("Paper"),
+       fl_addto_tabfolder(dialog_->tabfolder,_("Paper").c_str(),
                           paper_->form);
-       fl_addto_tabfolder(dialog_->tabfolder,_("Language"),
+       fl_addto_tabfolder(dialog_->tabfolder,_("Language").c_str(),
                           language_->form);
-       fl_addto_tabfolder(dialog_->tabfolder,_("Extra"),
+       fl_addto_tabfolder(dialog_->tabfolder,_("Extra").c_str(),
                           options_->form);
-       fbullet = fl_addto_tabfolder(dialog_->tabfolder,_("Bullets"),
+       fbullet = fl_addto_tabfolder(dialog_->tabfolder,_("Bullets").c_str(),
                                     bullets_->form);
 
        if ((XpmVersion < 4) || (XpmVersion == 4 && XpmRevision < 7)) {
index 03deb549e3c1cc3a1df486e662c767a5e1bfcec9..8837dd507633a47e453b0571c511156ed95e946c 100644 (file)
@@ -80,7 +80,7 @@ void FormErrorList::updateContents()
        if (Errors.empty()) {
                fl_clear_browser(dialog_->browser_errors);
                fl_add_browser_line(dialog_->browser_errors,
-                                   _("*** No Lists ***"));
+                                   _("*** No Lists ***").c_str());
                setEnabled(dialog_->browser_errors, false);
                return;
        }
index 386553b32282e6de38cfe82da7be127143d2d320..9cb2b5ddcb6fc8131a97e5b55a4b04a91ee86542 100644 (file)
@@ -263,9 +263,12 @@ void FormGraphics::build()
                fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
 
        // Stack tabs
-       fl_addto_tabfolder(dialog_->tabfolder, _("File"), file_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Bounding Box"), bbox_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Extra"), extra_->form);
+       fl_addto_tabfolder(dialog_->tabfolder, _("File").c_str(),
+                          file_->form);
+       fl_addto_tabfolder(dialog_->tabfolder, _("Bounding Box").c_str(),
+                          bbox_->form);
+       fl_addto_tabfolder(dialog_->tabfolder, _("Extra").c_str(),
+                          extra_->form);
 
        // set the right default unit
        switch (lyxrc.default_papersize) {
index 3d72d22b2666023812c9598096f0071a30c6b26e..8033de2e1f7f092fec8bd68f68337ad8f38f6818 100644 (file)
@@ -104,7 +104,7 @@ void FormMathsBitmap::build()
        x_ = (fdui->form->w - 90) / 2;
        y_ = y_close + 10;
 
-       char const * const label = _("Close|^[");
+       string const label = _("Close|^[");
        fdui->button_close = fl_add_button(FL_NORMAL_BUTTON, x_, y_, 90, 30,
                                           idex(label).c_str());
        fl_set_button_shortcut(fdui->button_close, scex(label).c_str(), 1);
index 06733af9106617f72e486c3cc1f9e0cea4c690b9..5a72b9f3a517d840fed41a60253d5d1b864c6726 100644 (file)
@@ -65,7 +65,8 @@ void FormMathsMatrix::build()
 {
        dialog_.reset(build_maths_matrix(this));
 
-       fl_addto_choice(dialog_->choice_valign, _("Top | Center | Bottom"));
+       fl_addto_choice(dialog_->choice_valign,
+                       _("Top | Center | Bottom").c_str());
        fl_set_choice(dialog_->choice_valign, 2);
        fl_set_input(dialog_->input_halign, h_align_str);
        dialog_->input_halign->u_vdata = this;
index c61a064ffc8904353ae9ca8171217b244af99bd0..2bd6d84c18547b9fb0498693f84fe0d861d3f3ad 100644 (file)
@@ -227,70 +227,70 @@ void FormPreferences::build()
        // Stack tabs
        // Now add them to the tabfolder
        fl_addto_tabfolder(dialog_->tabfolder_prefs,
-                          _("Look & Feel"),
+                          _("Look & Feel").c_str(),
                           look_n_feel_tab_->form);
        fl_addto_tabfolder(dialog_->tabfolder_prefs,
-                          _("Lang Opts"),
+                          _("Lang Opts").c_str(),
                           lang_opts_tab_->form);
        fl_addto_tabfolder(dialog_->tabfolder_prefs,
-                          _("Conversion"),
+                          _("Conversion").c_str(),
                           converters_tab_->form);
        fl_addto_tabfolder(dialog_->tabfolder_prefs,
-                          _("Inputs"),
+                          _("Inputs").c_str(),
                           inputs_tab_->form);
        fl_addto_tabfolder(dialog_->tabfolder_prefs,
-                          _("Outputs"),
+                          _("Outputs").c_str(),
                           outputs_tab_->form);
 
        // now build the nested tabfolders
        // Starting with look and feel
        fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner,
-                          _("Screen Fonts"),
+                          _("Screen Fonts").c_str(),
                           screen_fonts_.dialog()->form);
        fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner,
-                          _("Interface"),
+                          _("Interface").c_str(),
                           interface_.dialog()->form);
        fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner,
-                          _("Colors"),
+                          _("Colors").c_str(),
                           colors_.dialog()->form);
        fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner,
-                          _("Misc"),
+                          _("Misc").c_str(),
                           lnf_misc_.dialog()->form);
        fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner,
-                          _("Identity"),
+                          _("Identity").c_str(),
                           identity_.dialog()->form);
 
        // then build converters
        fl_addto_tabfolder(converters_tab_->tabfolder_inner,
-                          _("Formats"),
+                          _("Formats").c_str(),
                           formats_.dialog()->form);
        fl_addto_tabfolder(converters_tab_->tabfolder_inner,
-                          _("Converters"),
+                          _("Converters").c_str(),
                           converters_.dialog()->form);
 
        // then build inputs
        // Paths should probably go in a few inner_tab called Files
        fl_addto_tabfolder(inputs_tab_->tabfolder_inner,
-                          _("Paths"),
+                          _("Paths").c_str(),
                           paths_.dialog()->form);
        fl_addto_tabfolder(inputs_tab_->tabfolder_inner,
-                          _("Misc"),
+                          _("Misc").c_str(),
                           inputs_misc_.dialog()->form);
 
        // then building outputs
        fl_addto_tabfolder(outputs_tab_->tabfolder_inner,
-                          _("Printer"),
+                          _("Printer").c_str(),
                           printer_.dialog()->form);
        fl_addto_tabfolder(outputs_tab_->tabfolder_inner,
-                          _("Misc"),
+                          _("Misc").c_str(),
                           outputs_misc_.dialog()->form);
 
        // then building usage
        fl_addto_tabfolder(lang_opts_tab_->tabfolder_inner,
-                          _("Spell checker"),
+                          _("Spell checker").c_str(),
                           spelloptions_.dialog()->form);
        fl_addto_tabfolder(lang_opts_tab_->tabfolder_inner,
-                          _("Language"),
+                          _("Language").c_str(),
                           language_.dialog()->form);
 }
 
@@ -1887,7 +1887,8 @@ void FormPreferences::LnFmisc::build()
        setPrehandler(dialog_->check_preview_latex);
        setPrehandler(dialog_->counter_wm_jump);
 
-       fl_addto_choice(dialog_->choice_display, _("Monochrome|Grayscale|Color|Do not display"));
+       fl_addto_choice(dialog_->choice_display,
+                       _("Monochrome|Grayscale|Color|Do not display").c_str());
 }
 
 
@@ -1986,7 +1987,8 @@ void FormPreferences::OutputsMisc::build()
        fl_set_input_return(dialog_->input_paperoption,  FL_RETURN_CHANGED);
 
        fl_addto_choice(dialog_->choice_default_papersize,
-                       _(" default | US letter | US legal | US executive | A3 | A4 | A5 | B5 "));
+                       _(" default | US letter | US legal "
+                         "| US executive | A3 | A4 | A5 | B5 ").c_str());
 
        // set up the feedback mechanism
        setPrehandler(dialog_->counter_line_len);
@@ -2863,7 +2865,7 @@ void FormPreferences::SpellOptions::build()
        dialog_.reset(build_preferences_spelloptions(&parent_));
 
        fl_addto_choice(dialog_->choice_spell_command,
-                       _(" ispell | aspell "));
+                       _(" ispell | aspell ").c_str());
        fl_set_input_return(dialog_->input_alt_lang,      FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_escape_chars,  FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_personal_dict, FL_RETURN_CHANGED);
index aac997f622b246f96d4848ffdd48a4cd84a7976d..7fe982295b67bb60e57f8ef9a4656d96b5b783a8 100644 (file)
@@ -42,7 +42,7 @@ void FormRef::build()
 
        for (int i = 0; !InsetRef::types[i].latex_name.empty(); ++i)
                fl_addto_choice(dialog_->choice_format,
-                               _(InsetRef::types[i].gui_name.c_str()));
+                               _(InsetRef::types[i].gui_name).c_str());
 
        // Force the user to use the browser to change refs.
        fl_deactivate_object(dialog_->input_ref);
@@ -175,7 +175,7 @@ void FormRef::updateBrowser(vector<string> const & akeys) const
 
        if (keys.empty()) {
                fl_add_browser_line(dialog_->browser_refs,
-                                   _("*** No labels found in document ***"));
+                                   _("*** No labels found in document ***").c_str());
 
                setEnabled(dialog_->browser_refs, false);
                setEnabled(dialog_->check_sort,   false);
@@ -273,11 +273,11 @@ ButtonPolicy::SMInput FormRef::input(FL_OBJECT * ob, long)
 void FormRef::switch_go_button()
 {
        if (at_ref_) {
-               fl_set_object_label(dialog_->button_go, _("Go back"));
-               tooltips().init(dialog_->button_go, _("Go back to original place."));
+               fl_set_object_label(dialog_->button_go, _("Go back").c_str());
+               tooltips().init(dialog_->button_go, _("Go back to original place.").c_str());
        } else {
-               fl_set_object_label(dialog_->button_go, _("Go to"));
-               tooltips().init(dialog_->button_go, _("Go to selected reference."));
+               fl_set_object_label(dialog_->button_go, _("Go to").c_str());
+               tooltips().init(dialog_->button_go, _("Go to selected reference.").c_str());
        }
        fl_set_button_shortcut(dialog_->button_go, "#G", 1);
        fl_show_object(dialog_->button_go);
index 056459dd22803b616051ba2796500c51ffd284fe..78d62c29e226b88893b69a61562f074c1943283e 100644 (file)
@@ -127,13 +127,13 @@ void FormTabular::build()
                fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
 
        // Stack tabs
-       fl_addto_tabfolder(dialog_->tabfolder, _("Table"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Table").c_str(),
                           tabular_options_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Column/Row"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Column/Row").c_str(),
                           column_options_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Cell"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Cell").c_str(),
                           cell_options_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("LongTable"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("LongTable").c_str(),
                           longtable_options_->form);
 
        //  FIXME: addReadOnly everything
index cd2cafa0e501180b88b78d1d0cb48649de6ea97d..45755c9ea3e27bb7739edb72385042082fd6a9ff 100644 (file)
@@ -97,7 +97,7 @@ void FormToc::updateContents()
        if (type.empty()) {
                fl_clear_browser(dialog_->browser_toc);
                fl_add_browser_line(dialog_->browser_toc,
-                                   _("*** No Lists ***"));
+                                   _("*** No Lists ***").c_str());
                setEnabled(dialog_->browser_toc, false);
                return;
        }
@@ -115,7 +115,7 @@ void FormToc::updateContents()
        if (contents.empty()) {
                fl_clear_browser(dialog_->browser_toc);
                fl_add_browser_line(dialog_->browser_toc,
-                                   _("*** No Lists ***"));
+                                   _("*** No Lists ***").c_str());
                setEnabled(dialog_->browser_toc, false);
                return;
        }
index 47928dfe78b35ef471177cf4e92c11e0f19d794b..a60b3add4bbbe5ec33b82080daaad3ca5e11cbdd 100644 (file)
@@ -93,8 +93,8 @@ s/CHOICE/COMBOX/
 
 
 # For all lines containing "fl_" and a string _not_ containing |,
-# replace the string with _(string)
-/fl_/ s/".[^|]*"/_(&)/
+# replace the string with _(string).c_str()
+/fl_/ s/".[^|]*"/_(&).c_str()/
 
 
 #  For all lines containing "_shortcut" and a string containing |, 
index 6165efb3fbb91e3938d5585a3137e2bab97f879c..7bc80b4f7b0fa31c566fb54860617567e6f694f9 100644 (file)
@@ -1,12 +1,13 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file gettext.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #include <config.h>
 
@@ -32,12 +33,6 @@ Messages & getLyXMessages()
 } // anon namespace
 
 
-char const * _(char const * str)
-{
-       return getLyXMessages().get(str).c_str();
-}
-
-
 string const _(string const & str)
 {
        return getLyXMessages().get(str);
index 7295c7dc337238b8ede2c13476a7bf095bb4072e..f19d4508ceecd9f22586d79fd722cfb870ec3be7 100644 (file)
@@ -1,4 +1,14 @@
 // -*- C++ -*-
+/**
+ * \file gettext.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ *
+ * Full author contact details are available in file CREDITS
+ */
 #ifndef _GETTEXT_H_
 #define _GETTEXT_H_
 
@@ -34,8 +44,6 @@
 
 //#ifdef ENABLE_NLS
 
-///
-char const * _(char const *);
 ///
 string const _(string const &);