+2004-12-06 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Hyatt.
+
+ - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
+
+ * 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 <hyatt@apple.com>
Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
const float leftMargin = 2;
const float rightMargin = 2;
-@interface KWQListBoxScrollView : WebCoreScrollView
+@interface KWQListBoxScrollView : WebCoreScrollView <KWQWidgetHolder>
+{
+ QListBox *_box;
+}
@end
@interface KWQTableView : NSTableView <KWQWidgetHolder>
{
KWQ_BLOCK_EXCEPTIONS;
- NSScrollView *scrollView = [[KWQListBoxScrollView alloc] init];
+ NSScrollView *scrollView = [[KWQListBoxScrollView alloc] initWithListBox:this];
setView(scrollView);
[scrollView release];
@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];
- (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) {