[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:29:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit ae97cf607e8d2aaddeb169762c8efac107b6ffee
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Mar 13 01:04:54 2004 +0000
Reviewed by Ken.
- fixed <rdar://problem/3433887>: copied characters remain non-breaking spaces; other browsers give normal spaces
* WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]):
Convert non-breaking spaces to the normal kind in the plain text part of the pasteboard.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 137215c..2279e43 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-12 Darin Adler <darin at apple.com>
+
+ Reviewed by Ken.
+
+ - fixed <rdar://problem/3433887>: copied characters remain non-breaking spaces; other browsers give normal spaces
+
+ * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]):
+ Convert non-breaking spaces to the normal kind in the plain text part of the pasteboard.
+
2004-03-12 Ken Kocienda <kocienda at apple.com>
Reviewed by Chris
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 3c0f503..c389bcf 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -548,7 +548,14 @@ static WebHTMLView *lastHitView = nil;
[pasteboard setData:attributedData forType:NSRTFDPboardType];
// Put plain string on the pasteboard.
- [pasteboard setString:[self selectedString] forType:NSStringPboardType];
+ // Map to a plain old space because this is better for source code, other browsers do it,
+ // and because HTML forces you to do this any time you want two spaces in a row.
+ NSMutableString *s = [[self selectedString] mutableCopy];
+ const unichar NonBreakingSpaceCharacter = 0xA0;
+ NSString *NonBreakingSpaceString = [NSString stringWithCharacters:&NonBreakingSpaceCharacter length:1];
+ [s replaceOccurrencesOfString:NonBreakingSpaceString withString:@" " options:0 range:NSMakeRange(0, [s length])];
+ [pasteboard setString:s forType:NSStringPboardType];
+ [s release];
}
- (BOOL)_haveSelection
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list