Merge symbian1 branch symbian1
authorSebastian Brannstrom <sebastianb@symbian.org>
Sat, 16 Oct 2010 15:41:38 +0100
branchsymbian1
changeset 241 ed4ed5330d83
parent 240 03e8cc4066ba (diff)
parent 239 7ded71db88f6 (current diff)
child 242 64a2995a3e08
Merge symbian1 branch
--- a/engine/src/PodcastUtils.cpp	Sat Oct 16 14:08:26 2010 +0100
+++ b/engine/src/PodcastUtils.cpp	Sat Oct 16 15:41:38 2010 +0100
@@ -68,12 +68,13 @@
 
 EXPORT_C void PodcastUtils::CleanHtmlL(TDes &str)
 {
-
+	DP("PodcastUtils::CleanHtmlL BEGIN");
 	if (str.Length() == 0)
 		{
 		return;
 		}
 	
+	DP("    miscellaneous");
 // miscellaneous cleanup
 	const TChar KLineBreak(CEditableText::ELineBreak); 
 	_LIT(KNewLine, "\n");
@@ -81,6 +82,7 @@
 	ReplaceString(str, KNewLine, KNullDesC);
 	ReplaceString(str, KNewLineWindows, KNullDesC);
 
+	DP("    strip HTML");
 // strip out HTML tags
 	
 	TInt startPos = str.Locate('<');
@@ -114,6 +116,7 @@
 		endPos = str.Locate('>');
 	}
 		
+	DP("    change HTML encoded chars to unicode");
 // change HTML encoded chars to unicode
 	startPos = str.Locate('&');
 	endPos = str.Locate(';');
@@ -204,21 +207,26 @@
 		
 	CleanupStack::PopAndDestroy(tmpBuf);
 	
+	DP("    trim");
 	if(str.Length()>1)
 		{
+		DP1("str.Length() ==%d", str.Length());
 		// chop away newlines at start
-		while ((str[0] == KLineBreak) )  {
+		while (str.Length() && (str[0] == KLineBreak))  {
+			DP("mid");
 			str = str.Mid(1);
 		}
 		
 		// chop away newlines at end
 	
-		while ((str[str.Length()-1] == KLineBreak)) {
+		while (str.Length() && (str[str.Length()-1] == KLineBreak)) {
+			DP("left");
 			str = str.Left(str.Length()-1);
 		}
 
 		str.Trim();
 		}
+	DP("PodcastUtils::CleanHtmlL END");
 }
 
 EXPORT_C void PodcastUtils::RemoveAllFormatting(TDes & aString)