Oops, making wrapcolumn unsigned was a mistake. (Thanks to slamm's

warnings page for showing me that!)  Change it back to signed.
This commit is contained in:
akkana%netscape.com 1999-07-01 19:01:04 +00:00
Родитель 5cfdb3af5b
Коммит 8afa44f109
6 изменённых файлов: 24 добавлений и 13 удалений

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

@ -413,7 +413,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
{
printf("Getting number of columns\n");
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
printf("Currently wrapping to %d\n", wrap);
else
@ -426,7 +426,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==altKey)
{
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (!NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
{
printf("GetBodyWrapWidth returned an error\n");
@ -447,7 +447,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==altKey)
{
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (!NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
{
printf("GetBodyWrapWidth returned an error\n");

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

@ -1623,7 +1623,7 @@ nsEditorShell::GetWrapColumn(PRInt32* aWrapColumn)
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
{
PRUint32 wc;
PRInt32 wc;
err = textEditor->GetBodyWrapWidth(&wc);
if (NS_SUCCEEDED(err))
*aWrapColumn = (PRInt32)wc;

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

@ -1408,7 +1408,7 @@ NS_IMETHODIMP nsTextEditor::InsertAsQuotation(const nsString& aQuotedText)
// Get the wrap width for the first PRE tag in the document.
// If no PRE tag, throw an error.
//
NS_IMETHODIMP nsTextEditor::GetBodyWrapWidth(PRUint32 *aWrapColumn)
NS_IMETHODIMP nsTextEditor::GetBodyWrapWidth(PRInt32 *aWrapColumn)
{
nsresult res;
@ -1463,7 +1463,7 @@ NS_IMETHODIMP nsTextEditor::GetBodyWrapWidth(PRUint32 *aWrapColumn)
// (Eventually want to search for more than one in case there are
// interspersed quoted text blocks.)
//
NS_IMETHODIMP nsTextEditor::SetBodyWrapWidth(PRUint32 aWrapColumn)
NS_IMETHODIMP nsTextEditor::SetBodyWrapWidth(PRInt32 aWrapColumn)
{
nsresult res;
@ -1551,7 +1551,18 @@ NS_IMETHODIMP nsTextEditor::OutputTextToString(nsString& aOutputString, PRBool a
// Try to turn on pretty printing, but don't panic if it doesn't work:
(void)encoder->PrettyPrint(PR_TRUE);
(void)encoder->SetWrapColumn(mWrapColumn);
// Set the wrap column. If our wrap column is 0,
// i.e. wrap to body width, then don't set it, let the
// document encoder use its own default.
if (mWrapColumn != 0)
{
PRUint32 wc;
if (mWrapColumn < 0)
wc = 0;
else
wc = (PRUint32)mWrapColumn;
(void)encoder->SetWrapColumn(wc);
}
rv = encoder->EncodeToString(aOutputString);
}

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

@ -119,8 +119,8 @@ public:
NS_IMETHOD OutputHTMLToStream(nsIOutputStream* aOutputStream, nsString* aCharsetOverride, PRBool aSelectionOnly);
// Plain text wrapping control
NS_IMETHOD GetBodyWrapWidth(PRUint32 *aWrapColumn);
NS_IMETHOD SetBodyWrapWidth(PRUint32 aWrapColumn);
NS_IMETHOD GetBodyWrapWidth(PRInt32 *aWrapColumn);
NS_IMETHOD SetBodyWrapWidth(PRInt32 aWrapColumn);
// Logging methods

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

@ -1623,7 +1623,7 @@ nsEditorShell::GetWrapColumn(PRInt32* aWrapColumn)
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
{
PRUint32 wc;
PRInt32 wc;
err = textEditor->GetBodyWrapWidth(&wc);
if (NS_SUCCEEDED(err))
*aWrapColumn = (PRInt32)wc;

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

@ -413,7 +413,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
{
printf("Getting number of columns\n");
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
printf("Currently wrapping to %d\n", wrap);
else
@ -426,7 +426,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==altKey)
{
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (!NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
{
printf("GetBodyWrapWidth returned an error\n");
@ -447,7 +447,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==altKey)
{
aProcessed=PR_TRUE;
PRUint32 wrap;
PRInt32 wrap;
if (!NS_SUCCEEDED(mEditor->GetBodyWrapWidth(&wrap)))
{
printf("GetBodyWrapWidth returned an error\n");