Remove trailing whitespace. (No bug, DONTBUILD)
authorJesse Ruderman <jruderman@gmail.com>
Fri, 19 Oct 2012 07:13:14 -0700
changeset 110904 65d8df1a60e34c29de4e1d40bf0ec929a3e1ebdd
parent 110903 33d6f55a0b7a8d3f9956380ce0c110892af38b8d
child 110905 c1a74aa2ddd0195fbd96f468caa18fbc52cd0f10
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
milestone19.0a1
Remove trailing whitespace. (No bug, DONTBUILD)
embedding/components/find/src/nsFind.cpp
--- a/embedding/components/find/src/nsFind.cpp
+++ b/embedding/components/find/src/nsFind.cpp
@@ -58,17 +58,17 @@ PR_STATIC_ASSERT(CH_SHY <= 255);
 // 3) When the inner-iterator is created, we position the outer-iterator
 // 'after' (or 'before' in backward search) the text control to avoid
 // revisiting that control.
 //
 // 4) As a consequence of searching through text controls, we can be
 // called via FindNext with the current selection inside a <textarea>
 // or a text <input>. This means that we can be given an initial search
 // range that stretches across the anonymous DOM and the normal DOM. To
-// cater for this situation, we split the anonymous part into the 
+// cater for this situation, we split the anonymous part into the
 // inner-iterator and then reposition the outer-iterator outside.
 //
 // 5) The implementation assumes that First() and Next() are only called
 // in find-forward mode, while Last() and Prev() are used in find-backward.
 
 class nsFindContentIterator : public nsIContentIterator
 {
 public:
@@ -112,17 +112,17 @@ private:
   nsCOMPtr<nsIContentIterator> mOuterIterator;
   nsCOMPtr<nsIContentIterator> mInnerIterator;
   // Can't use a range here, since we want to represent part of the
   // flattened tree, including native anonymous content.
   nsCOMPtr<nsIDOMNode> mStartNode;
   int32_t mStartOffset;
   nsCOMPtr<nsIDOMNode> mEndNode;
   int32_t mEndOffset;
-  
+
   nsCOMPtr<nsIContent> mStartOuterContent;
   nsCOMPtr<nsIContent> mEndOuterContent;
   bool mFindBackward;
 
   void Reset();
   void MaybeSetupInnerIterator();
   void SetupInnerIterator(nsIContent* aContent);
 };
@@ -178,17 +178,17 @@ nsFindContentIterator::Next()
     if (!mInnerIterator->IsDone())
       return;
 
     // by construction, mOuterIterator is already on the next node
   }
   else {
     mOuterIterator->Next();
   }
