diff options
author | Ben Murdoch <benm@google.com> | 2010-05-11 18:35:50 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-14 10:23:05 +0100 |
commit | 21939df44de1705786c545cd1bf519d47250322d (patch) | |
tree | ef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebCore/platform/gtk/DataObjectGtk.cpp | |
parent | 4ff1d8891d520763f17675827154340c7c740f90 (diff) | |
download | external_webkit-21939df44de1705786c545cd1bf519d47250322d.zip external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2 |
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebCore/platform/gtk/DataObjectGtk.cpp')
-rw-r--r-- | WebCore/platform/gtk/DataObjectGtk.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/WebCore/platform/gtk/DataObjectGtk.cpp b/WebCore/platform/gtk/DataObjectGtk.cpp index 900fe8e..57d920c 100644 --- a/WebCore/platform/gtk/DataObjectGtk.cpp +++ b/WebCore/platform/gtk/DataObjectGtk.cpp @@ -24,6 +24,13 @@ namespace WebCore { +static void replaceNonBreakingSpaceWithSpace(String& str) +{ + static const UChar NonBreakingSpaceCharacter = 0xA0; + static const UChar SpaceCharacter = ' '; + str.replace(NonBreakingSpaceCharacter, SpaceCharacter); +} + String DataObjectGtk::text() { if (m_range) @@ -34,7 +41,7 @@ String DataObjectGtk::text() String DataObjectGtk::markup() { if (m_range) - createMarkup(m_range.get(), 0, AnnotateForInterchange); + return createMarkup(m_range.get(), 0, AnnotateForInterchange); return m_markup; } @@ -42,6 +49,7 @@ void DataObjectGtk::setText(const String& newText) { m_range = 0; m_text = newText; + replaceNonBreakingSpaceWithSpace(m_text); } void DataObjectGtk::setMarkup(const String& newMarkup) @@ -50,6 +58,18 @@ void DataObjectGtk::setMarkup(const String& newMarkup) m_markup = newMarkup; } +void DataObjectGtk::clearText() +{ + m_range = 0; + m_text = ""; +} + +void DataObjectGtk::clearMarkup() +{ + m_range = 0; + m_markup = ""; +} + Vector<String> DataObjectGtk::files() { Vector<KURL> uris(uriList()); |