]> git.lyx.org Git - features.git/commitdiff
non-templated tostr in separate files
authorAndré Pönitz <poenitz@gmx.net>
Tue, 13 May 2003 14:36:24 +0000 (14:36 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 13 May 2003 14:36:24 +0000 (14:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6955 a592a061-630c-0410-9148-cb99ea01b6c8

50 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/LaTeX.C
src/MenuBackend.C
src/buffer.C
src/bufferview_funcs.C
src/converter.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlForks.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlTabularCreate.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FontInfo.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormForks.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/FormWrap.C
src/frontends/xforms/Menubar_pimpl.C
src/graphics/ChangeLog
src/graphics/GraphicsConverter.C
src/graphics/PreviewLoader.C
src/insets/ChangeLog
src/insets/insetbibitem.C
src/insets/insetcollapsable.C
src/insets/insetert.C
src/insets/insetfloat.C
src/insets/insetinclude.C
src/insets/insetwrap.C
src/lyxfunc.C
src/lyxrc.C
src/support/Makefile.am
src/support/filetools.C
src/support/lstrings.h
src/support/tempname.C
src/support/tostr.C [new file with mode: 0644]
src/support/tostr.h [new file with mode: 0644]
src/tabular_funcs.C
src/tabular_funcs.h
src/tex-accent.C
src/text3.C
src/toc.C

index bb611da49130763c1f3a3f020c5368c70c3a1f5b..176a0a496140a2ea01ab4248459a07fed455543e 100644 (file)
@@ -53,7 +53,7 @@
 #include "graphics/Previews.h"
 
 #include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/filetools.h"
 
 #include <boost/bind.hpp>
index 91af4d567a220f3a935508e634d0186c6b0450f1..c5ada9b6c3c9a4055a352fbe529ec107d7be8e9f 100644 (file)
@@ -1,4 +1,17 @@
 
+2003-05-13 André Pönitz <poenitz@gmx.net>
+       
+       * BufferView_pimpl.C:
+       * buffer.C:
+       * bufferview_func.C:
+       * MenuBackend.C:
+       * lyxfunc.C:
+       * lyxrc.C:
+       * tex-accent.C:
+       * text3.C:
+       * toc.C:
+       * tabular_funcs.h: tostr() from its own header
+
 2003-05-12 André Pönitz <poenitz@gmx.net>
 
        * BufferView.C:
index 50ea8faa4bda3f4a9f8dd46905903068d23d3663..8908812d6fe5cf683a7300190fa033b79c6dfa6f 100644 (file)
@@ -21,6 +21,7 @@
 #include "funcrequest.h"
 #include "support/filetools.h"
 #include "support/FileInfo.h"
+#include "support/tostr.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/systemcall.h"
index c9beb750722f8b35d52a8447b6897575ee9086ae..9a506537b07022445ae917812f37f949a463f6f5 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-#include <algorithm>
 #include "MenuBackend.h"
 #include "lyxlex.h"
 #include "LyXAction.h"
@@ -33,6 +32,9 @@
 #include "support/filetools.h"
 #include "support/lyxfunctional.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
+
+#include <algorithm>
 
 extern BufferList bufferlist;
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
index 13c612024941acf0047a75f3d763bb673ad50ca8..da63f13f66bf1537f251e23c63e0803cd076d76d 100644 (file)
@@ -59,6 +59,7 @@
 #include "support/filetools.h"
 #include "support/path.h"
 #include "support/os.h"
+#include "support/tostr.h"
 #include "support/lyxlib.h"
 #include "support/FileInfo.h"
 #include "support/lyxmanip.h"
index df8af0248de5c7e856ae437694f0ebb3a597bf5d..dde58c3fc98feabef1be24634c35e11e5de491b3 100644 (file)
@@ -31,7 +31,7 @@
 #include "frontends/Alert.h"
 #include "mathed/math_cursor.h"
 
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "Lsstream.h"
 
 #include "insets/updatableinset.h"
index 04d296b45012ce24ae11f4f2ea61fce55a63ea99..6798b5a6a1de17f2449e0ce8e3b7423b50afe0f5 100644 (file)
@@ -28,6 +28,7 @@
 #include "support/filetools.h"
 #include "support/lyxfunctional.h"
 #include "support/path.h"
+#include "support/tostr.h"
 #include "support/systemcall.h"
 
 #include <cctype>
index 245ab25f1c5ccf962642e76b2769f231a1dce304..e628108f77e37b1b68703f37d6f5ae73f6bf1618 100644 (file)
@@ -1,11 +1,19 @@
 
-2003-05-12 André Pönitz <poenitz@gmx.net>
+2003-05-13 André Pönitz <poenitz@gmx.net>
 
        * ControlDocument.C:
        * ControlPrint.C:
        * ControlSpellchecker.C:
        * biblio.C: boost::format -> bformat  all over the place
 
+       * ControlForks.C:
+       * ControlGraphics.C:
+       * ControlPrint.C:
+       * ControlSearch.C:
+       * ControlSpellchecker.C:
+       * ControlTabularCreate.C: use tostr from new header
+
+
 2003-05-08  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * Makefile.am: better lib building
index b83bebcc18b5b78559a1cf8726a310e14c091b1b..de37e591521e81d2c8601a3204fcc897db93ee9b 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <config.h>
 
-
 #include "ControlForks.h"
 #include "ViewBase.h"
 
@@ -18,7 +17,7 @@
 #include "funcrequest.h"
 
 #include "support/forkedcontr.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 #include <boost/bind.hpp>
 
index 390703bc336a23d7505c1d496f0a799c56a2c204..5134683f4ea82a86238888e577321c49d314e40d 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-
 #include "ControlGraphics.h"
 
 #include "helper_funcs.h"
@@ -29,7 +28,7 @@
 #include "insets/insetgraphics.h"
 #include "insets/insetgraphicsParams.h"
 
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/filetools.h"
 #include "support/FileInfo.h"
 
index a039c7e0d496b4550ec1567f4be204a5ab9aa773..c05d001dfe815c36189aed912eabe22718824a00 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <config.h>
 
-
 #include "ControlPrint.h"
 
 #include "ViewBase.h"
@@ -25,6 +24,7 @@
 
 #include "frontends/Alert.h"
 
+#include "support/tostr.h"
 #include "support/LAssert.h"
 #include "support/filetools.h"
 #include "support/path.h"
index 2cb3aa7d13857a9211f3c5b3eebf3c0b2c1cbff1..a918eb1b1e420bf8d9c461105288c9ebd9b1bc2f 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <config.h>
 
-
 #include "ControlSearch.h"
 
 #include "gettext.h"
@@ -18,7 +17,7 @@
 
 #include "frontends/LyXView.h"
 
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 
 ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
index 74b749a0ef00826594c99b193912d47ffb50d72f..7406da6c97bd76796ef43a12a18b7ce72a796785 100644 (file)
@@ -29,6 +29,8 @@
 #endif
 #endif
 
+#include "support/tostr.h"
+
 #include "frontends/Alert.h"
 
 using std::endl;
index 192f4e909fe251b1587f0a626bead84092810c82..4b7283dbdaeaa3005de58c35a762da202bb5230c 100644 (file)
@@ -12,7 +12,8 @@
 
 #include "ControlTabularCreate.h"
 #include "funcrequest.h"
-#include "support/lstrings.h"
+
+#include "support/tostr.h"
 
 
 ControlTabularCreate::ControlTabularCreate(Dialog & parent)
@@ -22,14 +23,16 @@ ControlTabularCreate::ControlTabularCreate(Dialog & parent)
 
 bool ControlTabularCreate::initialiseParams(string const &)
 {
-       params_.first = params_.second = 5;
+       params_.first  = 5;
+       params_.second = 5;
        return true;
 }
 
 
 void ControlTabularCreate::clearParams()
 {
-       params_.first = params_.second = 0;
+       params_.first  = 0;
+       params_.second = 0;
 }
 
 
index f19961df2c684abed2be85848807d3a201be8fa1..be29a42d8fad38b8fff9932a8958efc32defa72e 100644 (file)
@@ -1,4 +1,19 @@
 
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+       * FontInfo.C:
+       * FormDocument.C:
+       * FormFiledialog.C:
+       * FormForks.C:
+       * FormGraphics.C:
+       * FormMinipage.C:
+       * FormParagraph.C:
+       * FormPreferences.C:
+       * FormPrint.C:
+       * FormSpellchecker.C:
+       * FormWrap.C:
+       * Menubar_pimpl.C: tostr from new header
+
 2003-05-12 André Pönitz <poenitz@gmx.net>
 
        * FormDocument.C:
index ec524ab1961c3287a47eafa6bfa41520ba709305..b7821bff9e2d9e0c799d9c7f704a080210f74367 100644 (file)
 
 #include <config.h>
 
-
 #include "FontInfo.h"
 #include "debug.h"
 #include "lyxrc.h"     // lyxrc.use_scalable_fonts
 
+#include "support/tostr.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
+
 #include "frontends/lyx_gui.h"
 
 #include <cmath>       // abs()
index f5b4c1b2b98f6df470fda915ba10a3e39746d85b..571697dc79f0651c654153e955e2d308451df322 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-
 #include "ControlDocument.h"
 #include "FormDocument.h"
 #include "forms/form_document.h"
@@ -33,6 +32,7 @@
 #include "controllers/frnt_lang.h"
 #include "controllers/helper_funcs.h"
 
+#include "support/tostr.h"
 #include "support/lstrings.h" // contains_functor, getStringFromVector
 #include "support/filetools.h" // LibFileSearch
 #include "support/BoostFormat.h"
index a8fe2ec9c97c18af138b4cae80a1cd420af7ca8d..921a1a34a9738ce12c5443feb916f273d6fb9143 100644 (file)
@@ -22,14 +22,18 @@ using std::map;
 using std::max;
 using std::sort;
 
-#include "frontends/Alert.h"
+#include "gettext.h"
+#include "forms_gettext.h"
+#include "xforms_helpers.h"
+
 #include "support/FileInfo.h"
 #include "support/lyxlib.h"
 #include "support/lstrings.h"
-#include "gettext.h"
+#include "support/tostr.h"
+#include "support/filetools.h"
+
+#include "frontends/Alert.h"
 #include "frontends/Dialogs.h"
-#include "forms_gettext.h"
-#include "xforms_helpers.h"
 
 #include <boost/bind.hpp>
 
@@ -53,7 +57,6 @@ using std::sort;
 #endif
 
 
-#include "support/filetools.h"
 #include "FormFiledialog.h"
 #include "forms/form_filedialog.h"
 #include FORMS_H_LOCATION
index 328841053891ecd48ae820af01262292476b4636..5b63a9c9fda46c37e6881aaeb60a45e51af94f2f 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-
 #include "xformsBC.h"
 #include "ButtonController.h"
 #include "FormForks.h"
@@ -22,6 +21,7 @@
 #include "xforms_helpers.h"
 #include "gettext.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include FORMS_H_LOCATION
 
 using std::vector;
index 37a32f274beb158fe7d5b74ef8b906802e8306bc..a19926373c3c8ab991997437690fd7395783b344 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <config.h>
 
-
 #include "xformsBC.h"
 #include "ControlGraphics.h"
 #include "FormGraphics.h"
@@ -32,7 +31,8 @@
 
 #include "frontends/Alert.h"
 
-#include "support/lstrings.h"  // for strToDbl & tostr
+#include "support/tostr.h"
+#include "support/lstrings.h"  // for strToDbl 
 #include "support/lyxlib.h"  // for float_equal
 #include "support/filetools.h"  // for MakeAbsPath etc
 
index e97bd6ca87f588eebb83c1b24e6d3a44a9a6e50a..2cfee7e1e8c613a9ec631690d32f739eff3a6511 100644 (file)
 
 #include <config.h>
 
-
 #include "xformsBC.h"
 #include "ControlMinipage.h"
 #include "FormMinipage.h"
 #include "forms/form_minipage.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include "helper_funcs.h"
 #include "debug.h"
 #include "xforms_helpers.h"
index b84caa803d992f13afdd6063b27256866c2a4526..01c042439e784028171439ecdaf81fc23ac8676a 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-
 #include "ControlParagraph.h"
 #include "FormParagraph.h"
 #include "forms/form_paragraph.h"
@@ -29,6 +28,7 @@
 #include "layout.h" // LyXAlignment
 
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/LAssert.h"
 
 #include FORMS_H_LOCATION
index 91f47461c20c333ae940472531be78b33c789716..003f41dffe4568aac2d5cf45bd622d34e87736a9 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <config.h>
 
-
 #include "ControlPrefs.h"
 #include "FormPreferences.h"
 #include "forms/form_preferences.h"
@@ -38,6 +37,7 @@
 
 #include "support/lyxfunctional.h"
 #include "support/lyxmanip.h"
+#include "support/tostr.h"
 #include "support/filetools.h"
 #include "support/LAssert.h"
 
@@ -657,8 +657,7 @@ void FormPreferences::Colors::InputHSV()
        int const s = int(100.0 * sat);
        int const v = int(100.0 * val);
 
-       string const label = tostr(h) + string(", ") + tostr(s) + string(", ") +
-               tostr(v);
+       string const label = tostr(h) + ", " + tostr(s) + ", " + tostr(v);
        fl_set_object_label(dialog_->text_color_values, label.c_str());
 
        RGBColor col = HSVColor(hue, sat, val);
index a5f46b9ee7e027fc193027360fcac8722c61197b..360b7497ed8533c20e3886f5f043fb91f5188919 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-
 #include "xformsBC.h"
 #include "ControlPrint.h"
 #include "FormPrint.h"
@@ -23,7 +22,7 @@
 #include "input_validators.h"
 #include "xforms_helpers.h"
 
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include FORMS_H_LOCATION
 
 
index 80469dcb8c3593fc8296e1991ff91427bb205078..6aa3b16718c39949c5779f9d9bd23e6fef8e001f 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <config.h>
 
-
 #include "xformsBC.h"
 #include "FormSpellchecker.h"
 #include "ControlSpellchecker.h"
@@ -19,7 +18,7 @@
 #include "forms_gettext.h"
 #include "Tooltips.h"
 #include "xforms_helpers.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 #include FORMS_H_LOCATION
 
index aaae3fbb1dd861cb40c710f7bc54f97f48717625..daf5a73e0b9a8e15d27531a972a799a30e4bccc9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "insets/insetwrap.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include FORMS_H_LOCATION
 
 typedef FormController<ControlWrap, FormView<FD_wrap> > base_class;
index acd453b061f6f7663320d26f5faa24642a6552d3..e2e8f55e2015d2f8c9e23c86191eaf432659cb91 100644 (file)
@@ -16,6 +16,7 @@
 #include "XFormsView.h"
 #include "lyxfunc.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/LAssert.h"
 #include "gettext.h"
 #include "debug.h"
index c32c13c3018efc6e754869a1ee68d8523f68fa49..359c40bf42584cef4666a27b2f07ab50b616db11 100644 (file)
@@ -1,4 +1,9 @@
 
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+       * GraphicsConverter.C:
+       * PreviewLoader.C: use tostr from own header
+
 2003-05-12 André Pönitz <poenitz@gmx.net>
 
        * PreviewLoader.C:  boost::format -> bformat 
index 852e5bb6ae544dd41a10fb741b35ca288ea8d70a..41d8620a14c06796d880c6a04e2897b366a741e3 100644 (file)
@@ -19,7 +19,7 @@
 #include "support/filetools.h"
 #include "support/forkedcall.h"
 #include "support/forkedcallqueue.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
index 75d6faf587152176b07f1d9c80ce4f3d4554f9bd..906d7fe2c2199a88c0c8199de33d4dba510e10bb 100644 (file)
@@ -28,7 +28,7 @@
 #include "support/filetools.h"
 #include "support/forkedcall.h"
 #include "support/forkedcontr.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
index c5337e68273005ae64878f0cd59d694be5f38613..5b1dce1abcf66804ab316aa37cd45c04b5eea9d0 100644 (file)
@@ -1,4 +1,13 @@
 
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+       * insetbibitem.C:
+       * insetcollapsable.C:
+       * insetert.C:
+       * insetfloat.C:
+       * insetinclude.C:
+       * insetwrap.C: tostr from own header
+
 2003-05-12 André Pönitz <poenitz@gmx.net>
 
        * insetcaption.C:
index 5a91ffd8d5c108ed4dcc8384d1de8b57b8576dae..71b49ac8d8235a8edf83b6ac2cfbe5e8415d996f 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "frontends/font_metrics.h"
 
+#include "support/tostr.h"
 #include "support/lstrings.h"
 
 
index 5f5da107d4c2600187ee1fb25ea2524bb3c08d43..07bb71e72fa2b3397b4dfa3087cbe80d7e9608ac 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <config.h>
 
-
 #include "insetcollapsable.h"
 #include "insettext.h"
 
@@ -32,7 +31,6 @@
 
 #include "support/LAssert.h"
 #include "support/LOstream.h"
-#include "support/lstrings.h"
 
 using std::vector;
 using std::ostream;
@@ -88,7 +86,7 @@ bool InsetCollapsable::insertInset(BufferView * bv, Inset * in)
 
 void InsetCollapsable::write(Buffer const * buf, ostream & os) const
 {
-       os << "collapsed " << tostr(collapsed_) << "\n";
+       os << "collapsed " << (collapsed_ ? "true" : "false") << "\n";
        inset.writeParagraphData(buf, os);
 }
 
index 0e53c9db9ced9656d26f70f448f22ee509a41c91..62fedfe989946ffaf01b5deb91bdb5374dfa704f 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "support/LOstream.h"
 #include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 
 using std::ostream;
index ab78bdb83ed16585d1de69fc57fdd9529d4d0fd8..43518fbc07df6d11d6094268d77e90c300d645ac 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "support/LOstream.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 
 #include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
index 2d52f64fb0f74519d6565e5345d4d84949f0e9a3..acb43ab16794c5d2853110e672be14740d605382 100644 (file)
@@ -29,7 +29,8 @@
 #include "support/filetools.h"
 #include "support/FileInfo.h"
 #include "support/FileMonitor.h"
-#include "support/lstrings.h"
+#include "support/lstrings.h" // contains
+#include "support/tostr.h"
 
 #include "graphics/PreviewedInset.h"
 #include "graphics/PreviewImage.h"
index 9068d7c53e8347eab70540c1793b09c49b099c1c..d7af96cc2cecd428b42722b5183e4fbf5ce6d5a6 100644 (file)
@@ -29,7 +29,7 @@
 #include "frontends/Dialogs.h"
 
 #include "support/LOstream.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 using std::ostream;
 using std::endl;
index 1ce5d3adb1a0afde10c09f54c8b2fe0740a0ef85..bcff99a8ef3d111839b29c8569e69c4db6d9be3d 100644 (file)
@@ -63,6 +63,7 @@
 #include "support/FileInfo.h"
 #include "support/forkedcontr.h"
 #include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/path.h"
 #include "support/lyxfunctional.h"
 
index 6b7cb7451de67046322cf4a08f687b8e280e3918..00a8ad27896091a972de132876bfba0aaa63f93e 100644 (file)
 #include <iostream>
 #include <boost/scoped_ptr.hpp>
 
-#include "debug.h"
-
 #include "lyxrc.h"
+
+#include "debug.h"
 #include "kbmap.h"
 #include "LyXAction.h"
 #include "intl.h"
-#include "support/path.h"
-#include "support/filetools.h"
-#include "support/LAssert.h"
-#include "support/userinfo.h"
 #include "converter.h"
 #include "format.h"
 #include "gettext.h"
 #include "lyxlex.h"
 
+#include "support/path.h"
+#include "support/tostr.h"
+#include "support/filetools.h"
+#include "support/LAssert.h"
+#include "support/userinfo.h"
+
 using std::ostream;
 using std::ofstream;
 using std::cout;
index 344f49b2a672bfcc5fa19f1784d1c569b467898a..2431c2f8b575c6dc114c1d7aa81f84c314955ab0 100644 (file)
@@ -64,10 +64,12 @@ libsupport_la_SOURCES = \
        sstream.h \
        systemcall.C \
        systemcall.h \
-       userinfo.C \
-       userinfo.h \
        tempname.C \
        textutils.h \
+       tostr.h \
+       tostr.C \
        translator.h \
        types.h \
+       userinfo.C \
+       userinfo.h \
        unlink.C
index 575338bef714fccc49e761707e35af2bea9dd18c..a9102ce69af453f345cf1411a52ec8fe9983f5d7 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 #include "debug.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "support/systemcall.h"
 #include "support/LAssert.h"
 
index 51dc20ad91136ecb7dde44084f735799bad83b75..45df1f5e14edd92dcb535b5e474b91f593de0989 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <vector>
 
-#include "Lsstream.h"
-
 #include "LString.h"
 
 ///
@@ -86,36 +84,6 @@ string const lowercase(string const &);
 ///
 string const uppercase(string const &);
 
-/// convert \a T to string
-template<typename T>
-inline
-string const tostr(T const & t)
-{
-       ostringstream ostr;
-       ostr << t;
-       return STRCONV(ostr.str());
-       // We need to use the .c_str since we sometimes are using
-       // our own string class and that is not compatible with
-       // basic_string<char>. (of course we don't want this later)
-}
-
-
-///
-template<>
-inline
-string const tostr(bool const & b)
-{
-       return (b ? "true" : "false");
-}
-
-///
-template<>
-inline
-string const tostr(string const & s)
-{
-       return s;
-}
-
 /// Does the string start with this prefix?
 bool prefixIs(string const &, char const *);
 
index f15ec1a6f0d63fc38a93e6a2eb9cb69b5dd1b930..d6b9fb0c7d2f95fd6cc06405118a8ed2ef7ac44d 100644 (file)
@@ -6,7 +6,7 @@
 #include "LString.h"
 #include "support/lyxlib.h"
 #include "support/filetools.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "debug.h"
 #include "os.h"
 
diff --git a/src/support/tostr.C b/src/support/tostr.C
new file mode 100644 (file)
index 0000000..2442699
--- /dev/null
@@ -0,0 +1,41 @@
+#include <config.h>
+#include "Lsstream.h"
+#include "LString.h"
+
+
+string const tostr(bool b)
+{
+       return (b ? "true" : "false");
+}
+
+
+string const tostr(unsigned int i)
+{
+       ostringstream os;
+       os << i;
+       return STRCONV(os.str());
+}
+
+
+string const tostr(double d)
+{
+       ostringstream os;
+       os << d;
+       return STRCONV(os.str());
+}
+
+
+string const tostr(int i)
+{
+       ostringstream os;
+       os << i;
+       return STRCONV(os.str());
+}
+
+
+string const tostr(string const & s)
+{
+       return s;
+}
diff --git a/src/support/tostr.h b/src/support/tostr.h
new file mode 100644 (file)
index 0000000..4ad4aa4
--- /dev/null
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+/**
+ * \file tostr.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS
+ *
+ * A collection of string helper functions that works with string.
+ * Some of these would certainly benefit from a rewrite/optimization.
+ */
+
+#ifndef TOSTR_H
+#define TOSTR_H
+
+#include "LString.h"
+
+// When trying to convert this to a template using std::stringstream,
+// note that this will pull in the whole of <string> in more than 150
+// files, even when configuring --with-included-strings !
+
+/// convert things to strings
+string const tostr(bool b);
+///
+string const tostr(int);
+///
+string const tostr(unsigned int);
+///
+string const tostr(double);
+///
+string const tostr(string const & s);
+
+#endif
index c3c2d7d19923b50273f03780bcfd5452249241d0..ac2e2fbfe2e02a3618548d5ae2238bb387699423 100644 (file)
@@ -15,6 +15,7 @@
 #include "tabular_funcs.h"
 
 #include "support/LIstream.h"
+#include "support/lstrings.h"
 
 #ifndef CXX_GLOBAL_CSTD
 using std::strlen;
index e2ce28f1e7948b9be1a76b371f1c000d0b070001..a6925e9c88e3195b04347c71d58ed0a72c7cfa9d 100644 (file)
@@ -14,9 +14,8 @@
 #ifndef TABULAR_FUNCS_H
 #define TABULAR_FUNCS_H
 
-#include "LString.h"
 #include "tabular.h"
-#include "support/lstrings.h" // for tostr
+#include "support/tostr.h"
 
 #include <iosfwd>
 
index 806b6591f5e9d96ba94a0067fe8441d08dbd04d7..6d6dae76fdbc25780a56d6f838fc118d3e9c11bb 100644 (file)
@@ -13,8 +13,7 @@
 #include <cstdlib>
 #include "tex-accent.h"
 #include "lfuns.h"
-#include "LString.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 
 /* the names used by TeX and XWindows for deadkeys/accents are not the same
    so here follows a table to clearify the differences. Please correct this
index f6f1e44b31ee163303ff65aa04ec5e12cf175633..b516764f3da708ac8b24303bcc2372048ec0ca6b 100644 (file)
@@ -25,7 +25,7 @@
 #include "intl.h"
 #include "box.h"
 #include "language.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
 #include "frontends/LyXView.h"
 #include "frontends/screen.h"
 #include "frontends/Dialogs.h"
index 2db88e4af9ad6a52c04d9baf2ed63570e18d9a31..8912609988453cf427c989ccc936a08eed286361 100644 (file)
--- a/src/toc.C
+++ b/src/toc.C
 
 #include <config.h>
 
-#include "support/lstrings.h"
 #include "toc.h"
 #include "buffer.h"
-#include "frontends/LyXView.h"
 #include "LyXAction.h"
 #include "paragraph.h"
-#include "insets/insetfloat.h"
-#include "insets/insetwrap.h"
 #include "debug.h"
 #include "iterators.h"
 
+#include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
+
+#include "support/tostr.h"
+
+#include "frontends/LyXView.h"
+
 using std::vector;
 using std::max;
 using std::endl;