Reviewed by Harrison.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2005 23:47:48 +0000 (23:47 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2005 23:47:48 +0000 (23:47 +0000)
        - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined

        * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm

index ed429db8b2e3d5761ff014678f5190ace50676cf..5c50301f329cac52590f2cf4f8a323092168c5a1 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Harrison.
+
+        - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
+
+        * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
+
 2005-02-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
index 6f8ff047fecc48c58e2674ad1fdbbc3821097d63..fbd826253e281e376c891d8bd2a8bb25c3e86276 100644 (file)
@@ -393,6 +393,7 @@ typedef enum {
 - (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
 - (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
+- (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
 - (void)applyEditingStyleToBodyElement;
 - (void)removeEditingStyleFromBodyElement;
 - (void)applyEditingStyleToElement:(DOMElement *)element;
index 56805901e2f4a48b60af726e0be31215f87c11f8..79f73f330cb7c8548928fcf65af1e069ae21a4ec 100644 (file)
@@ -1783,6 +1783,21 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     return _part->selectionStartHasStyle([style _styleDeclarationImpl]);
 }
 
+- (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style
+{
+    if (!_part)
+        return NSOffState;
+    switch (_part->selectionHasStyle([style _styleDeclarationImpl])) {
+        case KHTMLPart::falseTriState:
+            return NSOffState;
+        case KHTMLPart::trueTriState:
+            return NSOnState;
+        case KHTMLPart::mixedTriState:
+            return NSMixedState;
+    }
+    return NSOffState;
+}
+
 - (void)applyEditingStyleToBodyElement
 {
     if (!_part)