From f5302c09bb382d511e1be5ecaa2d72a7af122393 Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Wed, 9 May 2001 13:01:48 +0000 Subject: [PATCH] add debug insertion to detect unexpected linefeeds (checkin for Akkana); bug #54090 git-svn-id: svn://10.0.0.236/trunk@94371 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsInternetCiter.cpp | 7 +++++++ mozilla/editor/libeditor/text/nsInternetCiter.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/mozilla/editor/base/nsInternetCiter.cpp b/mozilla/editor/base/nsInternetCiter.cpp index a05f698eb4a..f24f574a480 100644 --- a/mozilla/editor/base/nsInternetCiter.cpp +++ b/mozilla/editor/base/nsInternetCiter.cpp @@ -184,6 +184,13 @@ nsInternetCiter::Rewrap(const nsAReadableString& aInString, PRBool aRespectNewlines, nsAWritableString& aOutString) { + // There shouldn't be returns in this string, only dom newlines. + // Check to make sure: +#ifdef DEBUG + PRInt32 cr = aInString.FindChar(PRUnichar('\r')); + NS_ASSERTION((cr < 0), "Rewrap: CR in string gotten from DOM!\n"); +#endif /* DEBUG */ + nsCOMPtr lineBreaker; nsILineBreakerFactory *lf; nsresult rv = NS_OK; diff --git a/mozilla/editor/libeditor/text/nsInternetCiter.cpp b/mozilla/editor/libeditor/text/nsInternetCiter.cpp index a05f698eb4a..f24f574a480 100644 --- a/mozilla/editor/libeditor/text/nsInternetCiter.cpp +++ b/mozilla/editor/libeditor/text/nsInternetCiter.cpp @@ -184,6 +184,13 @@ nsInternetCiter::Rewrap(const nsAReadableString& aInString, PRBool aRespectNewlines, nsAWritableString& aOutString) { + // There shouldn't be returns in this string, only dom newlines. + // Check to make sure: +#ifdef DEBUG + PRInt32 cr = aInString.FindChar(PRUnichar('\r')); + NS_ASSERTION((cr < 0), "Rewrap: CR in string gotten from DOM!\n"); +#endif /* DEBUG */ + nsCOMPtr lineBreaker; nsILineBreakerFactory *lf; nsresult rv = NS_OK;