diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-03-18 09:56:47 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-03-18 09:56:47 +0000 |
| commit | 0cf5785931fbfaa6824107963c9a865634c2082f (patch) | |
| tree | 56a033416cc194a836a001a9b1ea5a7f0097293e /src/widgets/eek-color-def.cpp | |
| parent | Whitespace cleanup (diff) | |
| download | inkscape-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.cpp | 13 |
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; } |