-  MaybeSetupInnerIterator();  
+  MaybeSetupInnerIterator();
 }
 
 void
 nsFindContentIterator::Prev()
 {
   if (mInnerIterator) {
     mInnerIterator->Prev();
     if (!mInnerIterator->IsDone())
@@ -354,32 +354,32 @@ nsFindContentIterator::SetupInnerIterato
   editor->GetRootElement(getter_AddRefs(rootElement));
   nsCOMPtr<nsIContent> rootContent(do_QueryInterface(rootElement));
 
   nsCOMPtr<nsIDOMRange> innerRange = nsFind::CreateRange();
   nsCOMPtr<nsIDOMRange> outerRange = nsFind::CreateRange();
   if (!innerRange || !outerRange) {
     return;
   }
-     
+
   // now create the inner-iterator
   mInnerIterator = do_CreateInstance(kCPreContentIteratorCID);
 
   if (mInnerIterator) {
     innerRange->SelectNodeContents(rootElement);
 
     // fix up the inner bounds, we may have to only lookup a portion
     // of the text control if the current node is a boundary point
     if (aContent == mStartOuterContent) {
       innerRange->SetStart(mStartNode, mStartOffset);
     }
     if (aContent == mEndOuterContent) {
       innerRange->SetEnd(mEndNode, mEndOffset);
     }
-    // Note: we just init here. We do First() or Last() later. 
+    // Note: we just init here. We do First() or Last() later.
     mInnerIterator->Init(innerRange);
 
     // make sure to place the outer-iterator outside
     // the text control so that we don't go there again.
     nsresult res1, res2;
     nsCOMPtr<nsIDOMNode> outerNode(do_QueryInterface(aContent));
     if (!mFindBackward) { // find forward
       // cut the outer-iterator after the current node
@@ -387,17 +387,17 @@ nsFindContentIterator::SetupInnerIterato
       res2 = outerRange->SetStartAfter(outerNode);
     }
     else { // find backward
       // cut the outer-iterator before the current node
       res1 = outerRange->SetStart(mStartNode, mStartOffset);
       res2 = outerRange->SetEndBefore(outerNode);
     }
     if (NS_FAILED(res1) || NS_FAILED(res2)) {
-      // we are done with the outer-iterator, the 
+      // we are done with the outer-iterator, the
       // inner-iterator will traverse what we want
       outerRange->Collapse(true);
     }
 
     // Note: we just re-init here, using the segment of our search range that
     // is yet to be visited. Thus when we later do mOuterIterator->First() [or
     // mOuterIterator->Last()], we will effectively be on the next node [or
     // the previous node] _with respect to_ the search range.
@@ -468,17 +468,17 @@ nsFind::InitIterator(nsIDOMNode* aStartN
     mIterator = new nsFindContentIterator(mFindBackward);
     NS_ENSURE_TRUE(mIterator, NS_ERROR_OUT_OF_MEMORY);
   }
 
   NS_ENSURE_ARG_POINTER(aStartNode);
   NS_ENSURE_ARG_POINTER(aEndNode);
 
 #ifdef DEBUG_FIND
-  printf("InitIterator search range:\n"); 
+  printf("InitIterator search range:\n");
   printf(" -- start %d, ", aStartOffset); DumpNode(aStartNode);
   printf(" -- end %d, ", aEndOffset); DumpNode(aEndNode);
 #endif
 
   nsresult rv =
     mIterator->Init(aStartNode, aStartOffset, aEndNode, aEndOffset);
   NS_ENSURE_SUCCESS(rv, rv);
   if (mFindBackward) {
@@ -544,17 +544,17 @@ nsFind::SetWordBreaker(nsIWordBreaker* a
 // A ten-thousand-foot view of how it works:
 // Find needs to be able to compare across inline (but not block) nodes,
 // e.g. find for "abc" should match a<b>b</b>c.
 // So after we've searched a node, we're not done with it;
 // in the case of a partial match we may need to reset the
 // iterator to go back to a previously visited node,
 // so we always save the "match anchor" node and offset.
 //
-// Text nodes store their text in an nsTextFragment, which is 
+// Text nodes store their text in an nsTextFragment, which is
 // effectively a union of a one-byte string or a two-byte string.
 // Single and double strings are intermixed in the dom.
 // We don't have string classes which can deal with intermixed strings,
 // so all the handling is done explicitly here.
 //
 
 nsresult
 nsFind::NextNode(nsIDOMRange* aSearchRange,
@@ -854,17 +854,17 @@ nsFind::Find(const PRUnichar *aPatText, 
     return NS_ERROR_NULL_POINTER;
 
   ResetAll();
 
   nsAutoString patAutoStr(aPatText);
   if (!mCaseSensitive)
     ToLowerCase(patAutoStr);
 
-  // Ignore soft hyphens in the pattern  
+  // Ignore soft hyphens in the pattern
   static const char kShy[] = { char(CH_SHY), 0 };
   patAutoStr.StripChars(kShy);
 
   const PRUnichar* patStr = patAutoStr.get();
   int32_t patLen = patAutoStr.Length() - 1;
 
   // current offset into the pattern -- reset to beginning/end:
   int32_t pindex = (mFindBackward ? patLen : 0);
@@ -940,17 +940,17 @@ nsFind::Find(const PRUnichar *aPatText, 
 #endif
         mLastBlockParent = blockParent;
         // End any pending match:
         matchAnchorNode = nullptr;
         matchAnchorOffset = 0;
         pindex = (mFindBackward ? patLen : 0);
         inWhitespace = false;
       }
- 
+
       // Get the text content:
       tc = do_QueryInterface(mIterNode);
       if (!tc || !(frag = tc->GetText())) // Out of nodes
       {
         mIterator = nullptr;
         mLastBlockParent = 0;
         ResetAll();
         return NS_OK;
@@ -1134,17 +1134,17 @@ nsFind::Find(const PRUnichar *aPatText, 
           }
           else
           {
             startParent = matchAnchorNode;
             endParent = do_QueryInterface(tc);
             matchStartOffset = mao;
             matchEndOffset = findex+1;
           }
-          if (startParent && endParent && 
+          if (startParent && endParent &&
               IsVisibleNode(startParent) && IsVisibleNode(endParent))
           {
             range->SetStart(startParent, matchStartOffset);
             range->SetEnd(endParent, matchEndOffset);
             *aRangeRet = range.get();
             NS_ADDREF(*aRangeRet);
           }
           else {
@@ -1175,17 +1175,17 @@ nsFind::Find(const PRUnichar *aPatText, 
         if (!inWhitespace || DONE_WITH_PINDEX || IsSpace(patStr[pindex+incr]))
         {
           pindex += incr;
           inWhitespace = false;
 #ifdef DEBUG_FIND
           printf("Advancing pindex to %d\n", pindex);
 #endif
         }
-      
+
         continue;
       }
     }
 
 #ifdef DEBUG_FIND
     printf("NOT: %c == %c\n", c, patc);
 #endif
 
@@ -1217,17 +1217,17 @@ nsFind::Find(const PRUnichar *aPatText, 
 #endif
     }
     matchAnchorNode = nullptr;
     matchAnchorOffset = 0;
     inWhitespace = false;
     pindex = (mFindBackward ? patLen : 0);
 #ifdef DEBUG_FIND
     printf("Setting findex back to %d, pindex to %d\n", findex, pindex);
-           
+
 #endif
   } // end while loop
 
   // Out of nodes, and didn't match.
   ResetAll();
   return NS_OK;
 }