summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-08-24 14:43:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-24 14:43:44 -0700
commit0453edb7474af5b58da81dff91562c32b7fd9d0d (patch)
treea5076f0b42cd31b3c4e07cae63c0c77d02fe87b2 /WebKit
parentc220270aa3f29e2d5fb8bb0ad44296170c3f193f (diff)
parente7a0708886b515f34d0a7e034cdea391681bf7f1 (diff)
downloadexternal_webkit-0453edb7474af5b58da81dff91562c32b7fd9d0d.zip
external_webkit-0453edb7474af5b58da81dff91562c32b7fd9d0d.tar.gz
external_webkit-0453edb7474af5b58da81dff91562c32b7fd9d0d.tar.bz2
am e7a07088: am 21ed5a45: Merge "check for null pictures when selecting text" into gingerbread
Merge commit 'e7a0708886b515f34d0a7e034cdea391681bf7f1' * commit 'e7a0708886b515f34d0a7e034cdea391681bf7f1': check for null pictures when selecting text
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/SelectText.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp
index 3716b03..45d7c0a 100644
--- a/WebKit/android/nav/SelectText.cpp
+++ b/WebKit/android/nav/SelectText.cpp
@@ -1239,12 +1239,15 @@ SelectText::SelectText()
paint.setColor(0xffaaaaaa);
canvas->drawPath(endPath, paint);
m_endControl.endRecording();
+ m_picture = 0;
}
void SelectText::draw(SkCanvas* canvas, LayerAndroid* layer)
{
// FIXME: layer may not own the original selected picture
m_picture = layer->picture();
+ if (!m_picture)
+ return;
DBG_NAV_LOGD("m_extendSelection=%d m_drawPointer=%d", m_extendSelection, m_drawPointer);
if (m_extendSelection)
drawSelectionRegion(canvas);
@@ -1316,6 +1319,8 @@ void SelectText::drawSelectionRegion(SkCanvas* canvas)
void SelectText::extendSelection(const SkPicture* picture, int x, int y)
{
+ if (!picture)
+ return;
SkIRect clipRect = m_visibleRect;
int base;
if (m_startSelection) {
@@ -1365,6 +1370,8 @@ void SelectText::extendSelection(const SkPicture* picture, int x, int y)
const String SelectText::getSelection()
{
+ if (!m_picture)
+ return String();
SkIRect clipRect;
clipRect.set(0, 0, m_picture->width(), m_picture->height());
String result = text(*m_picture, clipRect, m_selStart, m_startBase,
@@ -1424,6 +1431,8 @@ bool SelectText::hitSelection(int x, int y) const
void SelectText::moveSelection(const SkPicture* picture, int x, int y)
{
+ if (!picture)
+ return;
SkIRect clipRect = m_visibleRect;
clipRect.join(m_selStart);
clipRect.join(m_selEnd);