Changeset 46566 in webkit


Ignore:
Timestamp:
Jul 29, 2009 5:08:34 PM (15 years ago)
Author:
staikos@webkit.org
Message:

2009-07-29 Yong Li <yong.li@torchmobile.com>

Reviewed by George Staikos.

WINCE PORT: changes to platform/text files
https://bugs.webkit.org/show_bug.cgi?id=27715

Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r46564 r46566  
     12009-07-29  Yong Li  <yong.li@torchmobile.com>
     2
     3        Reviewed by George Staikos.
     4
     5        WINCE PORT: changes to platform/text files
     6        https://bugs.webkit.org/show_bug.cgi?id=27715
     7
     8        * platform/text/String.cpp:
     9        (WebCore::String::format):
     10        * platform/text/TextEncoding.cpp:
     11        (WebCore::TextEncoding::encode):
     12        * platform/text/TextEncodingRegistry.cpp:
     13        (WebCore::buildBaseTextCodecMaps):
     14        (WebCore::extendTextCodecMaps):
     15
    1162009-07-29  Yong Li  <yong.li@torchmobile.com>
    217
  • trunk/WebCore/platform/text/String.cpp

    r44831 r46566  
    22 * (C) 1999 Lars Knoll (knoll@kde.org)
    33 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
     4 * Copyright (C) 2007-2009 Torch Mobile, Inc.
    45 *
    56 * This library is free software; you can redistribute it and/or
     
    354355
    355356    return buffer;
     357
     358#elif PLATFORM(WINCE)
     359    va_list args;
     360    va_start(args, format);
     361
     362    Vector<char, 256> buffer;
     363
     364    int bufferSize = 256;
     365    buffer.resize(bufferSize);
     366    for (;;) {
     367        int written = vsnprintf(buffer.data(), bufferSize, format, args);
     368        va_end(args);
     369
     370        if (written == 0)
     371            return String("");
     372        if (written > 0)
     373            return StringImpl::create(buffer.data(), written);
     374       
     375        bufferSize <<= 1;
     376        buffer.resize(bufferSize);
     377        va_start(args, format);
     378    }
     379
    356380#else
    357381    va_list args;
  • trunk/WebCore/platform/text/TextEncoding.cpp

    r44050 r46566  
    22 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
     4 * Copyright (C) 2007-2009 Torch Mobile, Inc.
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    114115    str = str.normalized(QString::NormalizationForm_C);
    115116    return newTextCodec(*this)->encode(reinterpret_cast<const UChar *>(str.utf16()), str.length(), handling);
     117#elif PLATFORM(WINCE)
     118    // normalization will be done by Windows CE API
     119    OwnPtr<TextCodec> textCodec = newTextCodec(*this);
     120    return textCodec.get() ? textCodec->encode(characters, length, handling) : CString();
    116121#endif
    117122}
  • trunk/WebCore/platform/text/TextEncodingRegistry.cpp

    r44096 r46566  
    11/*
    22 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     3 * Copyright (C) 2007-2009 Torch Mobile, Inc.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4849#include "qt/TextCodecQt.h"
    4950#endif
     51#if PLATFORM(WINCE)
     52#include "TextCodecWince.h"
     53#endif
    5054
    5155using namespace WTF;
     
    190194    TextCodecICU::registerBaseCodecs(addToTextCodecMap);
    191195#endif
     196
     197#if PLATFORM(WINCE)
     198    TextCodecWince::registerBaseEncodingNames(addToTextEncodingNameMap);
     199    TextCodecWince::registerBaseCodecs(addToTextCodecMap);
     200#endif
    192201}
    193202
     
    207216    TextCodecMac::registerEncodingNames(addToTextEncodingNameMap);
    208217    TextCodecMac::registerCodecs(addToTextCodecMap);
     218#endif
     219
     220#if PLATFORM(WINCE)
     221    TextCodecWince::registerExtendedEncodingNames(addToTextEncodingNameMap);
     222    TextCodecWince::registerExtendedCodecs(addToTextCodecMap);
    209223#endif
    210224}
Note: See TracChangeset for help on using the changeset viewer.