OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 WebKit::WebClipboard::Buffer currentPasteboardBuffer() | 42 WebKit::WebClipboard::Buffer currentPasteboardBuffer() |
43 { | 43 { |
44 return Pasteboard::generalPasteboard()->isSelectionMode() ? | 44 return Pasteboard::generalPasteboard()->isSelectionMode() ? |
45 WebKit::WebClipboard::BufferSelection : | 45 WebKit::WebClipboard::BufferSelection : |
46 WebKit::WebClipboard::BufferStandard; | 46 WebKit::WebClipboard::BufferStandard; |
47 } | 47 } |
48 | 48 |
49 #if OS(WINDOWS) | 49 #if OS(WIN) |
50 void replaceNewlinesWithWindowsStyleNewlines(String& str) | 50 void replaceNewlinesWithWindowsStyleNewlines(String& str) |
51 { | 51 { |
52 DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n")); | 52 DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n")); |
53 StringBuilder result; | 53 StringBuilder result; |
54 for (unsigned index = 0; index < str.length(); ++index) { | 54 for (unsigned index = 0; index < str.length(); ++index) { |
55 if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r')) | 55 if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r')) |
56 result.append(str[index]); | 56 result.append(str[index]); |
57 else | 57 else |
58 result.append(windowsNewline); | 58 result.append(windowsNewline); |
59 } | 59 } |
(...skipping 24 matching lines...) Expand all Loading... |
84 if (line[0] == '#') | 84 if (line[0] == '#') |
85 continue; | 85 continue; |
86 KURL url = KURL(ParsedURLString, line); | 86 KURL url = KURL(ParsedURLString, line); |
87 if (url.isValid()) | 87 if (url.isValid()) |
88 return url; | 88 return url; |
89 } | 89 } |
90 return String(); | 90 return String(); |
91 } | 91 } |
92 | 92 |
93 } // namespace WebCore | 93 } // namespace WebCore |
OLD | NEW |