Code

Updated Russian translation
[inkscape.git] / src / style.cpp
index a5b25e6ffa8a2861e8c3b373a239cdbe69d32a2a..dd81692823123f0b45c055ebe1da5f0cb3af22ca 100644 (file)
@@ -994,13 +994,24 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val)
             /* SVG */
             /* Clip/Mask */
         case SP_PROP_CLIP_PATH:
-            g_warning("Unimplemented style property SP_PROP_CLIP_PATH: value: %s", val);
+            /** \todo
+             * This is a workaround. Inkscape only supports 'clip-path' as SVG attribute, not as
+             * style property. By having both CSS and SVG attribute set, editing of clip-path
+             * will fail, since CSS always overwrites SVG attributes.
+             * Fixes Bug #324849
+             */
+            g_warning("attribute 'clip-path' given as CSS");
+            style->object->repr->setAttribute("clip-path", val);
             break;
         case SP_PROP_CLIP_RULE:
             g_warning("Unimplemented style property SP_PROP_CLIP_RULE: value: %s", val);
             break;
         case SP_PROP_MASK:
-            g_warning("Unimplemented style property SP_PROP_MASK: value: %s", val);
+            /** \todo
+             * See comment for SP_PROP_CLIP_PATH
+             */
+            g_warning("attribute 'mask' given as CSS");
+            style->object->repr->setAttribute("mask", val);
             break;
         case SP_PROP_OPACITY:
             if (!style->opacity.set) {
@@ -2197,7 +2208,7 @@ sp_style_merge_ifilter(SPStyle *style, SPIFilter const *parent)
             style->filter.href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
     }
 
-    if (style->filter.href && parent->href) {
+    if (style->filter.href && parent->href && parent->href->getObject()) {
         try {
             style->filter.href->attach(*parent->href->getURI());
         } catch (Inkscape::BadURIException &e) {
@@ -3849,13 +3860,15 @@ sp_style_set_property_url (SPObject *item, gchar const *property, SPObject *link
 
     if (repr == NULL) return;
 
-    g_return_if_fail(linked != NULL);
-
-    gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(linked));
-
     SPCSSAttr *css = sp_repr_css_attr_new();
-    sp_repr_css_set_property(css, property, val);
-    g_free(val);
+    if (linked) {
+        gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(linked));
+        sp_repr_css_set_property(css, property, val);
+        g_free(val);
+    } else {
+        sp_repr_css_unset_property(css, "filter");
+    }
+
     if (recursive) {
         sp_repr_css_change_recursive(repr, css, "style");
     } else {