summaryrefslogtreecommitdiffstats
path: root/qtools/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtools/qstring.cpp')
-rw-r--r--qtools/qstring.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp
index 44d4e6b..85962b2 100644
--- a/qtools/qstring.cpp
+++ b/qtools/qstring.cpp
@@ -367,8 +367,6 @@ __END__
// START OF GENERATED DATA
-#ifndef QT_NO_UNICODETABLES
-
static const Q_UINT8 ui_00[] = {
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
@@ -404,6 +402,8 @@ static const Q_UINT8 ui_00[] = {
16, 16, 16, 16, 16, 16, 16, 16,
};
+#ifndef QT_NO_UNICODETABLES
+
static const Q_UINT8 ui_01[] = {
15, 16, 15, 16, 15, 16, 15, 16,
15, 16, 15, 16, 15, 16, 15, 16,
@@ -11100,19 +11100,7 @@ QChar::Category QChar::category() const
#else
// ### just ASCII
if ( rw == 0 ) {
- if ( cl >= '0' && cl <='9' )
- return Number_DecimalDigit;
- if ( cl >= 'a' && cl <='z' )
- return Letter_Lowercase;
- if ( cl >= 'A' && cl <='Z' )
- return Letter_Uppercase;
- if ( cl == ' ' )
- return Separator_Space;
- if ( cl == '\n' )
- return Separator_Line;
- if ( cl < ' ' )
- return Other_Control;
- return Symbol_Other; //#######
+ return (Category)(ui_00[cell()]);
}
return Letter_Uppercase; //#######
#endif
@@ -12241,6 +12229,7 @@ QString::QString( const QChar* unicode, uint length )
{
if ( !unicode && !length ) {
d = shared_null ? shared_null : makeSharedNull();
+ d->ref();
} else {
QChar* uc = QT_ALLOC_QCHAR_VEC( length );
if ( unicode )
@@ -12295,6 +12284,8 @@ void QString::real_detach()
void QString::deref()
{
if ( d->deref() ) {
+ if ( d == shared_null )
+ shared_null = 0;
delete d;
d = 0; // helps debugging
}
@@ -12749,7 +12740,7 @@ QString &QString::sprintf( const char* cformat, ... )
case 2: ::sprintf( out, in, width, decimals, value ); break;
}
} break;
- case 'e': case 'E': case 'f': case 'g': {
+ case 'e': case 'E': case 'f': case 'g': case 'G': {
double value = va_arg(ap, double);
switch (params) {
case 0: ::sprintf( out, in, value ); break;
@@ -13896,6 +13887,13 @@ ushort QString::toUShort( bool *ok, int base ) const
/*!
Returns the string converted to a <code>int</code> value.
+ \code
+ QString str("FF");
+ bool ok;
+ int hex = str.toInt( &ok, 16 ); // will return 255, and ok set to TRUE
+ int dec = str.toInt( &ok, 10 ); // will return 0, and ok set to FALSE
+ \endcode
+
If \a ok is non-null, \a *ok is set to TRUE if there are no
conceivable errors, and FALSE if the string is not a number at all,
or if it has trailing garbage.
@@ -14146,8 +14144,8 @@ QString QString::number( uint n, int base )
}
/*!
- This static function returns the printed value of \a n, formatted in the \f
- format with \a prec precision.
+ This static function returns the printed value of \a n, formatted in the
+ \a f format with \a prec precision.
\a f can be 'f', 'F', 'e', 'E', 'g' or 'G', all of which have the
same meaning as for sprintf().
@@ -14574,6 +14572,7 @@ QString& QString::setUnicode( const QChar *unicode, uint len )
if ( d != shared_null ) { // beware of nullstring being set to nullstring
deref();
d = shared_null ? shared_null : makeSharedNull();
+ d->ref();
}
} else if ( d->count != 1 || len > d->maxl ||
( len*4 < d->maxl && d->maxl > 4 ) ) { // detach, grown or shrink
@@ -14947,8 +14946,10 @@ QDataStream &operator<<( QDataStream &s, const QString &str )
QDataStream &operator>>( QDataStream &s, QString &str )
{
#ifdef QT_QSTRING_UCS_4
+#if defined(_CC_GNU_)
#warning "operator>> not working properly"
#endif
+#endif
if ( s.version() == 1 ) {
QCString l;
s >> l;