summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-04-14 17:04:15 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-04-23 21:37:56 +0000
commit30745770be6b16bed8129c757727fa55313160e0 (patch)
tree159d6da29ea23e0d5443c0149e55196ec884e08a /src
parentAdd transforms fixes (diff)
downloadinkscape-30745770be6b16bed8129c757727fa55313160e0.tar.gz
inkscape-30745770be6b16bed8129c757727fa55313160e0.zip
Revert TAV d work for testing
Diffstat (limited to 'src')
-rw-r--r--src/attributes.cpp5
-rw-r--r--src/attributes.h13
-rw-r--r--src/object/sp-path.h4
-rw-r--r--src/splivarot.cpp15
-rw-r--r--src/style-internal.cpp4
-rw-r--r--src/style.cpp15
-rw-r--r--src/style.h5
7 files changed, 15 insertions, 46 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp
index 7a3916f6d..6522563af 100644
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
@@ -138,6 +138,7 @@ static SPStyleProp const props[] = {
{SP_ATTR_X, "x"},
{SP_ATTR_Y, "y"},
/* SPPath */
+ {SP_ATTR_D, "d"},
{SP_ATTR_INKSCAPE_ORIGINAL_D, "inkscape:original-d"},
/* (Note: XML representation of connectors may change in future.) */
{SP_ATTR_CONNECTOR_TYPE, "inkscape:connector-type"},
@@ -421,9 +422,6 @@ static SPStyleProp const props[] = {
/* CSS & SVG Properites */
- /* SVG 2 Attributes promoted to properties */
- {SP_ATTR_D, "d"},
-
/* Paint */
{SP_PROP_COLOR, "color"},
{SP_PROP_OPACITY, "opacity"},
@@ -554,7 +552,6 @@ static SPStyleProp const props[] = {
/* LivePathEffect */
{SP_PROP_PATH_EFFECT, "effect"},
-
};
#define n_attrs (sizeof(props) / sizeof(props[0]))
diff --git a/src/attributes.h b/src/attributes.h
index cecf2673b..a2c1c30f5 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -20,9 +20,9 @@ unsigned char const *sp_attribute_name(unsigned int id);
/**
* True iff k is a property in SVG, i.e. something that can be written either in a style attribute
- * or as its own XML attribute. This must be kept in sync with SPAttributeEnum.
+ * or as its own XML attribute.
*/
-#define SP_ATTRIBUTE_IS_CSS(k) (((k) >= SP_ATTR_D) && ((k) <= SP_PROP_PATH_EFFECT))
+#define SP_ATTRIBUTE_IS_CSS(k) (((k) >= SP_PROP_INKSCAPE_FONT_SPEC) && ((k) <= SP_PROP_TEXT_RENDERING))
/*
* Do not change order of attributes and properties. Attribute and
@@ -146,7 +146,7 @@ enum SPAttributeEnum {
SP_ATTR_X,
SP_ATTR_Y,
/* SPPath */
- // SP_ATTR_D, Promoted to property in SVG 2
+ SP_ATTR_D,
SP_ATTR_INKSCAPE_ORIGINAL_D,
SP_ATTR_CONNECTOR_TYPE,
SP_ATTR_CONNECTOR_CURVATURE,
@@ -428,12 +428,7 @@ enum SPAttributeEnum {
SP_ATTR_TEXT_EXCLUDE,
SP_ATTR_LAYOUT_OPTIONS,
- /* CSS & SVG Properties KEEP ORDER!
- * If first or last property changed, macro at top must be changed!
- */
-
- /* SVG 2 Attributes promoted to properties */
- SP_ATTR_D,
+ /* CSS & SVG Properties KEEP ORDER */
/* Paint */
SP_PROP_COLOR,
diff --git a/src/object/sp-path.h b/src/object/sp-path.h
index 3402938a1..b950f6a60 100644
--- a/src/object/sp-path.h
+++ b/src/object/sp-path.h
@@ -18,7 +18,6 @@
#include "sp-shape.h"
#include "sp-conn-end-pair.h"
-#include "style-internal.h" // For SPStyleSrc
class SPCurve;
@@ -48,8 +47,7 @@ public:
virtual char* description() const;
virtual Geom::Affine set_transform(Geom::Affine const &transform);
virtual void convert_to_guides() const;
-private:
- SPStyleSrc d_source; // Source of 'd' value, saved for output.
+
};
#endif // SEEN_SP_PATH_H
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index d8c5d929f..6974e6668 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -1213,13 +1213,9 @@ sp_item_path_outline(SPItem *item, SPDesktop *desktop, bool legacy)
gchar const *opacity;
gchar const *filter;
- // Copying stroke style to fill will fail for properties not defined by style attribute
- // (i.e., properties defined in style sheet or by attributes).
-
- // Stroke
SPCSSAttr *ncss = 0;
{
- ncss = sp_css_attr_from_style(i_style, SP_STYLE_FLAG_ALWAYS | SP_STYLE_FLAG_IFSRC);
+ 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);
opacity = sp_repr_css_property(ncss, "opacity", NULL);
@@ -1238,11 +1234,10 @@ sp_item_path_outline(SPItem *item, SPDesktop *desktop, bool legacy)
sp_repr_css_unset_property(ncss, "marker-mid");
sp_repr_css_unset_property(ncss, "marker-end");
}
-
- // Fill
+ //fill
SPCSSAttr *ncsf = 0;
{
- ncsf = sp_css_attr_from_style(i_style, SP_STYLE_FLAG_ALWAYS | SP_STYLE_FLAG_IFSRC);
+ ncsf = sp_css_attr_from_style(i_style, SP_STYLE_FLAG_ALWAYS);
sp_repr_css_set_property(ncsf, "stroke", "none");
sp_repr_css_set_property(ncsf, "stroke-opacity", "1.0");
sp_repr_css_set_property(ncsf, "filter", NULL);
@@ -1339,6 +1334,7 @@ sp_item_path_outline(SPItem *item, SPDesktop *desktop, bool legacy)
delete theRes;
} else {
+
orig->Outline(res, 0.5 * o_width, o_join, o_butt, 0.5 * o_miter);
orig->Coalesce(0.5 * o_width);
@@ -1527,7 +1523,6 @@ sp_item_path_outline(SPItem *item, SPDesktop *desktop, bool legacy)
markers->setAttribute("clip-path", clip_path);
}
}
-
gchar const *paint_order = sp_repr_css_property(ncss, "paint-order", NULL);
SPIPaintOrder temp;
temp.read( paint_order );
@@ -1630,12 +1625,10 @@ sp_item_path_outline(SPItem *item, SPDesktop *desktop, bool legacy)
} else if(did) {
out = g_repr;
}
-
SPCSSAttr *r_style = sp_repr_css_attr_new();
sp_repr_css_set_property(r_style, "opacity", opacity);
sp_repr_css_set_property(r_style, "filter", filter);
sp_repr_css_change(out, r_style, "style");
-
sp_repr_css_attr_unref(r_style);
if (unique) {
parent->appendChild(out);
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index f8f2042c4..95a0b5fc9 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -59,7 +59,7 @@ using Inkscape::CSSOStringStream;
inline bool should_write( guint const flags, bool set, bool dfp, bool src) {
bool should_write = false;
- if ( ((flags & SP_STYLE_FLAG_ALWAYS) && src) ||
+ if ( ((flags & SP_STYLE_FLAG_ALWAYS)) ||
((flags & SP_STYLE_FLAG_IFSET) && set && src) ||
((flags & SP_STYLE_FLAG_IFDIFF) && set && src && dfp)) {
should_write = true;
@@ -799,12 +799,14 @@ void
SPIEnumBits::read( gchar const *str ) {
if( !str ) return;
+ std::cout << "SPIEnumBits: " << name << ": " << str << std::endl;
if( !strcmp(str, "inherit") ) {
set = true;
inherit = true;
} else {
for (unsigned i = 0; enums[i].key; i++) {
if (!strcmp(str, enums[i].key)) {
+ std::cout << " found: " << enums[i].key << std::endl;
set = true;
inherit = false;
value += enums[i].value;
diff --git a/src/style.cpp b/src/style.cpp
index e05c2ae97..a3adeb1e2 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -97,10 +97,6 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// font-family
// font-specification
-
- // SVG 2 attributes promoted to properties. (When geometry properties are added, move after font.)
- d( "d" ), // SPIString Not inherited!
-
// Font related properties and 'font' shorthand
font_style( "font-style", enum_font_style, SP_CSS_FONT_STYLE_NORMAL ),
font_variant( "font-variant", enum_font_variant, SP_CSS_FONT_VARIANT_NORMAL ),
@@ -286,9 +282,6 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// This might be too resource hungary... but for now it possible to loop over properties
- // SVG 2: Attributes promoted to properties
- _properties.push_back( &d );
-
// 'color' must be before 'fill', 'stroke', 'text-decoration-color', ...
_properties.push_back( &color );
@@ -709,9 +702,6 @@ SPStyle::readIfUnset( gint id, gchar const *val, SPStyleSrc const &source ) {
g_return_if_fail(val != NULL);
switch (id) {
- case SP_ATTR_D:
- d.readIfUnset( val, source );
- break;
case SP_PROP_INKSCAPE_FONT_SPEC:
font_specification.readIfUnset( val, source );
break;
@@ -1792,14 +1782,13 @@ sp_style_unset_property_attrs(SPObject *o)
/**
* \pre style != NULL.
* \pre flags in {IFSET, ALWAYS}.
- * Only used by sp_css_attr_from_object() and in splivarot.cpp - sp_item_path_outline().
*/
SPCSSAttr *
sp_css_attr_from_style(SPStyle const *const style, guint const flags)
{
g_return_val_if_fail(style != NULL, NULL);
- g_return_val_if_fail(((flags & SP_STYLE_FLAG_IFSET) ||
- (flags & SP_STYLE_FLAG_ALWAYS)),
+ g_return_val_if_fail(((flags == SP_STYLE_FLAG_IFSET) ||
+ (flags == SP_STYLE_FLAG_ALWAYS) ),
NULL);
Glib::ustring style_str = style->write(flags);
SPCSSAttr *css = sp_repr_css_attr_new();
diff --git a/src/style.h b/src/style.h
index 2556ba2b1..1b6ee2f47 100644
--- a/src/style.h
+++ b/src/style.h
@@ -91,11 +91,6 @@ public:
/* ----------------------- THE PROPERTIES ------------------------- */
/* Match order in style.cpp. */
- /* SVG 2 attributes promoted to properties. */
-
- /** Path data */
- SPIString d;
-
/* Font ---------------------------- */
/** Font style */