X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsupport%2Fconvert.cpp;h=58a56479a3abe377761d8a1afae8da3ace6ff322;hb=57b69a5efddf9f3c148007322f00dad6c253a2ed;hp=b7ce3fc90bd33ee2d17ce1a707fbbf105c3cd880;hpb=9d0ea8aeff32833a90b3fe64df0c5518a9e241be;p=lyx.git diff --git a/src/support/convert.cpp b/src/support/convert.cpp index b7ce3fc90b..58a56479a3 100644 --- a/src/support/convert.cpp +++ b/src/support/convert.cpp @@ -3,8 +3,8 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz - * \author Lars Gullik Bjønnes + * \author André Pönitz + * \author Lars Gullik Bjønnes * * Full author contact details are available in file CREDITS. */ @@ -17,15 +17,16 @@ #include #include +#include +//needed for Mac OSX 10.5.2 Leopard +#include +using namespace std; namespace lyx { using boost::lexical_cast; -using std::string; - - template<> string convert(bool b) { @@ -89,6 +90,22 @@ docstring convert(unsigned long ul) } +#ifdef LYX_USE_LONG_LONG +template<> +string convert(unsigned long long ull) +{ + return lexical_cast(ull); +} + + +template<> +docstring convert(unsigned long long ull) +{ + return from_ascii(lexical_cast(ull)); +} +#endif + + template<> string convert(long l) { @@ -103,17 +120,37 @@ docstring convert(long l) } +#ifdef LYX_USE_LONG_LONG +template<> +string convert(long long ll) +{ + return lexical_cast(ll); +} + + +template<> +docstring convert(long long ll) +{ + return from_ascii(lexical_cast(ll)); +} +#endif + + template<> string convert(float f) { - return lexical_cast(f); + std::ostringstream val; + val << f; + return val.str(); } template<> string convert(double d) { - return lexical_cast(d); + std::ostringstream val; + val << d; + return val.str(); }