[Kazehakase-cvs] CVS update: kazehakase/src/mozilla

Back to archive index

Hiroyuki Ikezoe ikezo****@users*****
Tue Dec 5 13:20:18 JST 2006


Index: kazehakase/src/mozilla/kz-mozembed.cpp
diff -u kazehakase/src/mozilla/kz-mozembed.cpp:1.212 kazehakase/src/mozilla/kz-mozembed.cpp:1.213
--- kazehakase/src/mozilla/kz-mozembed.cpp:1.212	Mon Dec  4 11:19:18 2006
+++ kazehakase/src/mozilla/kz-mozembed.cpp	Tue Dec  5 13:20:18 2006
@@ -64,7 +64,7 @@
 #include <nsIDOMNamedNodeMap.h>
 #include <nsIDOMDocumentRange.h>
 #include <nsIDOMDocumentFragment.h>
-#include <nsIDOM3Document.h>
+#include <nsIDOMSerializer.h>
 #include <nsIDOMText.h>
 #include <webbrowserpersist/nsIWebBrowserPersist.h>
 #include <nsIWebBrowserFind.h>
@@ -1032,16 +1032,16 @@
 				gchar *timestamp_file;
 				const gchar *title = kz_moz_embed_get_title(KZ_EMBED(kzembed));
 	
-				nsCOMPtr<nsIDOM3Document> dom3doc = do_QueryInterface(domDoc);
-				dom3doc->GetInputEncoding(value);
-				NS_UTF16ToCString(value,
-						  NS_CSTRING_ENCODING_UTF8, cValue);
-				gchar *encoding = g_strdup(cValue.get());
-
-				priv->wrapper->GetBodyString(value);
-				NS_UTF16ToCString(value,
-						  NS_CSTRING_ENCODING_UTF8, cValue);
-				const gchar *contents = cValue.get();
+				nsCOMPtr<nsIDOMNode> node = do_QueryInterface(domDoc);
+				nsCOMPtr<nsIDOMSerializer> serializer;
+				serializer = do_CreateInstance(NS_XMLSERIALIZER_CONTRACTID, &rv);
+				if (serializer)
+				{
+					serializer->SerializeToString(node, value);
+
+					NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, cValue);
+				}
+				gchar *contents = g_strdup(cValue.get());
 
 				timestamp_file = g_strconcat(g_get_home_dir(),
 							  HISTORY_DIR,
@@ -1064,11 +1064,11 @@
 #if USE_HYPERESTRAIER
 				KzSearch *search = kz_search_new("hyperestraier");
 				if (search)
-					kz_search_register_document(search, filename, encoding, title, contents, last_modified);
+					kz_search_register_document(search, filename, "UTF-8", title, contents, last_modified);
 #elif USE_RAST
 				g_idle_add(rast_update_index, filename);
 #endif
-				g_free(encoding);
+				g_free(contents);
 				g_free(timestamp_file);
 				g_free(time);
 			}


More information about the Kazehakase-cvs mailing list
Back to archive index