From 0474b9cedd64d36f0202779012e7ba2a7fa97069 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Mon, 3 Feb 2003 11:47:13 +0000 Subject: [PATCH] Bug 186195 Space disappears when editing a word at the end of a block p=jfrancis r=brade sr=kin a=asa git-svn-id: svn://10.0.0.236/trunk@137316 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/libeditor/html/nsWSRunObject.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mozilla/editor/libeditor/html/nsWSRunObject.cpp b/mozilla/editor/libeditor/html/nsWSRunObject.cpp index a7920ddde9a..fd884718902 100644 --- a/mozilla/editor/libeditor/html/nsWSRunObject.cpp +++ b/mozilla/editor/libeditor/html/nsWSRunObject.cpp @@ -224,7 +224,7 @@ nsWSRunObject::InsertBreak(nsCOMPtr *aInOutParent, { // dont need to do anything. just insert break. ws wont change. } - else if (afterRun->mType == eLeadingWS) + else if (afterRun->mType & eLeadingWS) { // delete the leading ws that is after insertion point. We don't // have to (it would still not be significant after br), but it's @@ -260,7 +260,7 @@ nsWSRunObject::InsertBreak(nsCOMPtr *aInOutParent, { // dont need to do anything. just insert break. ws wont change. } - else if (beforeRun->mType == eTrailingWS) + else if (beforeRun->mType & eTrailingWS) { // need to delete the trailing ws that is before insertion point, because it // would become significant after break inserted. @@ -319,7 +319,7 @@ nsWSRunObject::InsertText(const nsAString& aStringToInsert, { // dont need to do anything. just insert text. ws wont change. } - else if (afterRun->mType == eLeadingWS) + else if (afterRun->mType & eLeadingWS) { // delete the leading ws that is after insertion point, because it // would become significant after text inserted. @@ -342,7 +342,7 @@ nsWSRunObject::InsertText(const nsAString& aStringToInsert, { // dont need to do anything. just insert text. ws wont change. } - else if (beforeRun->mType == eTrailingWS) + else if (beforeRun->mType & eTrailingWS) { // need to delete the trailing ws that is before insertion point, because it // would become significant after text inserted. @@ -1411,7 +1411,7 @@ nsWSRunObject::PrepareToDeleteRangePriv(nsWSRunObject* aEndObject) NS_ENSURE_SUCCESS(res, res); // trim after run of any leading ws - if (afterRun && (afterRun->mType == eLeadingWS)) + if (afterRun && (afterRun->mType & eLeadingWS)) { res = aEndObject->DeleteChars(aEndObject->mNode, aEndObject->mOffset, afterRun->mEndNode, afterRun->mEndOffset); NS_ENSURE_SUCCESS(res, res); @@ -1419,7 +1419,7 @@ nsWSRunObject::PrepareToDeleteRangePriv(nsWSRunObject* aEndObject) // adjust normal ws in afterRun if needed if (afterRun && (afterRun->mType == eNormalWS) && !aEndObject->mPRE) { - if ( (beforeRun && (beforeRun->mType == eLeadingWS)) || + if ( (beforeRun && (beforeRun->mType & eLeadingWS)) || (!beforeRun && ((mStartReason & eBlock) || (mStartReason == eBreak))) ) { // make sure leading char of following ws is an nbsp, so that it will show up @@ -1433,14 +1433,14 @@ nsWSRunObject::PrepareToDeleteRangePriv(nsWSRunObject* aEndObject) } } // trim before run of any trailing ws - if (beforeRun && (beforeRun->mType == eTrailingWS)) + if (beforeRun && (beforeRun->mType & eTrailingWS)) { res = DeleteChars(beforeRun->mStartNode, beforeRun->mStartOffset, mNode, mOffset); NS_ENSURE_SUCCESS(res, res); } else if (beforeRun && (beforeRun->mType == eNormalWS) && !mPRE) { - if ( (afterRun && (afterRun->mType == eTrailingWS)) || + if ( (afterRun && (afterRun->mType & eTrailingWS)) || (afterRun && (afterRun->mType == eNormalWS)) || (!afterRun && ((aEndObject->mEndReason & eBlock))) ) {