summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:57:27 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:57:27 +0000
commit0195ac6a92a2348df849d367e4ec229af3f168e5 (patch)
tree476d0277998eeb28b87a1683155371dfd62875fa
parentcd4740dba6b65213baa16dd31ede47731b092412 (diff)
downloadchromium_src-0195ac6a92a2348df849d367e4ec229af3f168e5.zip
chromium_src-0195ac6a92a2348df849d367e4ec229af3f168e5.tar.gz
chromium_src-0195ac6a92a2348df849d367e4ec229af3f168e5.tar.bz2
WebFrameImpl::GetSelection(): Replace NBSPs with spaces.
Also, on windows, replace new lines with window style new lines. This call is just there to match Pasteboard::writeSelection(), since AFAICT WebFrameImpl::GetSelection() is never used on any platform besides linux. BUG=16926 TEST=see bug Review URL: http://codereview.chromium.org/155650 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20920 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webframe_impl.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 09a049f..29e108d 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -76,6 +76,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "HTMLFormElement.h" // need this before Document.h
#include "Chrome.h"
#include "ChromeClientChromium.h"
+#include "ClipboardUtilitiesChromium.h"
#include "Console.h"
#include "Document.h"
#include "DocumentFragment.h" // Only needed for ReplaceSelectionCommand.h :(
@@ -1387,7 +1388,12 @@ std::string WebFrameImpl::GetSelection(bool as_html) {
String markup = WebCore::createMarkup(range.get(), 0);
return webkit_glue::StringToStdString(markup);
} else {
- return webkit_glue::StringToStdString(range->text());
+ String text = range->text();
+#if defined(OS_WIN)
+ WebCore::replaceNewlinesWithWindowsStyleNewlines(text);
+#endif
+ WebCore::replaceNBSPWithSpace(text);
+ return webkit_glue::StringToStdString(text);
}
}