epiphany r8594 - branches/gnome-2-24/embed/mozilla



Author: chpe
Date: Mon Oct 20 22:03:28 2008
New Revision: 8594
URL: http://svn.gnome.org/viewvc/epiphany?rev=8594&view=rev

Log:
Try to fix crash on zoom change. Bug #525357, patch by Mike Hommey.

Modified:
   branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp
   branches/gnome-2-24/embed/mozilla/EphyBrowser.h

Modified: branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp
==============================================================================
--- branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp	(original)
+++ branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp	Mon Oct 20 22:03:28 2008
@@ -830,6 +830,7 @@
 #endif
 , mContextMenuListener(nsnull)
 , mInitialized(PR_FALSE)
+, mZoom(0.0)
 {
 	LOG ("EphyBrowser ctor (%p)", this);
 }
@@ -1192,7 +1193,9 @@
 	nsCOMPtr<nsIMarkupDocumentViewer> mdv = do_QueryInterface(contentViewer);
 	NS_ENSURE_TRUE (mdv, NS_ERROR_FAILURE);
 
-	return mdv->SetTextZoom (aZoom);
+	nsresult rv = mdv->SetTextZoom (aZoom);
+	mZoom = aZoom;
+	return rv;
 }
 
 nsresult EphyBrowser::GetContentViewer (nsIContentViewer **aViewer)
@@ -1207,6 +1210,10 @@
 
 nsresult EphyBrowser::GetZoom (float *aZoom)
 {
+	if (mZoom != 0) {
+		*aZoom = mZoom;
+		return NS_OK;
+	}
 	NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE);
 
 	nsCOMPtr<nsIContentViewer> contentViewer;	
@@ -1216,7 +1223,9 @@
 	nsCOMPtr<nsIMarkupDocumentViewer> mdv = do_QueryInterface(contentViewer);
 	NS_ENSURE_TRUE (mdv, NS_ERROR_FAILURE);
 
-	return mdv->GetTextZoom (aZoom);
+	nsresult rv = mdv->GetTextZoom (aZoom);
+	mZoom = *aZoom;
+	return rv;
 }
 
 nsresult

Modified: branches/gnome-2-24/embed/mozilla/EphyBrowser.h
==============================================================================
--- branches/gnome-2-24/embed/mozilla/EphyBrowser.h	(original)
+++ branches/gnome-2-24/embed/mozilla/EphyBrowser.h	Mon Oct 20 22:03:28 2008
@@ -208,6 +208,7 @@
 	nsCOMPtr<nsIWebBrowser> mWebBrowser;
 private:
 	GtkWidget *mEmbed;
+	float mZoom;
 
 	nsCOMPtr<nsIWebBrowserFocus> mWebBrowserFocus;
 	nsCOMPtr<nsIDOMDocument> mTargetDocument;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]