{
litehtml::tstring url;
make_url(src, baseurl, url);
- if(m_images.find(url.c_str()) == m_images.end())
+ bool found = false;
+
+ for (auto ii = m_images.cbegin(); ii != m_images.cend(); ++ii) {
+ const image *i = &(*ii);
+
+ if (!strcmp(i->first.c_str(), url.c_str())) {
+ found = true;
+ break;
+ }
+ }
+
+ if(!found)
{
try
{
GdkPixbuf *img = get_image(url.c_str(), true);
if(img)
{
- m_images[url.c_str()] = img;
+ m_images.push_back(std::make_pair(url, img));
}
} catch(...)
{
{
litehtml::tstring url;
make_url(src, baseurl, url);
+ bool found = false;
+ const image *img = NULL;
- images_map::iterator img = m_images.find(url.c_str());
- if(img != m_images.end())
+ for (auto ii = m_images.cbegin(); ii != m_images.cend(); ++ii) {
+ const image *i = &(*ii);
+ if (i->first == url) {
+ img = i;
+ found = true;
+ break;
+ }
+ }
+
+ if(img != NULL)
{
sz.width = gdk_pixbuf_get_width(img->second);
sz.height = gdk_pixbuf_get_height(img->second);
make_url(bg.image.c_str(), bg.baseurl.c_str(), url);
//lock_images_cache();
- images_map::iterator img_i = m_images.find(url.c_str());
- if(img_i != m_images.end() && img_i->second)
+ bool found = false;
+ const image *img_i = NULL;
+
+ for (auto ii = m_images.cbegin(); ii != m_images.cend(); ++ii) {
+ const image *i = &(*ii);
+ if (i->first == url) {
+ img_i = i;
+ found = true;
+ break;
+ }
+ }
+
+ if(img_i != NULL && img_i->second)
{
GdkPixbuf *bgbmp = img_i->second;
#pragma once
#include <vector>
+#include <list>
#include <string>
#include <cairo.h>
class container_linux : public litehtml::document_container
{
- typedef std::map<litehtml::tstring, GdkPixbuf* > images_map;
+ typedef std::pair<litehtml::tstring, GdkPixbuf*> image;
+ typedef std::list<image> images_map;
protected:
cairo_surface_t* m_temp_surface;