textrendering/texthandling/stext/TXTGLOBL.CPP
changeset 44 601ab138ba0b
parent 0 1fb32624e06b
child 55 336bee5c2d35
equal deleted inserted replaced
37:6be019398652 44:601ab138ba0b
    22 
    22 
    23 #include "TXTFMLYR.H"
    23 #include "TXTFMLYR.H"
    24 #include "TXTGLOBL.H"
    24 #include "TXTGLOBL.H"
    25 
    25 
    26 #include "TXTSTD.H"
    26 #include "TXTSTD.H"
       
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "TXTGLOBLTraces.h"
       
    30 #endif
       
    31 
    27 
    32 
    28 /**
    33 /**
    29 @internalAll
    34 @internalAll
    30 */
    35 */
    31 EXPORT_C void MLayDoc::MLayDoc_Reserved_1() {}
    36 EXPORT_C void MLayDoc::MLayDoc_Reserved_1() {}
    54 ESegmentedStorage. 
    59 ESegmentedStorage. 
    55 @param aDefaultTextGranularity Specifies the granularity of the in-memory buffer. 
    60 @param aDefaultTextGranularity Specifies the granularity of the in-memory buffer. 
    56 Default is EDefaultTextGranularity bytes (=256). 
    61 Default is EDefaultTextGranularity bytes (=256). 
    57 @return Pointer to the global text object. */
    62 @return Pointer to the global text object. */
    58 	{
    63 	{
       
    64 	if (aGlobalParaLayer==NULL)
       
    65 	    {
       
    66 	    OstTrace0( TRACE_FATAL, CGLOBALTEXT_NEWL, "ENullFormatLayerHandle" );
       
    67 	    }
    59 	__ASSERT_ALWAYS(aGlobalParaLayer!=NULL,Panic(ENullFormatLayerHandle));
    68 	__ASSERT_ALWAYS(aGlobalParaLayer!=NULL,Panic(ENullFormatLayerHandle));
       
    69 	if (aGlobalCharLayer==NULL)
       
    70 	    {
       
    71 	    OstTrace0( TRACE_FATAL, DUP1_CGLOBALTEXT_NEWL, "ENullFormatLayerHandle" );
       
    72 	    }
    60 	__ASSERT_ALWAYS(aGlobalCharLayer!=NULL,Panic(ENullFormatLayerHandle));
    73 	__ASSERT_ALWAYS(aGlobalCharLayer!=NULL,Panic(ENullFormatLayerHandle));
    61 
    74 
    62 	CGlobalText* self=new(ELeave) CGlobalText(aGlobalParaLayer,aGlobalCharLayer);
    75 	CGlobalText* self=new(ELeave) CGlobalText(aGlobalParaLayer,aGlobalCharLayer);
    63 	CleanupStack::PushL(self);
    76 	CleanupStack::PushL(self);
    64 	self->ConstructL(aStorage,aDefaultTextGranularity);
    77 	self->ConstructL(aStorage,aDefaultTextGranularity);
    72 										TDocumentStorage aStorage)
    85 										TDocumentStorage aStorage)
    73 /** Returns a handle to a new instance of this class, whose textual content is 
    86 /** Returns a handle to a new instance of this class, whose textual content is 
    74 restored from the specified read-stream.  The global text object *uses* (does 
    87 restored from the specified read-stream.  The global text object *uses* (does 
    75 not own) the supplied global format layers.*/
    88 not own) the supplied global format layers.*/
    76 	{
    89 	{
       
    90 	if (aGlobalParaLayer==NULL)
       
    91 	    {
       
    92 	    OstTrace0( TRACE_FATAL, DUP2_CGLOBALTEXT_NEWL, "ENullFormatLayerHandle" );
       
    93 	    }
    77 	__ASSERT_ALWAYS(aGlobalParaLayer!=NULL,Panic(ENullFormatLayerHandle));
    94 	__ASSERT_ALWAYS(aGlobalParaLayer!=NULL,Panic(ENullFormatLayerHandle));
       
    95 	if (aGlobalCharLayer==NULL)
       
    96 	    {
       
    97 	    OstTrace0( TRACE_FATAL, DUP3_CGLOBALTEXT_NEWL, "ENullFormatLayerHandle" );
       
    98 	    }
    78 	__ASSERT_ALWAYS(aGlobalCharLayer!=NULL,Panic(ENullFormatLayerHandle));
    99 	__ASSERT_ALWAYS(aGlobalCharLayer!=NULL,Panic(ENullFormatLayerHandle));
    79 
   100 
    80 	CGlobalText* self=new(ELeave) CGlobalText(aGlobalParaLayer,aGlobalCharLayer);
   101 	CGlobalText* self=new(ELeave) CGlobalText(aGlobalParaLayer,aGlobalCharLayer);
    81 	CleanupStack::PushL(self);
   102 	CleanupStack::PushL(self);
    82 	self->ConstructL(aStore,aStreamId,aFactory,aStorage);
   103 	self->ConstructL(aStore,aStreamId,aFactory,aStorage);
   233 @param aView On return, a constant pointer to a portion of the text. 
   254 @param aView On return, a constant pointer to a portion of the text. 
   234 @param aFormat On return, contains the text object's effective character 
   255 @param aFormat On return, contains the text object's effective character 
   235 formatting. 
   256 formatting. 
   236 @param aStartPos The start position for the view. */
   257 @param aStartPos The start position for the view. */
   237 	{
   258 	{
       
   259 	if (aStartPos<0 || aStartPos>DocumentLength())
       
   260 	    {
       
   261 	    OstTrace0( TRACE_FATAL, CGLOBALTEXT_GETCHARS, "ECharPosBeyondDocument" );
       
   262 	    }
   238 	__ASSERT_ALWAYS(aStartPos>=0 && aStartPos<=DocumentLength(),Panic(ECharPosBeyondDocument));
   263 	__ASSERT_ALWAYS(aStartPos>=0 && aStartPos<=DocumentLength(),Panic(ECharPosBeyondDocument));
   239 
   264 
   240 	aView.Set(Read(aStartPos));
   265 	aView.Set(Read(aStartPos));
   241 	iGlobalCharFormatLayer->SenseEffective(aFormat);
   266 	iGlobalCharFormatLayer->SenseEffective(aFormat);
   242 	OverrideFormatOfInlineTextIfApplicable(aView,aFormat,aStartPos);
   267 	OverrideFormatOfInlineTextIfApplicable(aView,aFormat,aStartPos);