--- a/textrendering/texthandling/stext/TXTFMSTM.CPP Mon May 03 14:13:26 2010 +0300
+++ b/textrendering/texthandling/stext/TXTFMSTM.CPP Thu Jun 24 11:18:23 2010 +0800
@@ -24,6 +24,11 @@
#include <txtfmstm.h>
#include "TXTSTD.H"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TXTFMSTMTraces.h"
+#endif
+
const TInt KMaxFormatStreamLength=0x400; // 1024 bytes
@@ -290,6 +295,10 @@
void RFormatStream::CopyL(const RFormatStream& aSource)
{
TInt size = aSource.iEnd - aSource.iBase;
+ if (size < 0)
+ {
+ OstTrace0( TRACE_DUMP, RFORMATSTREAM_COPYL, "EDebug" );
+ }
__ASSERT_DEBUG(size >= 0,Panic(EDebug));
if (size == 0)
Reset();
@@ -357,6 +366,10 @@
{
__TEST_INVARIANT;
aLength=iEnd-iBase;
+ if (!((iBase==NULL && aLength==0) || (iBase!=NULL && aLength>0)))
+ {
+ OstTrace0( TRACE_DUMP, RFORMATSTREAM_PTR, "ECorruptFormatLayer" );
+ }
__ASSERT_DEBUG((iBase==NULL && aLength==0) || (iBase!=NULL && aLength>0),Panic(ECorruptFormatLayer));
return iBase;
}
@@ -1594,7 +1607,15 @@
}
}
// ASSERT: The tabList offsets are as we would expect in a normal (correct) completion.
+ if (offsetInDesired!=aDesiredTabCount)
+ {
+ OstTrace0( TRACE_FATAL, RFORMATSTREAM_MERGETABLISTS, "EStoreTabError" );
+ }
__ASSERT_ALWAYS(offsetInDesired==aDesiredTabCount,Panic(EStoreTabError));
+ if (offsetInCurrent!=aCurrentTabCount)
+ {
+ OstTrace0( TRACE_FATAL, DUP1_RFORMATSTREAM_MERGETABLISTS, "EStoreTabError" );
+ }
__ASSERT_ALWAYS(offsetInCurrent==aCurrentTabCount,Panic(EStoreTabError));
return requiredTabCount;
}
@@ -1774,6 +1795,11 @@
//
// Read typeface name
TInt typefaceLength=length-KTypefaceFlags;
+
+ if ((typefaceLength%2)!=0)
+ {
+ OstTrace0( TRACE_DUMP, RFORMATSTREAM_READVALUE, "ECorruptFormatLayer" );
+ }
__ASSERT_DEBUG((typefaceLength%2)==0,Panic(ECorruptFormatLayer)); // must be an even number
TPtr name=aTypeface.iName.Des();
@@ -1830,6 +1856,10 @@
{
TInt length=TheAttributeLength[aType];
+ if (length<0)
+ {
+ OstTrace0( TRACE_DUMP, RFORMATSTREAM_LENGTH, "EAttributeLengthLookupNegative" );
+ }
__ASSERT_DEBUG(length>=0,Panic(EAttributeLengthLookupNegative));
if (length>0)
return length;