summaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-09-10 21:00:58 +0200
committerSebastian Geerken <devnull@localhost>2013-09-10 21:00:58 +0200
commit06f5833b8f41196bc427c06e39ed21d431c1e665 (patch)
tree17654b3a7449ffdcfae9916fc211d5750789dfad /src/form.cc
parent6acc9e9c711bad1f9d0125d884b9993ed1c4789e (diff)
Some refactoring: the image decoding code now only accesses dw::core::ImgRenderer, not dw::Image (which now implements the former) anymore.
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/form.cc b/src/form.cc
index f756a1c9..7c747c5a 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -2004,10 +2004,14 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
/* create new image and add it to the button */
a_Html_image_attrs(html, tag, tagsize);
if ((Image = a_Html_image_new(html, tag, tagsize))) {
- IM2DW(Image)->setStyle (html->styleEngine->backgroundStyle ());
+ // At this point, we know that Image->ir represents an image
+ // widget. Notice that the order of the casts matters, because
+ // of multiple inheritance.
+ dw::Image *dwi = (dw::Image*)(dw::core::ImgRenderer*)Image->img_rnd;
+ dwi->setStyle (html->styleEngine->backgroundStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
ComplexButtonResource *complex_b_r =
- factory->createComplexButtonResource(IM2DW(Image), false);
+ factory->createComplexButtonResource(dwi, false);
button = new Embed(complex_b_r);
HT2TB(html)->addWidget (button, html->styleEngine->style ());
}