summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a55211)
raw | patch | inline | side by side (parent: 0a55211)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 1 Aug 2008 20:17:58 +0000 (20:17 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 1 Aug 2008 20:17:58 +0000 (20:17 +0000) |
src/splivarot.cpp | patch | blob | history |
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 47a365c681e10c9aa1703383dc1963d4a70017a2..9185ec84b8c376a3f3f6eb33e0baf6fd3cbb9af4 100644 (file)
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
continue;
}
- { // pas de stroke pas de chocolat
- SPCSSAttr *css = sp_repr_css_attr_inherited(SP_OBJECT_REPR(item), "style");
- gchar const *val = sp_repr_css_property(css, "stroke", NULL);
-
- if (val == NULL || strcmp(val, "none") == 0) {
- curve->unref();
- continue;
- }
+ // pas de stroke pas de chocolat
+ if (!SP_OBJECT_STYLE(item) || SP_OBJECT_STYLE(item)->stroke.noneSet) {
+ curve->unref();
+ continue;
}
// remember old stroke style, to be set on fill
+ SPStyle *i_style = SP_OBJECT_STYLE(item);
SPCSSAttr *ncss;
{
- SPCSSAttr *ocss = sp_repr_css_attr_inherited(SP_OBJECT_REPR(item), "style");
- gchar const *val = sp_repr_css_property(ocss, "stroke", NULL);
- gchar const *opac = sp_repr_css_property(ocss, "stroke-opacity", NULL);
-
- ncss = sp_repr_css_attr_new();
+ ncss = sp_css_attr_from_style(i_style, SP_STYLE_FLAG_ALWAYS);
+ gchar const *s_val = sp_repr_css_property(ncss, "stroke", NULL);
+ gchar const *s_opac = sp_repr_css_property(ncss, "stroke-opacity", NULL);
sp_repr_css_set_property(ncss, "stroke", "none");
sp_repr_css_set_property(ncss, "stroke-opacity", "1.0");
- sp_repr_css_set_property(ncss, "fill", val);
- if ( opac ) {
- sp_repr_css_set_property(ncss, "fill-opacity", opac);
+ sp_repr_css_set_property(ncss, "fill", s_val);
+ if ( s_opac ) {
+ sp_repr_css_set_property(ncss, "fill-opacity", s_opac);
} else {
sp_repr_css_set_property(ncss, "fill-opacity", "1.0");
}
NR::Matrix const transform(item->transform);
float const scale = NR::expansion(transform);
- gchar *style = g_strdup(SP_OBJECT_REPR(item)->attribute("style"));
- SPStyle *i_style = SP_OBJECT(item)->style;
gchar const *mask = SP_OBJECT_REPR(item)->attribute("mask");
gchar const *clip_path = SP_OBJECT_REPR(item)->attribute("clip-path");
Path *orig = Path_for_item(item, false);
if (orig == NULL) {
- g_free(style);
curve->unref();
continue;
}
// ca a merd\8e, ou bien le resultat est vide
delete res;
delete orig;
- g_free(style);
continue;
}
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
- // restore old style
- repr->setAttribute("style", style);
-
- // set old stroke style on fill
+ // restore old style, but set old stroke style on fill
sp_repr_css_change(repr, ncss, "style");
sp_repr_css_attr_unref(ncss);
delete res;
delete orig;
- g_free(style);
-
}
if (did) {