зеркало из https://github.com/mozilla/pjs.git
fix for bug 205895 - make nsIMIMEInfo.getFileExtensions use a string enumerator, to avoid excess allocation at startup
r=bz, sr=darin
This commit is contained in:
Родитель
7c46f5edf0
Коммит
94e749354a
|
@ -619,18 +619,19 @@ function appendFiltersForContentType(aFilePicker, aContentType, aSaveMode)
|
|||
|
||||
var mimeInfo = getMIMEInfoForType(aContentType);
|
||||
if (mimeInfo) {
|
||||
var extCount = { };
|
||||
var extList = { };
|
||||
mimeInfo.GetFileExtensions(extCount, extList);
|
||||
|
||||
var extEnumerator = mimeInfo.getFileExtensions();
|
||||
|
||||
var extString = "";
|
||||
for (var i = 0; i < extCount.value; ++i) {
|
||||
if (i > 0)
|
||||
extString += "; "; // If adding more than one extension, separate by semi-colon
|
||||
extString += "*." + extList.value[i];
|
||||
while (extEnumerator.hasMore()) {
|
||||
var extension = extEnumerator.getNext();
|
||||
if (extString)
|
||||
extString += "; "; // If adding more than one extension,
|
||||
// separate by semi-colon
|
||||
extString += "*." + extension;
|
||||
}
|
||||
|
||||
if (extCount.value > 0) {
|
||||
|
||||
if (extString) {
|
||||
aFilePicker.appendFilter(mimeInfo.Description, extString);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче