diff src/styleengine.hh @ 644:9e4ad941cbdc

add wordStyle() method to StyleEngine
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Thu, 04 Dec 2008 18:39:19 +0100
parents eb0279297fde
children ea961706be66
line wrap: on
line diff
--- a/src/styleengine.hh	Thu Dec 04 18:04:14 2008 +0100
+++ b/src/styleengine.hh	Thu Dec 04 18:39:19 2008 +0100
@@ -11,6 +11,7 @@
       class Node : public DoctreeNode {
          public:
             dw::core::style::Style *style;
+            dw::core::style::Style *wordStyle;
             const char *styleAttribute;
             bool inheritBackgroundColor;
       };
@@ -20,6 +21,7 @@
       CssContext *cssContext;
 
       dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL);
+      dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL);
       void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props);
       int computeValue (CssLength value, dw::core::style::Font *font);
 
@@ -56,6 +58,14 @@
          else
             return style0 ();
       };
+      inline dw::core::style::Style *wordStyle () {
+         dw::core::style::Style *s = stack->getRef (stack->size () - 1)->wordStyle;
+         if (s)
+            return s;
+         else
+            return wordStyle0 ();
+      };
+
 };
 
 #endif