[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
philn at webkit.org
philn at webkit.org
Tue Jan 5 23:53:37 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit a1eadf5ea9596277e011d35120d9b24b1a60417e
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 18 14:01:19 2009 +0000
2009-12-18 Philippe Normand <pnormand at igalia.com>
Reviewed by Xan Lopez.
[GTK] segfault during controls initialization if not GTK theme is present.
https://bugs.webkit.org/show_bug.cgi?id=32705
Create empty images for the controls if no GTK theme is set.
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::getThemeIconFileName):
(WebCore::loadImageFromFile):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7df8a9f..abf2c23 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-18 Philippe Normand <pnormand at igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] segfault during controls initialization if not GTK theme is present.
+ https://bugs.webkit.org/show_bug.cgi?id=32705
+
+ Create empty images for the controls if no GTK theme is set.
+
+ * platform/graphics/gtk/ImageGtk.cpp:
+ (WebCore::getThemeIconFileName):
+ (WebCore::loadImageFromFile):
+
2009-12-18 Alejandro G. Castro <alex at igalia.com>
Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/gtk/ImageGtk.cpp b/WebCore/platform/graphics/gtk/ImageGtk.cpp
index 6263579..c62d988 100644
--- a/WebCore/platform/graphics/gtk/ImageGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageGtk.cpp
@@ -48,13 +48,19 @@ static CString getThemeIconFileName(const char* name, int size)
{
GtkIconInfo* iconInfo = gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(),
name, size, GTK_ICON_LOOKUP_NO_SVG);
+ // Try to fallback on MISSING_IMAGE.
if (!iconInfo)
iconInfo = gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(),
GTK_STOCK_MISSING_IMAGE, size,
GTK_ICON_LOOKUP_NO_SVG);
+ if (iconInfo) {
+ GOwnPtr<GtkIconInfo> info(iconInfo);
+ return CString(gtk_icon_info_get_filename(info.get()));
+ }
- GOwnPtr<GtkIconInfo> info(iconInfo);
- return CString(gtk_icon_info_get_filename(info.get()));
+ // No icon was found, this can happen if not GTK theme is set. In
+ // that case an empty Image will be created.
+ return CString();
}
static PassRefPtr<SharedBuffer> loadResourceSharedBuffer(CString name)
@@ -78,8 +84,10 @@ void BitmapImage::invalidatePlatformData()
PassRefPtr<Image> loadImageFromFile(CString fileName)
{
RefPtr<BitmapImage> img = BitmapImage::create();
- RefPtr<SharedBuffer> buffer = loadResourceSharedBuffer(fileName);
- img->setData(buffer.release(), true);
+ if (!fileName.isNull()) {
+ RefPtr<SharedBuffer> buffer = loadResourceSharedBuffer(fileName);
+ img->setData(buffer.release(), true);
+ }
return img.release();
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list