зеркало из https://github.com/mozilla/gecko-dev.git
replaced calls to deprecated nsString API
This commit is contained in:
Родитель
cf36fcda1a
Коммит
f4902b78bc
|
@ -2638,7 +2638,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa
|
|||
{
|
||||
aType.Truncate();
|
||||
aParams.Truncate();
|
||||
PRInt32 semiIndex = aValue.Find(PRUnichar(';'));
|
||||
PRInt32 semiIndex = aValue.FindChar(PRUnichar(';'));
|
||||
if (-1 != semiIndex) {
|
||||
aValue.Left(aType, semiIndex);
|
||||
aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);
|
||||
|
|
|
@ -2860,7 +2860,7 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
|
|||
// Temporary
|
||||
PRBool doReplace = PR_FALSE;
|
||||
nsString replacementStr("xxxx");
|
||||
PRInt32 inx = mSearchStr->Find('/');
|
||||
PRInt32 inx = mSearchStr->FindChar('/');
|
||||
if (inx > -1) {
|
||||
if (inx == mSearchStr->Length()-1) {
|
||||
replacementStr.SetLength(0);
|
||||
|
|
|
@ -114,7 +114,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
aDeclaration.ToString(list);
|
||||
|
||||
PRInt32 start = 0;
|
||||
PRInt32 semiColon = list.Find(';');
|
||||
PRInt32 semiColon = list.FindChar(';');
|
||||
|
||||
while (-1 < semiColon) {
|
||||
decl.Truncate();
|
||||
|
@ -124,7 +124,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
// XXX need to append comment
|
||||
}
|
||||
else {
|
||||
PRInt32 colon = decl.Find(':');
|
||||
PRInt32 colon = decl.FindChar(':');
|
||||
nsAutoString property;
|
||||
nsAutoString value;
|
||||
|
||||
|
@ -140,7 +140,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
}
|
||||
|
||||
start = ++semiColon;
|
||||
semiColon = list.Find(';', start);
|
||||
semiColon = list.FindChar(';', PR_FALSE,start);
|
||||
}
|
||||
aConverter.EndCSSDeclarationList();
|
||||
}
|
||||
|
|
|
@ -1052,14 +1052,14 @@ GetQuotedAttributeValue(nsString& aSource,
|
|||
|
||||
offset = aSource.Find(aAttribute);
|
||||
if (-1 != offset) {
|
||||
offset = aSource.Find('=', offset);
|
||||
offset = aSource.FindChar('=', PR_FALSE,offset);
|
||||
|
||||
PRUnichar next = aSource.CharAt(++offset);
|
||||
if (kQuote == next) {
|
||||
endOffset = aSource.Find(kQuote, ++offset);
|
||||
endOffset = aSource.FindChar(kQuote,PR_FALSE, ++offset);
|
||||
}
|
||||
else if (kApostrophe == next) {
|
||||
endOffset = aSource.Find(kApostrophe, ++offset);
|
||||
endOffset = aSource.FindChar(kApostrophe, PR_FALSE,++offset);
|
||||
}
|
||||
|
||||
if (-1 != endOffset) {
|
||||
|
@ -1098,7 +1098,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa
|
|||
{
|
||||
aType.Truncate();
|
||||
aParams.Truncate();
|
||||
PRInt32 semiIndex = aValue.Find(PRUnichar(';'));
|
||||
PRInt32 semiIndex = aValue.FindChar(PRUnichar(';'));
|
||||
if (-1 != semiIndex) {
|
||||
aValue.Left(aType, semiIndex);
|
||||
aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);
|
||||
|
|
|
@ -497,7 +497,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
|
|||
{ // XXX for now, prefetch the attr value, this needs to be a special content node
|
||||
nsIAtom* attrName = nsnull;
|
||||
PRInt32 attrNameSpace = kNameSpaceID_None;
|
||||
PRInt32 barIndex = contentString.Find('|'); // CSS namespace delimiter
|
||||
PRInt32 barIndex = contentString.FindChar('|'); // CSS namespace delimiter
|
||||
if (-1 != barIndex) {
|
||||
nsAutoString nameSpaceVal;
|
||||
contentString.Left(nameSpaceVal, barIndex);
|
||||
|
|
|
@ -662,11 +662,11 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
aSpec.Trim(" \n\r\t"); // remove leading and trailing whitespace
|
||||
|
||||
// Count the commas
|
||||
PRInt32 commaX = aSpec.Find(COMMA);
|
||||
PRInt32 commaX = aSpec.FindChar(COMMA);
|
||||
PRInt32 count = 1;
|
||||
while (commaX >= 0) {
|
||||
count++;
|
||||
commaX = aSpec.Find(COMMA, commaX + 1);
|
||||
commaX = aSpec.FindChar(COMMA, PR_FALSE,commaX + 1);
|
||||
}
|
||||
|
||||
if (count > aMaxNumValues) {
|
||||
|
@ -681,7 +681,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
// Find our comma
|
||||
commaX = aSpec.Find(COMMA, start);
|
||||
commaX = aSpec.FindChar(COMMA, PR_FALSE,start);
|
||||
PRInt32 end = (commaX < 0) ? specLen : commaX;
|
||||
|
||||
// Note: If end == start then it means that the token has no
|
||||
|
|
|
@ -662,11 +662,11 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
aSpec.Trim(" \n\r\t"); // remove leading and trailing whitespace
|
||||
|
||||
// Count the commas
|
||||
PRInt32 commaX = aSpec.Find(COMMA);
|
||||
PRInt32 commaX = aSpec.FindChar(COMMA);
|
||||
PRInt32 count = 1;
|
||||
while (commaX >= 0) {
|
||||
count++;
|
||||
commaX = aSpec.Find(COMMA, commaX + 1);
|
||||
commaX = aSpec.FindChar(COMMA, PR_FALSE,commaX + 1);
|
||||
}
|
||||
|
||||
if (count > aMaxNumValues) {
|
||||
|
@ -681,7 +681,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
// Find our comma
|
||||
commaX = aSpec.Find(COMMA, start);
|
||||
commaX = aSpec.FindChar(COMMA, PR_FALSE,start);
|
||||
PRInt32 end = (commaX < 0) ? specLen : commaX;
|
||||
|
||||
// Note: If end == start then it means that the token has no
|
||||
|
|
|
@ -2638,7 +2638,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa
|
|||
{
|
||||
aType.Truncate();
|
||||
aParams.Truncate();
|
||||
PRInt32 semiIndex = aValue.Find(PRUnichar(';'));
|
||||
PRInt32 semiIndex = aValue.FindChar(PRUnichar(';'));
|
||||
if (-1 != semiIndex) {
|
||||
aValue.Left(aType, semiIndex);
|
||||
aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);
|
||||
|
|
|
@ -2860,7 +2860,7 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
|
|||
// Temporary
|
||||
PRBool doReplace = PR_FALSE;
|
||||
nsString replacementStr("xxxx");
|
||||
PRInt32 inx = mSearchStr->Find('/');
|
||||
PRInt32 inx = mSearchStr->FindChar('/');
|
||||
if (inx > -1) {
|
||||
if (inx == mSearchStr->Length()-1) {
|
||||
replacementStr.SetLength(0);
|
||||
|
|
|
@ -114,7 +114,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
aDeclaration.ToString(list);
|
||||
|
||||
PRInt32 start = 0;
|
||||
PRInt32 semiColon = list.Find(';');
|
||||
PRInt32 semiColon = list.FindChar(';');
|
||||
|
||||
while (-1 < semiColon) {
|
||||
decl.Truncate();
|
||||
|
@ -124,7 +124,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
// XXX need to append comment
|
||||
}
|
||||
else {
|
||||
PRInt32 colon = decl.Find(':');
|
||||
PRInt32 colon = decl.FindChar(':');
|
||||
nsAutoString property;
|
||||
nsAutoString value;
|
||||
|
||||
|
@ -140,7 +140,7 @@ void nsMarkupDocument::CSSDeclarationToXIF(nsXIFConverter& aConverter, nsICSSDec
|
|||
}
|
||||
|
||||
start = ++semiColon;
|
||||
semiColon = list.Find(';', start);
|
||||
semiColon = list.FindChar(';', PR_FALSE,start);
|
||||
}
|
||||
aConverter.EndCSSDeclarationList();
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ nsNativeTextControlFrame::PaintTextControl(nsIPresContext& aPresContext,
|
|||
|
||||
// Draw multi-line text
|
||||
PRInt32 oldPos = 0;
|
||||
PRInt32 pos = aText.Find('\n', 0);
|
||||
PRInt32 pos = aText.FindChar('\n', PR_FALSE,0);
|
||||
while (1) {
|
||||
nsString substr;
|
||||
if (-1 == pos) {
|
||||
|
@ -447,7 +447,7 @@ nsNativeTextControlFrame::PaintTextControl(nsIPresContext& aPresContext,
|
|||
// Advance to the next carriage return
|
||||
pos++;
|
||||
oldPos = pos;
|
||||
pos = aText.Find('\n', pos);
|
||||
pos = aText.FindChar('\n', PR_FALSE,pos);
|
||||
}
|
||||
|
||||
aRenderingContext.PopState(clipEmpty);
|
||||
|
|
|
@ -497,7 +497,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
|
|||
{ // XXX for now, prefetch the attr value, this needs to be a special content node
|
||||
nsIAtom* attrName = nsnull;
|
||||
PRInt32 attrNameSpace = kNameSpaceID_None;
|
||||
PRInt32 barIndex = contentString.Find('|'); // CSS namespace delimiter
|
||||
PRInt32 barIndex = contentString.FindChar('|'); // CSS namespace delimiter
|
||||
if (-1 != barIndex) {
|
||||
nsAutoString nameSpaceVal;
|
||||
contentString.Left(nameSpaceVal, barIndex);
|
||||
|
|
|
@ -1052,14 +1052,14 @@ GetQuotedAttributeValue(nsString& aSource,
|
|||
|
||||
offset = aSource.Find(aAttribute);
|
||||
if (-1 != offset) {
|
||||
offset = aSource.Find('=', offset);
|
||||
offset = aSource.FindChar('=', PR_FALSE,offset);
|
||||
|
||||
PRUnichar next = aSource.CharAt(++offset);
|
||||
if (kQuote == next) {
|
||||
endOffset = aSource.Find(kQuote, ++offset);
|
||||
endOffset = aSource.FindChar(kQuote,PR_FALSE, ++offset);
|
||||
}
|
||||
else if (kApostrophe == next) {
|
||||
endOffset = aSource.Find(kApostrophe, ++offset);
|
||||
endOffset = aSource.FindChar(kApostrophe, PR_FALSE,++offset);
|
||||
}
|
||||
|
||||
if (-1 != endOffset) {
|
||||
|
@ -1098,7 +1098,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa
|
|||
{
|
||||
aType.Truncate();
|
||||
aParams.Truncate();
|
||||
PRInt32 semiIndex = aValue.Find(PRUnichar(';'));
|
||||
PRInt32 semiIndex = aValue.FindChar(PRUnichar(';'));
|
||||
if (-1 != semiIndex) {
|
||||
aValue.Left(aType, semiIndex);
|
||||
aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче