Changeset 54434 in webkit


Ignore:
Timestamp:
Feb 5, 2010 11:08:07 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-05 Maxime Simone <Maxime Simon>

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.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54430 r54434  
     12010-02-05  Maxime Simone  <simon.maxime@gmail.com>
     2
     3        Reviewed by David Levin.
     4
     5        More robust conversion from BString to String for Haiku port.
     6        https://bugs.webkit.org/show_bug.cgi?id=34527
     7
     8        Covered by existing tests.
     9
     10        * platform/text/haiku/StringHaiku.cpp: Fixed include order, Improved coversion from BString.
     11
    1122010-02-05  Steve Falkenburg  <sfalken@apple.com>
    213
  • trunk/WebCore/platform/text/haiku/StringHaiku.cpp

    r46008 r54434  
    2525
    2626#include "config.h"
    27 #include "CString.h"
    28 
    2927#include "PlatformString.h"
    3028
     29#include "CString.h"
    3130#include <String.h>
    32 
    3331
    3432namespace WebCore {
    3533
    3634// String conversions
    37 String::String(const BString& str)
     35String::String(const BString& bstring)
    3836{
    39     m_impl = String::fromUTF8(str.String(), str.Length()).impl();
     37    const UChar* str = reinterpret_cast<const UChar*>(bstring.String());
     38    const size_t size = bstring.Length();
     39
     40    if (!str)
     41        return;
     42
     43    if (!size)
     44        m_impl = StringImpl::empty();
     45    else
     46        m_impl = StringImpl::create(str, size);
    4047}
    4148
Note: See TracChangeset for help on using the changeset viewer.