Changeset 1912 for trunk/WebCore/kwq/KWQString.mm
- Timestamp:
- 08/24/02 23:41:13 (6 years ago)
- Files:
-
- 1 modified
-
trunk/WebCore/kwq/KWQString.mm (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/kwq/KWQString.mm
r1903 r1912 596 596 *tp++ = *fp++; 597 597 str = ©Buf[0]; 598 _isUnicodeValid = 0; 598 599 } 599 600 else … … 616 617 *cp = 0; 617 618 618 _isUnicodeValid = 0;619 619 _isAsciiValid = 1; 620 620 } … … 644 644 *tp++ = *fp++; 645 645 str = ©Buf[0]; 646 _isAsciiValid = 0; 646 647 } 647 648 else … … 663 664 664 665 _isUnicodeValid = 1; 665 _isAsciiValid = 0;666 666 } 667 667 else if (!_isUnicodeValid) … … 778 778 779 779 if (dataHandle[0]->_isAsciiValid) { 780 return [ NSString stringWithCString:(const char *)ascii()];780 return [(NSString *)CFStringCreateWithCString(kCFAllocatorDefault, ascii(), kCFStringEncodingISOLatin1) autorelease]; 781 781 } 782 782 … … 2062 2062 // Insert characters. 2063 2063 memcpy (targetChars+index, insertChars, insertLength); 2064 2065 dataHandle[0]->_isUnicodeValid = 0; 2064 2066 } 2065 2067 else if (dataHandle[0]->_isUnicodeValid){ … … 2128 2130 } 2129 2131 2132 dataHandle[0]->_isAsciiValid = 0; 2130 2133 } 2131 2134 … … 2153 2156 targetChars[index] = insertChar; 2154 2157 targetChars[dataHandle[0]->_length] = 0; 2158 2159 dataHandle[0]->_isUnicodeValid = 0; 2155 2160 } 2156 2161 else { … … 2191 2196 targetChars[index] = ch; 2192 2197 targetChars[dataHandle[0]->_length] = 0; 2198 2199 dataHandle[0]->_isUnicodeValid = 0; 2193 2200 } 2194 2201 else if (dataHandle[0]->_isUnicodeValid){ … … 2292 2299 sizeof(char)*(olen-index-len) ); 2293 2300 setLength( olen-len ); 2301 dataHandle[0]->_isUnicodeValid = 0; 2294 2302 } 2295 2303 else if (dataHandle[0]->_isUnicodeValid){ … … 2417 2425 while (len--) 2418 2426 *nd++ = (char)qc; 2427 dataHandle[0]->_isUnicodeValid = 0; 2419 2428 } 2420 2429 else { … … 2461 2470 QSTRING_FAILURE("invalid character cache"); 2462 2471 dataHandle[0]->_length += qs.data()->_length; 2472 dataHandle[0]->_isAsciiValid = 0; 2463 2473 return *this; 2464 2474 } … … 2471 2481 *tp = 0; 2472 2482 dataHandle[0]->_length += qs.data()->_length; 2483 dataHandle[0]->_isUnicodeValid = 0; 2473 2484 return *this; 2474 2485 }