diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2017-10-13 11:05:06 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2017-10-13 11:05:06 +0000 |
| commit | 4cc0e04066adecf85955a9d6be972a4ba4d83f8b (patch) | |
| tree | 4ece71cb0de254f5b214bac6c9d6285ae763fcfe /src/style.cpp | |
| parent | Migrate style-test to GTest. (diff) | |
| download | inkscape-4cc0e04066adecf85955a9d6be972a4ba4d83f8b.tar.gz inkscape-4cc0e04066adecf85955a9d6be972a4ba4d83f8b.zip | |
Implement !important rule handling for inline-style. Work from Jabier.
Added "!important" rule tests to style-test.cpp.
Diffstat (limited to 'src/style.cpp')
| -rw-r--r-- | src/style.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/style.cpp b/src/style.cpp index 36d669301..d5bbcd9ce 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1153,9 +1153,16 @@ SPStyle::_mergeDecl( CRDeclaration const *const decl, SPStyleSrc const &source * convert to string. Alternatively, set from CRTerm directly rather * than converting to string. */ + guchar *const str_value_unsigned = cr_term_to_string(decl->value); gchar *const str_value = reinterpret_cast<gchar *>(str_value_unsigned); - readIfUnset( prop_idx, str_value, source ); + + // Add "!important" rule if necessary as this is not handled by cr_term_to_string(). + gchar const * important = decl->important ? " !important" : ""; + Inkscape::CSSOStringStream os; + os << str_value << important; + + readIfUnset( prop_idx, os.str().c_str(), source ); g_free(str_value); } } |
