[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:27:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a22693513b03b70c53dad350092fffcaf3e69e97
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 29 19:35:40 2002 +0000

            Fixed 3009085.  Implemented takeFindStringFromSelection: on WebHTMLView and WebTextView.
            Also added user interface item validation for that method.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView hasSelection]):
            (-[WebHTMLView takeFindStringFromSelection:]):
            (-[WebHTMLView validateUserInterfaceItem:]):
            * WebView.subproj/WebTextView.m:
            (-[WebTextView canTakeFindStringFromSelection]):
            (-[WebTextView takeFindStringFromSelection:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index aaf21a0..62d6fa1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2002-07-29  Richard Williamson  <rjw at apple.com>
+
+        Fixed 3009085.  Implemented takeFindStringFromSelection: on WebHTMLView and WebTextView.
+        Also added user interface item validation for that method.
+        
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView hasSelection]):
+        (-[WebHTMLView takeFindStringFromSelection:]):
+        (-[WebHTMLView validateUserInterfaceItem:]):
+        * WebView.subproj/WebTextView.m:
+        (-[WebTextView canTakeFindStringFromSelection]):
+        (-[WebTextView takeFindStringFromSelection:]):
+
 2002-07-29  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index aaf21a0..62d6fa1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,16 @@
+2002-07-29  Richard Williamson  <rjw at apple.com>
+
+        Fixed 3009085.  Implemented takeFindStringFromSelection: on WebHTMLView and WebTextView.
+        Also added user interface item validation for that method.
+        
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView hasSelection]):
+        (-[WebHTMLView takeFindStringFromSelection:]):
+        (-[WebHTMLView validateUserInterfaceItem:]):
+        * WebView.subproj/WebTextView.m:
+        (-[WebTextView canTakeFindStringFromSelection]):
+        (-[WebTextView takeFindStringFromSelection:]):
+
 2002-07-29  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed:
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index bcb9ca5..949b7c7 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -44,16 +44,29 @@
     return self;
 }
 
-- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item 
+- (BOOL)hasSelection
 {
-    SEL action = [item action];
-    if (action == @selector(copy:)) {
-        return [[[self _bridge] selectedText] length] != 0;
-    }
-    return YES;
+    return [[[self _bridge] selectedText] length] != 0;
 }
 
 
+
+- (IBAction)takeFindStringFromSelection:(id)sender
+{
+    NSPasteboard *findPasteboard;
+
+    if (![self hasSelection]) {
+        NSBeep();
+        return;
+    }
+    
+    // Note: can't use writeSelectionToPasteboard:type: here, though it seems equivalent, because
+    // it doesn't declare the types to the pasteboard and thus doesn't bump the change count
+    findPasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
+    [findPasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
+    [findPasteboard setString:[[self _bridge] selectedText] forType:NSStringPboardType];
+}
+
 - (void)copy:(id)sender
 {
     WebBridge *bridge = [self _bridge];
@@ -71,6 +84,19 @@
 }
 
 
+- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item 
+{
+    SEL action = [item action];
+    
+    if (action == @selector(copy:))
+        return [self hasSelection];
+    else if (action == @selector(takeFindStringFromSelection:))
+        return [self hasSelection];
+    
+    return YES;
+}
+
+
 - (void)dealloc 
 {
     [self _reset];
@@ -478,4 +504,5 @@
     return [NSArray arrayWithObject:filename];
 }
 
+
 @end
diff --git a/WebKit/WebView.subproj/WebTextView.m b/WebKit/WebView.subproj/WebTextView.m
index 3cc9629..76e8a2c 100644
--- a/WebKit/WebView.subproj/WebTextView.m
+++ b/WebKit/WebView.subproj/WebTextView.m
@@ -167,4 +167,24 @@
     }
 }
 
+- (BOOL)canTakeFindStringFromSelection
+{
+    return [self isSelectable] && [self selectedRange].length && ![self hasMarkedText];
+}
+
+
+- (IBAction)takeFindStringFromSelection:(id)sender
+{
+    if (![self canTakeFindStringFromSelection]) {
+        NSBeep();
+        return;
+    }
+    
+    // Note: can't use writeSelectionToPasteboard:type: here, though it seems equivalent, because
+    // it doesn't declare the types to the pasteboard and thus doesn't bump the change count
+    [self writeSelectionToPasteboard:[NSPasteboard pasteboardWithName:NSFindPboard]
+                               types:[NSArray arrayWithObject:NSStringPboardType]];
+}
+
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list