summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-12-18 22:31:07 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-12-18 22:31:07 +0000
commit38f4e0e9aeb0696939475ce9450a20b281144d27 (patch)
tree81de96cf319a1d3bb74a7e06d99f43053bdf6f5d /src/ui/dialog/document-properties.cpp
parentTutorials. German and Greek translations update. (diff)
downloadinkscape-38f4e0e9aeb0696939475ce9450a20b281144d27.tar.gz
inkscape-38f4e0e9aeb0696939475ce9450a20b281144d27.zip
brings back CMS tab
Fixed bugs: - https://launchpad.net/bugs/1504612 (bzr r14537)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp14
1 files changed, 10 insertions, 4 deletions
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.
}