Commit bd6a1fde authored by darin's avatar darin

WebCore:

	- fixed most of the problems with OPTGROUP

        * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
	Make OPTGROUPs pop out of other unclosed OPTGROUPs, not just out of options.

        * kwq/KWQListBox.h: Add private member function.
        * kwq/KWQListBox.mm:
        (QListBox::insertItem): Use shared insertItem function.
        (QListBox::insertGroupLabel): Create an attributed string for the group label,
	with bold font.
        (-[KWQListBoxTableViewDelegate tableView:shouldSelectRow:]): Return YES only
	for the plain strings, that way you can't select the group labels.

        * WebCore.pbproj/project.pbxproj: Let PB do its thing.

WebBrowser:

        * BrowserDocument.h: Remove unused BrowserDocumentPageTitleChangedNotification.
        * BrowserDocument.m:
        (-[BrowserDocument _pageTitleHasChanged]): Remove unused notification.
        (-[BrowserDocument goToBugReportingPage:]): Escape URL so it works in the form parameters.

        * PoofAnimator.m: (-[PoofAnimator init]): Remove use of private _setHasShadow:
	which is just the same thing as the public setHasShadow:.

        * BrowserWindowController.m: Tweak formatting.
        * Preferences.subproj/GeneralPreferences.m: Tweak.

        * WebBrowser.pbproj/project.pbxproj: Let PB do its thing.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7a17f0c4
2002-11-14 Darin Adler <darin@apple.com>
- fixed most of the problems with OPTGROUP
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
Make OPTGROUPs pop out of other unclosed OPTGROUPs, not just out of options.
* kwq/KWQListBox.h: Add private member function.
* kwq/KWQListBox.mm:
(QListBox::insertItem): Use shared insertItem function.
(QListBox::insertGroupLabel): Create an attributed string for the group label,
with bold font.
(-[KWQListBoxTableViewDelegate tableView:shouldSelectRow:]): Return YES only
for the plain strings, that way you can't select the group labels.
* WebCore.pbproj/project.pbxproj: Let PB do its thing.
2002-11-14 David Hyatt <hyatt@apple.com>
Fix spinner.com mislayout on the PLT. Make sure
......
2002-11-14 Darin Adler <darin@apple.com>
- fixed most of the problems with OPTGROUP
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
Make OPTGROUPs pop out of other unclosed OPTGROUPs, not just out of options.
* kwq/KWQListBox.h: Add private member function.
* kwq/KWQListBox.mm:
(QListBox::insertItem): Use shared insertItem function.
(QListBox::insertGroupLabel): Create an attributed string for the group label,
with bold font.
(-[KWQListBoxTableViewDelegate tableView:shouldSelectRow:]): Return YES only
for the plain strings, that way you can't select the group labels.
* WebCore.pbproj/project.pbxproj: Let PB do its thing.
2002-11-14 David Hyatt <hyatt@apple.com>
Fix spinner.com mislayout on the PLT. Make sure
......
2002-11-14 Darin Adler <darin@apple.com>
- fixed most of the problems with OPTGROUP
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
Make OPTGROUPs pop out of other unclosed OPTGROUPs, not just out of options.
* kwq/KWQListBox.h: Add private member function.
* kwq/KWQListBox.mm:
(QListBox::insertItem): Use shared insertItem function.
(QListBox::insertGroupLabel): Create an attributed string for the group label,
with bold font.
(-[KWQListBoxTableViewDelegate tableView:shouldSelectRow:]): Return YES only
for the plain strings, that way you can't select the group labels.
* WebCore.pbproj/project.pbxproj: Let PB do its thing.
2002-11-14 David Hyatt <hyatt@apple.com>
Fix spinner.com mislayout on the PLT. Make sure
......
......@@ -72,7 +72,6 @@
F58C8A07025BD3BC018635CA,
F531DDEC02F0C34D018635CA,
);
hasScannedForEncodings = 1;
isa = PBXProject;
knownRegions = (
English,
......
......@@ -703,9 +703,10 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
}
break;
case ID_OPTION:
case ID_OPTGROUP:
if (id == ID_OPTGROUP)
{
popBlock(ID_OPTION);
popBlock(current->id());
handled = true;
}
else if(id == ID_SELECT)
......
......@@ -34,8 +34,10 @@ class QListBoxItem;
#ifdef __OBJC__
@class NSMutableArray;
@class NSObject;
#else
class NSMutableArray;
class NSObject;
#endif
class QListBox : public QScrollView {
......@@ -63,6 +65,8 @@ public:
void selectionChanged() { _selectionChanged.call(); }
private:
void insertItem(NSObject *, unsigned index);
NSMutableArray *_items;
bool _insertingItems;
mutable float _width;
......
......@@ -117,14 +117,13 @@ void QListBox::setSelectionMode(SelectionMode mode)
[tableView setAllowsMultipleSelection:mode != Single];
}
void QListBox::insertItem(const QString &text, unsigned index)
void QListBox::insertItem(NSObject *o, unsigned index)
{
unsigned c = count();
NSString *s = text.getNSString();
if (index >= c) {
[_items addObject:s];
[_items addObject:o];
} else {
[_items replaceObjectAtIndex:index withObject:s];
[_items replaceObjectAtIndex:index withObject:o];
}
if (!_insertingItems) {
......@@ -134,11 +133,23 @@ void QListBox::insertItem(const QString &text, unsigned index)
_widthGood = NO;
}
void QListBox::insertItem(const QString &text, unsigned index)
{
insertItem(text.getNSString(), index);
}
void QListBox::insertGroupLabel(const QString &text, unsigned index)
{
// FIXME: This should be a non-selectable item, I think.
// Not sure how to do this in HTML.
insertItem(text, index);
static NSDictionary *groupLabelAttributes;
if (groupLabelAttributes == nil) {
groupLabelAttributes = [[NSDictionary dictionaryWithObject:
[NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName] retain];
}
NSAttributedString *s = [[NSAttributedString alloc]
initWithString:text.getNSString() attributes:groupLabelAttributes];
insertItem(s, index);
[s release];
}
void QListBox::beginBatchInsert()
......@@ -244,4 +255,9 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
_box->clicked();
}
- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(int)row
{
return [[_items objectAtIndex:row] isKindOfClass:[NSString class]];
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment