зеркало из https://github.com/mozilla/gecko-dev.git
fix for bug #216581
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:
Родитель
fe33386ca8
Коммит
2a8f81be02
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче