Fix mail part of bug 74901. Don't need anymore to convert line feeds before inserting data into editor. R=jfrancis, SR=mscott

This commit is contained in:
ducarroz%netscape.com 2001-04-06 14:34:34 +00:00
Родитель 825a60168c
Коммит 0b90c4283a
3 изменённых файлов: 0 добавлений и 70 удалений

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

@ -2023,54 +2023,6 @@ ConvertBufToPlainText(nsString &aConBuf, PRBool formatflowed /* = PR_FALSE */)
return rv;
}
// Need to take this input data and do the following conversions
// in place:
//
// First pass: Turn CRLF into LF
// Second pass: Turn CR into LF
//
void
DoLineEndingConJob(char *aBuf, PRUint32 aLen)
{
PRUint32 i;
if (aLen <= 0)
return;
// First pass: Turn CRLF into LF
PRUint32 len = aLen;
for (i=0; i < (len-1); i++)
{
if ( (aBuf[i] == CR) && (aBuf[i+1] == LF) )
{
nsCRT::memmove((void *)&(aBuf[i]), (void *)&(aBuf[i+1]), (len-i-1));
len -= 1;
aBuf[len] = '\0';
}
}
// Second pass: Turn CR into LF
len = PL_strlen(aBuf);
for (i=0; i<len; i++)
if (aBuf[i] == CR)
aBuf[i] = LF;
}
// Need to take this input data and do the following conversions
// in place:
//
// First pass: Turn CRLF into LF
// Second pass: Turn CR into LF
//
void
DoLineEndingConJobUnicode(nsString& aInString)
{
// First pass: Turn CRLF into LF
aInString.ReplaceSubstring(NS_ConvertASCIItoUCS2(CRLF), NS_ConvertASCIItoUCS2(LF));
// Second pass: Turn CR into LF
aInString.ReplaceChar(CR, LF);
}
// Simple parser to parse Subject.
// It only supports the case when the description is within one line.
char *

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

@ -132,10 +132,6 @@ char *GetFolderURIFromUserPrefs(nsMsgDeliverMode aMode,
// File calls...
nsresult ConvertBufToPlainText(nsString &aConBuf, PRBool formatflowed = PR_FALSE);
// Conversion...
void DoLineEndingConJob(char *aBuf, PRUint32 aLen);
void DoLineEndingConJobUnicode(nsString& aInString);
// Check if we should use format=flowed
PRBool UseFormatFlowed(const char *charset);

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

@ -159,19 +159,6 @@ NS_IMPL_ISUPPORTS1(nsMsgCompose, nsMsgCompose)
//
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
nsresult
TranslateLineEndings(nsString &aString)
{
// First, do sanity checking...if aString doesn't have
// any CR's, then there is no reason to call this rest
// of this
if (aString.FindChar(CR) < 0)
return NS_OK;
DoLineEndingConJobUnicode(aString);
return NS_OK;
}
nsresult
GetChildOffset(nsIDOMNode *aChild, nsIDOMNode *aParent, PRInt32 &aOffset)
{
@ -233,10 +220,6 @@ nsresult nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorShell,
aEditorShell->GetEditor(getter_AddRefs(editor));
TranslateLineEndings(aPrefix);
TranslateLineEndings(aBuf);
TranslateLineEndings(aSignature);
if (editor)
editor->EnableUndo(PR_FALSE);
@ -3139,7 +3122,6 @@ nsresult nsMsgCompose::SetSignature(nsIMsgIdentity *identity)
//Then add the new one if needed
nsAutoString aSignature;
ProcessSignature(identity, &aSignature);
TranslateLineEndings(aSignature);
if (!aSignature.IsEmpty())
{