Bug 96710: (try 2). Right() takes number-of-chars-to-return, not position.
r=jag, sr=jst
This commit is contained in:
Родитель
bdb8525386
Коммит
ee2b7e971b
|
@ -3129,7 +3129,8 @@ nsGenericHTMLElement::ParseStyleAttribute(const nsAReadableString& aValue, nsHTM
|
|||
PRInt32 charsetOffset = styleType.Find(charsetStr, PR_TRUE);
|
||||
if (charsetOffset > 0) {
|
||||
nsString charset;
|
||||
styleType.Right(charset, charsetOffset + sizeof(charsetStr) - 1);
|
||||
styleType.Right(charset, styleType.Length() -
|
||||
(charsetOffset + sizeof(charsetStr) - 1));
|
||||
(void)cssLoader->SetCharset(charset);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1659,7 +1659,8 @@ nsresult CSSLoaderImpl::SetCharset(/*in*/ const nsString &aHTTPHeader,
|
|||
PRInt32 charsetOffset;
|
||||
static const char charsetStr[] = "charset=";
|
||||
if ((charsetOffset = aHTTPHeader.Find(charsetStr,PR_TRUE)) > 0) {
|
||||
aHTTPHeader.Right(str, charsetOffset + sizeof(charsetStr)-1);
|
||||
aHTTPHeader.Right(str, aHTTPHeader.Length() -
|
||||
(charsetOffset + sizeof(charsetStr)-1));
|
||||
setCharset = PR_TRUE;
|
||||
}
|
||||
} else if (aStyleSheetData.Length() > 0) {
|
||||
|
@ -1667,7 +1668,8 @@ nsresult CSSLoaderImpl::SetCharset(/*in*/ const nsString &aHTTPHeader,
|
|||
if (aStyleSheetData.Find(atCharsetStr) > -1) {
|
||||
nsString strValue;
|
||||
// skip past the ident
|
||||
aStyleSheetData.Right(str,sizeof(atCharsetStr)-1);
|
||||
aStyleSheetData.Right(str, aStyleSheetData.Length() -
|
||||
(sizeof(atCharsetStr)-1));
|
||||
// strip any whitespace
|
||||
str.StripWhitespace();
|
||||
// truncate everything past the delimiter (semicolon)
|
||||
|
|
|
@ -1659,7 +1659,8 @@ nsresult CSSLoaderImpl::SetCharset(/*in*/ const nsString &aHTTPHeader,
|
|||
PRInt32 charsetOffset;
|
||||
static const char charsetStr[] = "charset=";
|
||||
if ((charsetOffset = aHTTPHeader.Find(charsetStr,PR_TRUE)) > 0) {
|
||||
aHTTPHeader.Right(str, charsetOffset + sizeof(charsetStr)-1);
|
||||
aHTTPHeader.Right(str, aHTTPHeader.Length() -
|
||||
(charsetOffset + sizeof(charsetStr)-1));
|
||||
setCharset = PR_TRUE;
|
||||
}
|
||||
} else if (aStyleSheetData.Length() > 0) {
|
||||
|
@ -1667,7 +1668,8 @@ nsresult CSSLoaderImpl::SetCharset(/*in*/ const nsString &aHTTPHeader,
|
|||
if (aStyleSheetData.Find(atCharsetStr) > -1) {
|
||||
nsString strValue;
|
||||
// skip past the ident
|
||||
aStyleSheetData.Right(str,sizeof(atCharsetStr)-1);
|
||||
aStyleSheetData.Right(str, aStyleSheetData.Length() -
|
||||
(sizeof(atCharsetStr)-1));
|
||||
// strip any whitespace
|
||||
str.StripWhitespace();
|
||||
// truncate everything past the delimiter (semicolon)
|
||||
|
|
|
@ -207,7 +207,9 @@ nsresult nsAddbookUrl::ParseUrl()
|
|||
if (startOfSearchPart > 0)
|
||||
{
|
||||
// now parse out the search field...
|
||||
PRUint32 numExtraChars = mOperationPart.Right(searchPart, startOfSearchPart);
|
||||
PRUint32 numExtraChars = mOperationPart.Right(searchPart,
|
||||
mOperationPart.Length() -
|
||||
startOfSearchPart);
|
||||
if (!searchPart.IsEmpty())
|
||||
{
|
||||
// now we need to strip off the search part from the
|
||||
|
|
|
@ -604,7 +604,9 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetFileExtension(char * *aFileExtension)
|
|||
nsCAutoString extension;
|
||||
PRInt32 pos = mAttachmentFileName.RFindCharInSet(".");
|
||||
if (pos > 0)
|
||||
mAttachmentFileName.Right(extension, pos + 1 /* skip the '.' */);
|
||||
mAttachmentFileName.Right(extension,
|
||||
mAttachmentFileName.Length() -
|
||||
(pos + 1) /* skip the '.' */);
|
||||
*aFileExtension = extension.ToNewCString();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,9 @@ nsresult nsMailtoUrl::ParseUrl()
|
|||
{
|
||||
// now parse out the search field...
|
||||
nsCAutoString searchPart;
|
||||
PRUint32 numExtraChars = m_toPart.Right(searchPart, startOfSearchPart);
|
||||
PRUint32 numExtraChars = m_toPart.Right(searchPart,
|
||||
m_toPart.Length() -
|
||||
startOfSearchPart);
|
||||
if (!searchPart.IsEmpty())
|
||||
{
|
||||
ParseMailtoUrl(NS_CONST_CAST(char*, searchPart.get()));
|
||||
|
|
|
@ -59,7 +59,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
PRInt32 pos = p.Find("?");
|
||||
if (pos > 0) {
|
||||
nsCAutoString param;
|
||||
(void)p.Right(param, pos+1);
|
||||
(void)p.Right(param, p.Length() - (pos+1));
|
||||
if (param.Equals("new"))
|
||||
statType = nsTraceRefcnt::NEW_STATS;
|
||||
else if (param.Equals("clear"))
|
||||
|
|
|
@ -74,7 +74,7 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
PRInt32 pos = p.Find("?");
|
||||
if (pos > 0) {
|
||||
nsCAutoString param;
|
||||
(void)p.Right(param, pos+1);
|
||||
(void)p.Right(param, p.Length() - (pos+1));
|
||||
if (param.Equals("new"))
|
||||
statType = nsTraceRefcnt::NEW_STATS;
|
||||
else if (param.Equals("clear"))
|
||||
|
|
|
@ -723,7 +723,8 @@ void nsExternalAppHandler::ExtractSuggestedFileNameFromChannel(nsIChannel* aChan
|
|||
{
|
||||
// extract everything after the filename= part and treat that as the file name...
|
||||
nsCAutoString dispFileName;
|
||||
dispositionValue.Right(dispFileName, pos + nsCRT::strlen("filename="));
|
||||
dispositionValue.Right(dispFileName, dispositionValue.Length() -
|
||||
(pos + nsCRT::strlen("filename=")));
|
||||
if (!dispFileName.IsEmpty()) // if we got a file name back..
|
||||
{
|
||||
pos = dispFileName.FindChar(';', PR_TRUE);
|
||||
|
@ -1156,7 +1157,7 @@ NS_IMETHODIMP nsExternalAppHandler::SaveToDisk(nsIFile * aNewFileLocation, PRBoo
|
|||
nsAutoString fileExt;
|
||||
PRInt32 pos = mSuggestedFileName.RFindChar(PRUnichar('.'));
|
||||
if (pos >= 0)
|
||||
mSuggestedFileName.Right(fileExt, pos);
|
||||
mSuggestedFileName.Right(fileExt, mSuggestedFileName.Length() - pos);
|
||||
if (fileExt.IsEmpty())
|
||||
fileExt = NS_ConvertASCIItoUCS2(mTempFileExtension).get();
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
|||
PRInt32 extIndex = mDefault.RFind(".");
|
||||
if ( extIndex >= 0) {
|
||||
nsAutoString ext;
|
||||
mDefault.Right(ext, extIndex);
|
||||
mDefault.Right(ext, mDefault.Length() - extIndex);
|
||||
// Should we test for ".cgi", ".asp", ".jsp" and other "generated" html pages?
|
||||
if ( ext.EqualsIgnoreCase(".htm") ||
|
||||
ext.EqualsIgnoreCase(".html") ||
|
||||
|
|
|
@ -580,7 +580,7 @@ nsInstall::AddSubcomponent(const nsString& aRegName,
|
|||
if ( pos == kNotFound )
|
||||
tempTargetName = aJarSource;
|
||||
else
|
||||
aJarSource.Right(tempTargetName, pos+1);
|
||||
aJarSource.Right(tempTargetName, aJarSource.Length() - (pos+1));
|
||||
}
|
||||
|
||||
if (qualifiedVersion.IsEmpty())
|
||||
|
|
|
@ -554,7 +554,7 @@ nsInstallFolder::AppendXPPath(const nsString& aRelativePath)
|
|||
else if ( curr == kNotFound )
|
||||
{
|
||||
// last segment
|
||||
aRelativePath.Right(segment,start);
|
||||
aRelativePath.Right(segment,aRelativePath.Length() - start);
|
||||
start = aRelativePath.Length();
|
||||
}
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче