comparison src/styleengine.hh @ 693:478dfc078e12

make StyleEngine::computeValue() and computeLength() return bool StyleEngine::computeValue now returns whether the value was actually set. This information is now used in computeLength to avoid setting of random length values in case of an unrecognized CSS_LENGTH_TYPE. This fixes crashes with images that have invalid width or height attributes (e.g. <img src="foo.jpg" width="10px" />).
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 19 Dec 2008 18:32:16 +0100
parents 14ce954d98c0
children dac3e759df92
comparison
equal deleted inserted replaced
692:920b9f4cabf3 693:478dfc078e12
21 CssContext *cssContext; 21 CssContext *cssContext;
22 22
23 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); 23 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL);
24 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL); 24 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL);
25 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); 25 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props);
26 void computeValue (int *dest, CssLength value, dw::core::style::Font *font); 26 bool computeValue (int *dest, CssLength value, dw::core::style::Font *font);
27 void computeValue (int *dest, CssLength value, dw::core::style::Font *font, 27 bool computeValue (int *dest, CssLength value, dw::core::style::Font *font,
28 int percentageBase); 28 int percentageBase);
29 void computeLength (dw::core::style::Length *dest, CssLength value, dw::core::style::Font *font); 29 bool computeLength (dw::core::style::Length *dest, CssLength value, dw::core::style::Font *font);
30 30
31 public: 31 public:
32 StyleEngine (dw::core::Layout *layout); 32 StyleEngine (dw::core::Layout *layout);
33 ~StyleEngine (); 33 ~StyleEngine ();
34 34