Commit 7143c196 authored by eric@webkit.org's avatar eric@webkit.org

2010-02-05 Maxime Simone <simon.maxime@gmail.com>

        Reviewed by David Levin.

        More robust conversion from BString to String for Haiku port.
        https://bugs.webkit.org/show_bug.cgi?id=34527

        Covered by existing tests.

        * platform/text/haiku/StringHaiku.cpp: Fixed include order, Improved coversion from BString.

git-svn-id: svn://svn.chromium.org/blink/trunk@54434 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b095dcfd
2010-02-05 Maxime Simone <simon.maxime@gmail.com>
Reviewed by David Levin.
More robust conversion from BString to String for Haiku port.
https://bugs.webkit.org/show_bug.cgi?id=34527
Covered by existing tests.
* platform/text/haiku/StringHaiku.cpp: Fixed include order, Improved coversion from BString.
2010-02-05 Steve Falkenburg <sfalken@apple.com>
Reviewed by Adam Roben.
......
......@@ -24,19 +24,26 @@
*/
#include "config.h"
#include "CString.h"
#include "PlatformString.h"
#include "CString.h"
#include <String.h>
namespace WebCore {
// String conversions
String::String(const BString& str)
String::String(const BString& bstring)
{
m_impl = String::fromUTF8(str.String(), str.Length()).impl();
const UChar* str = reinterpret_cast<const UChar*>(bstring.String());
const size_t size = bstring.Length();
if (!str)
return;
if (!size)
m_impl = StringImpl::empty();
else
m_impl = StringImpl::create(str, size);
}
String::operator BString() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment