On Mon, Jan 31, 2005 at 01:00:13PM -0500, mental@...3... wrote:
The quick and dirty fix for this particular case would be to rename the SPCSSRepr class in repr-css.cpp, then turn the forward declaration of SPCSSRepr in repr.h into a typedef SPRepr, so SPCSSRepr and SPRepr are the same type. At that point, the sp_repr_css_* functions end up taking SPRepr *s directly, so there wouldn't be any address fixup issues.
[ the somewhat more correct fix would be to set up SPCSSRepr the same way as has been done for SPReprDoc, with its own public abstract class that derives from SPRepr, and a non-public implementation class that derives from both SimpleNode and the abstract class ]
I found SPCSSAttr, but it doesn't seem to have anything in common with SPRepr. Am I blind? (repr-css.cpp) It's an Inkscape::XML::SimpleNode, which does have an attributeList. Maybe this is just the wrong cast?
This, however, isn't working:
if (dynamic_cast<Inkscape::XML::SimpleNode *>(css)->attributeList() == NULL)
desktop-style.cpp: In function `SPCSSAttr* sp_desktop_get_style(SPDesktop*, bool)': desktop-style.cpp:167: error: cannot dynamic_cast `css' (of type `struct SPCSSAttr*') to type `class Inkscape::XML::SimpleNode*' (source is a pointer to incomplete type)
What can I try next?