summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-05-10 10:32:28 +0000
committertavmjong-free <tavmjong@free.fr>2014-05-10 10:32:28 +0000
commit4302660fe98b575843bde77a0d7ded72920a701c (patch)
treea9ab3c87cfefc21672eb6229ebc3c3d114d67979 /src/style-internal.cpp
parentStyle rewrite: Correct 'text-decoration' CSS2 vs. CSS3 behavior. (diff)
downloadinkscape-4302660fe98b575843bde77a0d7ded72920a701c.tar.gz
inkscape-4302660fe98b575843bde77a0d7ded72920a701c.zip
Style rewrite: 'text-decoration' requires access to style of ancestor element which set property.
(bzr r13341.1.4)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index bfe708e7a..508fb677c 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -2440,6 +2440,11 @@ SPITextDecoration::read( gchar const *str ) {
style->text_decoration_style.set = true;
style->text_decoration_color.set = true;
}
+
+ // If we set text_decoration_line, then update style_td (for CSS2 text-decoration)
+ if( style->text_decoration_line.set == true ) {
+ style_td = style;
+ }
}
// Returns CSS2 'text-decoration' (using settings in SPTextDecorationLine)
@@ -2474,10 +2479,17 @@ SPITextDecoration::write( guint const flags, SPIBase const *const base) const {
return Glib::ustring("");
}
-// Done in SPITextDecorationLine
-// void
-// SPITextDecoration::cascade( const SPIBase* const parent ) {
-// }
+void
+SPITextDecoration::cascade( const SPIBase* const parent ) {
+ if( const SPITextDecoration* p = dynamic_cast<const SPITextDecoration*>(parent) ) {
+ if( style_td == NULL ) {
+ style_td = p->style_td;
+ }
+ } else {
+ std::cerr << "SPITextDecoration::cascade(): Incorrect parent type" << std::endl;
+ }
+
+}
// void
// SPITextDecoration::merge( const SPIBase* const parent ) {