bug = 34896, r= hyatt, adding in preformatting as a viable reason to wrap.

git-svn-id: svn://10.0.0.236/trunk@71229 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
2000-06-01 02:27:58 +00:00
parent 3dba18490a
commit 6779a8a970
2 changed files with 26 additions and 4 deletions

View File

@@ -204,7 +204,9 @@ nsHTMLToTXTSinkStream::nsHTMLToTXTSinkStream()
*/
nsHTMLToTXTSinkStream::~nsHTMLToTXTSinkStream()
{
NS_WARN_IF_FALSE(mCurrentLine.Length() == 0, "Buffer not flushed! Probably illegal input to class.");
if (mCurrentLine.Length() > 0)
FlushLine(); // We have some left over text in current line. flush it out.
// This means we didn't have a body or html node -- probably a text control.
if(mBuffer)
delete[] mBuffer;
@@ -244,6 +246,15 @@ nsHTMLToTXTSinkStream::Initialize(nsIOutputStream* aOutStream,
result = nsServiceManager::ReleaseService(kLWBrkCID, lf);
}
// Turn on caching if we are wrapping or we want formatting.
// We need this even when flags indicate preformatted,
// in order to wrap textareas with wrap=hard.
if((mFlags & nsIDocumentEncoder::OutputFormatted) ||
(mFlags & nsIDocumentEncoder::OutputWrap))
{
mCacheLine = PR_TRUE;
}
return result;
}
@@ -462,7 +473,7 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
(mFlags & nsIDocumentEncoder::OutputWrap))) {
mCacheLine = PR_TRUE;
}
// Try to figure out here whether we have a
// preformatted style attribute.
//