]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/ColorHandler.C
merge booktabs branch
[lyx.git] / src / frontends / xforms / ColorHandler.C
index fcc38a859f22635c6fee9c1927ef62f1ac0376e6..140af1d4212b3d30d8bb2d0726e90fb60a8bed5a 100644 (file)
@@ -17,7 +17,7 @@
 #include "LColor.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
 
 #include <cmath>
 
-using lyx::support::bformat;
-
 #ifndef CXX_GLOBAL_CSTD
 using std::pow;
 #endif
 
 using std::endl;
+using std::string;
 
+namespace lyx {
 
+namespace support {
 namespace {
 
        string tostr(XColor const & col)
        {
                return bformat("(%1$s,%2$s,%3$s)",
-                       ::tostr(col.red), ::tostr(col.green), ::tostr(col.blue));
+                              ::convert<string>(col.red),
+                              ::convert<string>(col.green),
+                              ::convert<string>(col.blue));
        }
 
-}
+} // namespace
+} // namespace support
+
+using support::bformat;
+using support::tostr;
 
 
+namespace frontend {
+
 LyXColorHandler::LyXColorHandler()
                : colorGCcache(LColor::ignore + 1)
 {
@@ -55,7 +64,7 @@ LyXColorHandler::LyXColorHandler()
 
        colormap = fl_state[fl_get_vclass()].colormap;
        // Clear the GC cache
-       for (int i = 0; i < colorGCcache.size(); ++i) {
+       for (string::size_type i = 0; i < colorGCcache.size(); ++i) {
                colorGCcache[i] = 0;
        }
 }
@@ -146,13 +155,13 @@ GC LyXColorHandler::getGCForeground(string const & s)
                }
 
                lyxerr << bformat(
-                       _("LyX: Couldn't allocate '%1$s' with (r,g,b)=%3$s.\n"),
+                       _("LyX: Couldn't allocate '%1$s' with (r,g,b)=%2$s.\n"),
                        s, tostr(xcol));
 
                lyxerr << bformat(
                                _("     Using closest allocated color with (r,g,b)=%1$s instead.\n"
                          "Pixel [%2$s] is used."),
-                       tostr(cmap[closest_pixel]), tostr(closest_pixel)) << endl;
+                       tostr(cmap[closest_pixel]), convert<string>(closest_pixel)) << endl;
 
                val.foreground = cmap[closest_pixel].pixel;
        }
@@ -263,3 +272,6 @@ void LyXColorHandler::updateColor (LColor_color c)
 
 //
 boost::scoped_ptr<LyXColorHandler> lyxColorHandler;
+
+} // namespace frontend
+} // namespace lyx