From 9a1a8cfc1dd26f094a6c2dce291b50ba00fe2e5b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sat, 10 May 2014 12:19:43 +0200 Subject: Style rewrite: 'text-decoration' requires access to style of ancestor element which set property. (bzr r13348) --- src/style-internal.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/style-internal.cpp') 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(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 ) { -- cgit v1.2.3