OSDN Git Service

AI 143189: am: CL 142939 Fix for issue 1730904: Find in page only searches the first...
authorLeon Scroggins <>
Sat, 28 Mar 2009 00:06:39 +0000 (17:06 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Sat, 28 Mar 2009 00:06:39 +0000 (17:06 -0700)
  Original author: scroggo
  Merged from: //branches/cupcake/...

Automated import of CL 143189

WebKit/android/nav/WebView.cpp

index 8b6dd5a..0657a81 100644 (file)
@@ -2135,9 +2135,11 @@ static int nativeFindAll(JNIEnv *env, jobject obj, jstring findLower,
         checkException(env);
         return 0;
     }
-
+    static const int MAX_16_BIT_INT = 65535;
     int width = root->documentWidth();
+    if (width > MAX_16_BIT_INT) width = MAX_16_BIT_INT;
     int height = root->documentHeight();
+    if (height > MAX_16_BIT_INT) height = MAX_16_BIT_INT;
     // Create a FindCanvas, which allows us to fake draw into it so we can
     // figure out where our search string is rendered (and how many times).
     FindCanvas canvas(width, height, (const UChar*) findLowerChars,