From: mjs Date: Tue, 7 Dec 2004 02:26:24 +0000 (+0000) Subject: Reviewed by Hyatt. X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=9341560419796124012283d5069420a198ad8200 Reviewed by Hyatt. - fixed assertion failure in QWidget::beforeMouseDown clicking on + + * kwq/KWQListBox.mm: + (QListBox::QListBox): Initialize KWQListBoxScrollView with this. + (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder. + (-[KWQListBoxScrollView widget]): See above. + (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and + afterMouseDown, to avoid triggering an assertion failure. + 2004-12-06 David Hyatt Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm index 17277deb5be0..e27a7105a045 100644 --- a/WebCore/kwq/KWQListBox.mm +++ b/WebCore/kwq/KWQListBox.mm @@ -44,7 +44,10 @@ const float bottomMargin = 1; const float leftMargin = 2; const float rightMargin = 2; -@interface KWQListBoxScrollView : WebCoreScrollView +@interface KWQListBoxScrollView : WebCoreScrollView +{ + QListBox *_box; +} @end @interface KWQTableView : NSTableView @@ -124,7 +127,7 @@ QListBox::QListBox(QWidget *parent) { KWQ_BLOCK_EXCEPTIONS; - NSScrollView *scrollView = [[KWQListBoxScrollView alloc] init]; + NSScrollView *scrollView = [[KWQListBoxScrollView alloc] initWithListBox:this]; setView(scrollView); [scrollView release]; @@ -348,6 +351,20 @@ void QListBox::clearCachedTextRenderers() @implementation KWQListBoxScrollView +- (id)initWithListBox:(QListBox *)b +{ + if (!(self = [super init])) + return nil; + + _box = b; + return self; +} + +- (QWidget *)widget +{ + return _box; +} + - (void)setFrameSize:(NSSize)size { [super setFrameSize:size]; @@ -404,9 +421,11 @@ void QListBox::clearCachedTextRenderers() - (void)mouseDown:(NSEvent *)event { processingMouseEvent = YES; - QWidget::beforeMouseDown(self); + NSView *outerView = [_box->getOuterView() retain]; + QWidget::beforeMouseDown(outerView); [super mouseDown:event]; - QWidget::afterMouseDown(self); + QWidget::afterMouseDown(outerView); + [outerView release]; processingMouseEvent = NO; if (clickedDuringMouseEvent) {