r=ftang (someday); fixed 17559 regression - there were a few cases where characters > 127 were leaking out without setting the mHasMultibyte flag that were triggering painting bugs on macs...
git-svn-id: svn://10.0.0.236/trunk@52389 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
9981b6e5e7
commit
283a28a5d4
@ -102,10 +102,6 @@ nsTextTransformer::Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
// XXX I'm sure there are other special characters
|
||||
#define CH_NBSP 160
|
||||
#define CH_SHY 173
|
||||
|
||||
// For now, we have only a single character to strip out. If we get
|
||||
// any more, change this to use a bitset to lookup into.
|
||||
#define IS_DISCARDED(_ch) \
|
||||
@ -223,6 +219,7 @@ nsTextTransformer::ScanNormalAsciiText_F(PRInt32* aWordLen)
|
||||
// Strip discarded characters from the transformed output
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == endbp) {
|
||||
PRInt32 oldLength = bp - mTransformBuf.GetBuffer();
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
@ -416,6 +413,7 @@ nsTextTransformer::ScanPreAsciiData_F(PRInt32* aWordLen)
|
||||
else if (IS_DISCARDED(ch)) {
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == endbp) {
|
||||
PRInt32 oldLength = bp - mTransformBuf.GetBuffer();
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
@ -580,6 +578,7 @@ nsTextTransformer::ScanNormalAsciiText_B(PRInt32* aWordLen)
|
||||
else if (IS_DISCARDED(ch)) {
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == startbp) {
|
||||
PRInt32 oldLength = mTransformBuf.mBufferLen;
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
|
||||
@ -28,6 +28,10 @@ class nsTextRun;
|
||||
class nsILineBreaker;
|
||||
class nsIWordBreaker;
|
||||
|
||||
// XXX I'm sure there are other special characters
|
||||
#define CH_NBSP 160
|
||||
#define CH_SHY 173
|
||||
|
||||
#define NS_TEXT_TRANSFORMER_AUTO_WORD_BUF_SIZE 100
|
||||
|
||||
// A growable text buffer that tries to avoid using malloc by having a
|
||||
|
||||
@ -102,10 +102,6 @@ nsTextTransformer::Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
// XXX I'm sure there are other special characters
|
||||
#define CH_NBSP 160
|
||||
#define CH_SHY 173
|
||||
|
||||
// For now, we have only a single character to strip out. If we get
|
||||
// any more, change this to use a bitset to lookup into.
|
||||
#define IS_DISCARDED(_ch) \
|
||||
@ -223,6 +219,7 @@ nsTextTransformer::ScanNormalAsciiText_F(PRInt32* aWordLen)
|
||||
// Strip discarded characters from the transformed output
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == endbp) {
|
||||
PRInt32 oldLength = bp - mTransformBuf.GetBuffer();
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
@ -416,6 +413,7 @@ nsTextTransformer::ScanPreAsciiData_F(PRInt32* aWordLen)
|
||||
else if (IS_DISCARDED(ch)) {
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == endbp) {
|
||||
PRInt32 oldLength = bp - mTransformBuf.GetBuffer();
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
@ -580,6 +578,7 @@ nsTextTransformer::ScanNormalAsciiText_B(PRInt32* aWordLen)
|
||||
else if (IS_DISCARDED(ch)) {
|
||||
continue;
|
||||
}
|
||||
if (ch > MAX_UNIBYTE) mHasMultibyte = PR_TRUE;
|
||||
if (bp == startbp) {
|
||||
PRInt32 oldLength = mTransformBuf.mBufferLen;
|
||||
nsresult rv = mTransformBuf.GrowBy(1000);
|
||||
|
||||
@ -28,6 +28,10 @@ class nsTextRun;
|
||||
class nsILineBreaker;
|
||||
class nsIWordBreaker;
|
||||
|
||||
// XXX I'm sure there are other special characters
|
||||
#define CH_NBSP 160
|
||||
#define CH_SHY 173
|
||||
|
||||
#define NS_TEXT_TRANSFORMER_AUTO_WORD_BUF_SIZE 100
|
||||
|
||||
// A growable text buffer that tries to avoid using malloc by having a
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user