зеркало из https://github.com/mozilla/pjs.git
Don't cache the result of GetPointFromOffset if it failed, since subsequent queries for that offset will return the bogus offset. bug 334608, r+sr=roc
This commit is contained in:
Родитель
12866c8834
Коммит
a4650e1989
|
@ -1,4 +1,5 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 sw=2 et tw=78: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
|
@ -5065,9 +5066,10 @@ nsTypedSelection::GetCachedFrameOffset(nsIFrame *aFrame, PRInt32 inOffset, nsPoi
|
|||
}
|
||||
else
|
||||
{
|
||||
// recalculate frame offset and cache it
|
||||
GetPointFromOffset(aFrame, inOffset, &aPoint);
|
||||
if (mCachedOffsetForFrame->mCanCacheFrameOffset) {
|
||||
// Recalculate frame offset and cache it. Don't cache a frame offset if
|
||||
// GetPointFromOffset fails, though.
|
||||
nsresult rv = GetPointFromOffset(aFrame, inOffset, &aPoint);
|
||||
if (NS_SUCCEEDED(rv) && mCachedOffsetForFrame->mCanCacheFrameOffset) {
|
||||
mCachedOffsetForFrame->mCachedFrameOffset = aPoint;
|
||||
mCachedOffsetForFrame->mLastCaretFrame = aFrame;
|
||||
mCachedOffsetForFrame->mLastContentOffset = inOffset;
|
||||
|
|
Загрузка…
Ссылка в новой задаче