Use Unicode escapes instead of octal escapes to print non-ASCII text in frame tree dumps. Bug 403871, r+sr=roc, a=dsicore

This commit is contained in:
smontagu@smontagu.org 2007-11-21 02:37:40 -08:00
Родитель 46fd183c5c
Коммит a0b55e5dea
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -5715,7 +5715,7 @@ nsresult nsTextFrame::GetRenderedText(nsAString* aAppendToString,
#ifdef DEBUG #ifdef DEBUG
// Translate the mapped content into a string that's printable // Translate the mapped content into a string that's printable
void void
nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const nsTextFrame::ToCString(nsCString& aBuf, PRInt32* aTotalContentLength) const
{ {
// Get the frames text content // Get the frames text content
const nsTextFragment* frag = mContent->GetText(); const nsTextFragment* frag = mContent->GetText();
@ -5742,8 +5742,7 @@ nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const
} else if (ch == '\t') { } else if (ch == '\t') {
aBuf.AppendLiteral("\\t"); aBuf.AppendLiteral("\\t");
} else if ((ch < ' ') || (ch >= 127)) { } else if ((ch < ' ') || (ch >= 127)) {
aBuf.AppendLiteral("\\0"); aBuf.Append(nsPrintfCString("\\u%04x", ch));
aBuf.AppendInt((PRInt32)ch, 8);
} else { } else {
aBuf.Append(ch); aBuf.Append(ch);
} }
@ -5811,7 +5810,7 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
} }
PRInt32 totalContentLength; PRInt32 totalContentLength;
nsAutoString tmp; nsCAutoString tmp;
ToCString(tmp, &totalContentLength); ToCString(tmp, &totalContentLength);
// Output the first/last content offset and prev/next in flow info // Output the first/last content offset and prev/next in flow info
@ -5861,7 +5860,7 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
IndentBy(out, aIndent); IndentBy(out, aIndent);
fputs("\"", out); fputs("\"", out);
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out); fputs(tmp.get(), out);
fputs("\"\n", out); fputs("\"\n", out);
aIndent--; aIndent--;