Rewrap is broken

thanks to Akkana (akkzilla@shallowsky.com) for the fix

r=brade a=sspitzer for 1.5 final
This commit is contained in:
scott%scott-macgregor.org 2003-09-03 04:17:45 +00:00
Родитель fe33386ca8
Коммит 2a8f81be02
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -1611,19 +1611,22 @@ nsPlaintextEditor::InsertAsCitedQuotation(const nsAString& aQuotedText,
}
nsresult
nsPlaintextEditor::SharedOutputString(PRUint32 aFlags, PRBool* aIsCollapsed, nsAString& aResult)
nsPlaintextEditor::SharedOutputString(PRUint32 aFlags,
PRBool* aIsCollapsed,
nsAString& aResult)
{
nsCOMPtr<nsISelection> selection;
nsresult rv = GetSelection(getter_AddRefs(selection));
if (NS_FAILED(rv)) return rv;
NS_ENSURE_SUCCESS(rv, rv);
if (!selection)
return NS_ERROR_NOT_INITIALIZED;
rv = selection->GetIsCollapsed(aIsCollapsed);
if (NS_FAILED(rv)) return rv;
NS_ENSURE_SUCCESS(rv, rv);
if (*aIsCollapsed) // rewrap the whole document
if (!*aIsCollapsed)
aFlags |= nsIDocumentEncoder::OutputSelectionOnly;
// If the selection isn't collapsed, we'll use the whole document.
return OutputToString(NS_LITERAL_STRING("text/plain"), aFlags, aResult);
}