summaryrefslogtreecommitdiffstats
path: root/src/widgets/eek-color-def.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-03-18 09:56:47 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-03-18 09:56:47 +0000
commit0cf5785931fbfaa6824107963c9a865634c2082f (patch)
tree56a033416cc194a836a001a9b1ea5a7f0097293e /src/widgets/eek-color-def.cpp
parentWhitespace cleanup (diff)
downloadinkscape-0cf5785931fbfaa6824107963c9a865634c2082f.tar.gz
inkscape-0cf5785931fbfaa6824107963c9a865634c2082f.zip
Rough code to preserve drag-n-drop of solid gradients.
(bzr r7518)
Diffstat (limited to 'src/widgets/eek-color-def.cpp')
-rw-r--r--src/widgets/eek-color-def.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/eek-color-def.cpp b/src/widgets/eek-color-def.cpp
index fb0eeeb5e..8542e5593 100644
--- a/src/widgets/eek-color-def.cpp
+++ b/src/widgets/eek-color-def.cpp
@@ -248,6 +248,19 @@ bool ColorDef::fromMIMEData(std::string const & type, char const * data, int len
double dbl = strtod(srgb.c_str() + numPos + 3, &endPtr);
this->b = static_cast<int>(255 * dbl);
}
+
+ size_t pos = xml.find("<color ");
+ if ( pos != std::string::npos ) {
+ size_t endPos = xml.find(">", pos);
+ std::string colorTag = xml.substr(pos, endPos);
+
+ size_t namePos = colorTag.find("name=");
+ if (namePos != std::string::npos) {
+ char quote = colorTag[namePos + 5];
+ endPos = colorTag.find(quote, namePos + 6);
+ descr = colorTag.substr(namePos + 6, endPos - (namePos + 6));
+ }
+ }
changed = true;
worked = true;
}