author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Thu, 25 Nov 2010 20:14:15 +0000 (21:14 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Thu, 25 Nov 2010 20:14:15 +0000 (21:14 +0100) |
src/ui/tool/node-tool.cpp | patch | blob | history | |
src/widgets/ege-paint-def.cpp | patch | blob | history |
index 9809ee848e28162e35a63958508c538b55c08287..e046fb57338b67f5ce9a28878c9ebbe91379113b 100644 (file)
// TRANSLATORS: The %s below is where the "%u of %u nodes selected" sentence gets put
char *dyntip = g_strdup_printf(C_("Node tool tip",
"%s Drag to select nodes, click to edit only this object (more: Shift)"),
- nodestring, sz, total);
+ nodestring);
nt->_node_message_context->set(Inkscape::NORMAL_MESSAGE, dyntip);
g_free(dyntip);
} else {
char *dyntip = g_strdup_printf(C_("Node tool tip",
"%s Drag to select nodes, click clear the selection"),
- nodestring, sz, total);
+ nodestring);
nt->_node_message_context->set(Inkscape::NORMAL_MESSAGE, dyntip);
g_free(dyntip);
}
index cab675b295b44c8448878dd5dba2a375acc1a30e..2fc6927df2e626bdb632b8a44f38c02f1359b077 100644 (file)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <glibmm/stringutils.h>
#if !defined(_)
#define _(s) gettext(s)
static std::string mimeX_COLOR("application/x-color");
static std::string mimeOSWB_COLOR("application/x-oswb-color");
-static std::string doubleToStr(double d);
-
PaintDef::PaintDef() :
descr(_("none")),
type(NONE),
@@ -183,11 +182,11 @@ void PaintDef::getMIMEData(std::string const & type, char*& dest, int& len, int&
{
tmp += std::string("<color name=\"") + descr + "\">";
tmp += "<sRGB r=\"";
- tmp += doubleToStr(getR()/255.0);
+ tmp += Glib::Ascii::dtostr(getR()/255.0);
tmp += "\" g=\"";
- tmp += doubleToStr(getG()/255.0);
+ tmp += Glib::Ascii::dtostr(getG()/255.0);
tmp += "\" b=\"";
- tmp += doubleToStr(getB()/255.0);
+ tmp += Glib::Ascii::dtostr(getB()/255.0);
tmp += "\"/>";
tmp += "</color>";
}
@@ -233,20 +232,17 @@ bool PaintDef::fromMIMEData(std::string const & type, char const * data, int len
this->type = ege::PaintDef::RGB;
size_t numPos = srgb.find("r=");
if (numPos != std::string::npos) {
- char* endPtr = 0;
- double dbl = strtod(srgb.c_str() + numPos + 3, &endPtr);
+ double dbl = Glib::Ascii::strtod(srgb.substr(numPos + 3));
this->r = static_cast<int>(255 * dbl);
}
numPos = srgb.find("g=");
if (numPos != std::string::npos) {
- char* endPtr = 0;
- double dbl = strtod(srgb.c_str() + numPos + 3, &endPtr);
+ double dbl = Glib::Ascii::strtod(srgb.substr(numPos + 3));
this->g = static_cast<int>(255 * dbl);
}
numPos = srgb.find("b=");
if (numPos != std::string::npos) {
- char* endPtr = 0;
- double dbl = strtod(srgb.c_str() + numPos + 3, &endPtr);
+ double dbl = Glib::Ascii::strtod(srgb.substr(numPos + 3));
this->b = static_cast<int>(255 * dbl);
}
{
}
-static std::string doubleToStr(double d)
-{
- // TODO ensure "." is used for decimal separator.
- std::stringstream out;
- out << d;
- return out.str();
-}
} // namespace ege