textrendering/texthandling/stext/TXTFMLYR.CPP
branchRCL_3
changeset 55 336bee5c2d35
parent 54 748ec5531811
equal deleted inserted replaced
54:748ec5531811 55:336bee5c2d35
    21 #include "TXTFRMAT.H"
    21 #include "TXTFRMAT.H"
    22 #include "TXTFMLYR.H"
    22 #include "TXTFMLYR.H"
    23 #include <txtfmstm.h>
    23 #include <txtfmstm.h>
    24 #include "TXTSTD.H"
    24 #include "TXTSTD.H"
    25 
    25 
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "TXTFMLYRTraces.h"
       
    29 #endif
       
    30 
       
    31 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    26 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    32 #include "TXTFMLYR_INTERNAL.H"
    27 #include "TXTFMLYR_INTERNAL.H"
    33 #endif
    28 #endif
    34 
    29 
    35 CFormatLayer::CFormatLayer()
    30 CFormatLayer::CFormatLayer()
   151 
   146 
   152 @param aStream Stream to which the format layer chain should be externalised. 
   147 @param aStream Stream to which the format layer chain should be externalised. 
   153 @param aExcludeCount The number of layers to be excluded. By default, zero. */
   148 @param aExcludeCount The number of layers to be excluded. By default, zero. */
   154 	{
   149 	{
   155 // ASSERT: aExcludeCount is positive.
   150 // ASSERT: aExcludeCount is positive.
   156 	if (aExcludeCount<0)
       
   157 	    {
       
   158 	    OstTrace0( TRACE_FATAL, CFORMATLAYER_EXTERNALIZECHAINL, "ECannotStoreFormatLayerChain" );
       
   159 	    }
       
   160 	__ASSERT_ALWAYS(aExcludeCount>=0,Panic(ECannotStoreFormatLayerChain));
   151 	__ASSERT_ALWAYS(aExcludeCount>=0,Panic(ECannotStoreFormatLayerChain));
   161 // ASSERT: The number of layers to be excluded is less than the total no. of layers.
   152 // ASSERT: The number of layers to be excluded is less than the total no. of layers.
   162 	if (aExcludeCount>=ChainCount())
       
   163 	    {
       
   164 	    OstTrace0( TRACE_FATAL, DUP1_CFORMATLAYER_EXTERNALIZECHAINL, "ECannotStoreFormatLayerChain" );
       
   165 	    }
       
   166 	__ASSERT_ALWAYS(aExcludeCount<ChainCount(),Panic(ECannotStoreFormatLayerChain));
   153 	__ASSERT_ALWAYS(aExcludeCount<ChainCount(),Panic(ECannotStoreFormatLayerChain));
   167 	TInt aCount=ChainCount()-aExcludeCount;
   154 	TInt aCount=ChainCount()-aExcludeCount;
   168 	aStream.WriteInt8L(aCount);  // Store the chain length.
   155 	aStream.WriteInt8L(aCount);  // Store the chain length.
   169 	ExternalizeLayersRecurseL(aStream,--aCount);
   156 	ExternalizeLayersRecurseL(aStream,--aCount);
   170 	}	
   157 	}	
   177 //
   164 //
   178 	{
   165 	{
   179 	if (aDescendantCount)
   166 	if (aDescendantCount)
   180 		{
   167 		{
   181 // ASSERT: The format layer chain is consistent.
   168 // ASSERT: The format layer chain is consistent.
   182 		if (iBasedOn==NULL)
       
   183 		    {
       
   184 		    OstTrace0( TRACE_DUMP, CFORMATLAYER_EXTERNALIZELAYERSRECURSEL, "ECorruptFormatLayerChain" );
       
   185 		    }
       
   186 		__ASSERT_ALWAYS(iBasedOn!=NULL,Panic(ECorruptFormatLayerChain));
   169 		__ASSERT_ALWAYS(iBasedOn!=NULL,Panic(ECorruptFormatLayerChain));
   187 		iBasedOn->ExternalizeLayersRecurseL(aStream,--aDescendantCount);
   170 		iBasedOn->ExternalizeLayersRecurseL(aStream,--aDescendantCount);
   188 		}
   171 		}
   189 	aStream<< *this;
   172 	aStream<< *this;
   190 	}
   173 	}
   375 Must not be NULL or a panic occurs. 
   358 Must not be NULL or a panic occurs. 
   376 @param aMode Controls which attributes are written to aParaFormat. If 
   359 @param aMode Controls which attributes are written to aParaFormat. If 
   377 EAllAttributes, all attributes are written; if EFixedAttributes, tabs, 
   360 EAllAttributes, all attributes are written; if EFixedAttributes, tabs, 
   378 bullets and borders are not written. */
   361 bullets and borders are not written. */
   379 	{
   362 	{
   380 	if (aParaFormat==NULL)
       
   381 	    {
       
   382 	    OstTrace0( TRACE_FATAL, CPARAFORMATLAYER_SENSEEFFECTIVEL, "ENullFormatPointer" );
       
   383 	    }
       
   384 	__ASSERT_ALWAYS(aParaFormat!=NULL,Panic(ENullFormatPointer));
   363 	__ASSERT_ALWAYS(aParaFormat!=NULL,Panic(ENullFormatPointer));
   385 	aParaFormat->Reset();
   364 	aParaFormat->Reset();
   386 	TParaFormatMask mask;
   365 	TParaFormatMask mask;
   387 	FillParaFormatL(aParaFormat,mask,aMode);
   366 	FillParaFormatL(aParaFormat,mask,aMode);
   388 	CleanupEffectiveFormat(aParaFormat,mask);
   367 	CleanupEffectiveFormat(aParaFormat,mask);
   409 to the function, all attributes in the mask should be unset. 
   388 to the function, all attributes in the mask should be unset. 
   410 @param aMode Controls which attributes are written to aParaFormat. If 
   389 @param aMode Controls which attributes are written to aParaFormat. If 
   411 EAllAttributes, all attributes are written; if EFixedAttributes, tabs, bullets 
   390 EAllAttributes, all attributes are written; if EFixedAttributes, tabs, bullets 
   412 and borders are not written. */
   391 and borders are not written. */
   413 	{
   392 	{
   414 	if (aParaFormat==NULL)
       
   415 	    {
       
   416 	    OstTrace0( TRACE_FATAL, CPARAFORMATLAYER_SENSEL, "ENullFormatPointer" );
       
   417 	    }
       
   418 	__ASSERT_ALWAYS(aParaFormat!=NULL,Panic(ENullFormatPointer));
   393 	__ASSERT_ALWAYS(aParaFormat!=NULL,Panic(ENullFormatPointer));
   419 
   394 
   420 	iStore.SenseParaFormatL(*aParaFormat,aMask,aMode);
   395 	iStore.SenseParaFormatL(*aParaFormat,aMask,aMode);
   421 	}
   396 	}
   422 
   397