Changeset 17881 in webkit


Ignore:
Timestamp:
Nov 26, 2006 12:53:57 PM (17 years ago)
Author:
zbujtas
Message:

2006-11-22 w3liu <wei.liu@nokia.com>

Reviewed by zbujtas@gmail.com.
DESC:
http://bugs.webkit.org/show_bug.cgi?id=11665
Text decoder regression in S60 browser

WARNING: NO TEST CASES ADDED OR CHANGED

  • kwq/KWQTextCodec.cpp: (KWQTextDecoder::KWQTextDecoder): (QTextCodec::fromUnicode): (QTextCodec::toUnicode): (KWQTextDecoder::fromUnicode): (KWQTextDecoder::checkRealloc):
  • kwq/KWQTextCodec.h:
Location:
S60/trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • S60/trunk/WebCore/ChangeLog

    r17845 r17881  
     12006-11-22  w3liu  <wei.liu@nokia.com>
     2
     3        Reviewed by zbujtas@gmail.com.
     4        DESC:
     5        http://bugs.webkit.org/show_bug.cgi?id=11665
     6        Text decoder regression in S60 browser
     7
     8        WARNING: NO TEST CASES ADDED OR CHANGED
     9
     10        * kwq/KWQTextCodec.cpp:
     11        (KWQTextDecoder::KWQTextDecoder):
     12        (QTextCodec::fromUnicode):
     13        (QTextCodec::toUnicode):
     14        (KWQTextDecoder::fromUnicode):
     15        (KWQTextDecoder::checkRealloc):
     16        * kwq/KWQTextCodec.h:
     17
    1182006-11-16  rathnasa  <sornalatha.rathnasamy@nokia.com>
    219
  • S60/trunk/WebCore/kwq/KWQTextCodec.cpp

    r17693 r17881  
    5050friend class QTextCodec;
    5151public:
    52     KWQTextDecoder(TUint aEnc) : iEncoding(aEnc), iRemainderBuf(NULL)   {}
     52    KWQTextDecoder(TUint aEnc) : iEncoding(aEnc), iRemainderBuf( NULL )   {}
    5353    ~KWQTextDecoder()                 { delete iRemainderBuf; }
    5454
     
    235235QCString QTextCodec::fromUnicode(const QString &qcs) const
    236236{
    237   return KWQTextDecoder( iEncoding ).fromUnicode( qcs );
     237    return makeDecoder()->fromUnicode( qcs );
    238238}
    239239
     
    245245QString QTextCodec::toUnicode(const QByteArray &qba, int len) const
    246246{
    247     return KWQTextDecoder( iEncoding ).toUnicode(qba.data(), len, true);
     247    return makeDecoder()->toUnicode(qba.data(), len, true);
    248248}
    249249
     
    525525                }
    526526            }
    527        
     527
    528528        ptr.Append( tmpBuf );
    529529
     
    531531        inBuf.Set( inBuf.Right( ret ) );
    532532        }
    533    
     533
    534534    //check if realloc needs for zero terminated string
    535535    if(ptr.MaxLength() == ptr.Length())
     
    546546            }
    547547        }
    548    
     548
    549549    outStr.append( (const char*)( ptr.PtrZ() ) );
    550550    delete outBuf;
     
    554554
    555555HBufC8* KWQTextDecoder::checkRealloc( TPtr8& aPtr, TInt aLen )
    556 {   
     556{
    557557   HBufC8* outBuf = HBufC8::NewMax( aLen );
    558558   if(outBuf)
  • S60/trunk/WebCore/kwq/KWQTextCodec.h

    r17535 r17881  
    4242    static QTextCodec *codecForLocale();
    4343
    44     QTextCodec( TUint aEnc, KWQEncodingFlags f = NoEncodingFlags ) : iEncoding( aEnc ), _flags(f)          {}
     44    QTextCodec( TUint aEnc, KWQEncodingFlags f = NoEncodingFlags ) : iEncoding( aEnc ), _flags( f ), iQTextDecoder( NULL ) {}
    4545    ~QTextCodec();
    4646    const char *name() const;
     
    7676    virtual ~QTextDecoder()                                         {}
    7777    virtual QString toUnicode(const char *, int, bool flush = false) = 0;
     78    virtual QCString fromUnicode(const QString &) = 0;
    7879};
    7980
Note: See TracChangeset for help on using the changeset viewer.