diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-12-18 22:31:07 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-12-18 22:31:07 +0000 |
| commit | 38f4e0e9aeb0696939475ce9450a20b281144d27 (patch) | |
| tree | 81de96cf319a1d3bb74a7e06d99f43053bdf6f5d /src | |
| parent | Tutorials. German and Greek translations update. (diff) | |
| download | inkscape-38f4e0e9aeb0696939475ce9450a20b281144d27.tar.gz inkscape-38f4e0e9aeb0696939475ce9450a20b281144d27.zip | |
brings back CMS tab
Fixed bugs:
- https://launchpad.net/bugs/1504612
(bzr r14537)
Diffstat (limited to 'src')
| -rw-r--r-- | src/color-profile.cpp | 1 | ||||
| -rw-r--r-- | src/document.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 14 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 34f1b0155..bcefe994a 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -271,6 +271,7 @@ void ColorProfile::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); this->readAttr( "xlink:href" ); + this->readAttr( "id" ); this->readAttr( "local" ); this->readAttr( "name" ); this->readAttr( "rendering-intent" ); diff --git a/src/document.cpp b/src/document.cpp index b22b99e66..70fb56fe8 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -992,6 +992,8 @@ void SPDocument::bindObjectToId(gchar const *id, SPObject *object) { GQuark idq = g_quark_from_string(id); if (object) { + if(object->getId()) + priv->iddef.erase(object->getId()); g_assert(priv->iddef.find(id)==priv->iddef.end()); priv->iddef[id] = object; //g_assert(g_hash_table_lookup(priv->iddef, GINT_TO_POINTER(idq)) == NULL); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 8af744fd3..b90467d93 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -479,7 +479,13 @@ void DocumentProperties::linkSelectedProfile() std::vector<std::pair<Glib::ustring, Glib::ustring> > pairs = ColorProfile::getProfileFilesWithNames(); Glib::ustring file = pairs[row].first; Glib::ustring name = pairs[row].second; - + std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" ); + for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) { + SPObject* obj = *it; + Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj); + if (!strcmp(prof->href, file.c_str())) + return; + } Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); Inkscape::XML::Node *cprofRepr = xml_doc->createElement("svg:color-profile"); gchar* tmp = g_strdup(name.c_str()); @@ -487,6 +493,8 @@ void DocumentProperties::linkSelectedProfile() sanitizeName(nameStr); cprofRepr->setAttribute("name", nameStr.c_str()); cprofRepr->setAttribute("xlink:href", (gchar*) file.c_str()); + cprofRepr->setAttribute("id", (gchar*) file.c_str()); + // Checks whether there is a defs element. Creates it when needed Inkscape::XML::Node *defsRepr = sp_repr_lookup_name(xml_doc, "svg:defs"); @@ -598,9 +606,7 @@ void DocumentProperties::removeSelectedProfile(){ SPObject* obj = *it; Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj); if (!name.compare(prof->name)){ - - //XML Tree being used directly here while it shouldn't be. - sp_repr_unparent(obj->getRepr()); + prof->deleteObject(true, false); DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile")); break; // removing the color profile likely invalidates part of the traversed list, stop traversing here. } |
