metadataengine/server/src/mdsclausebuffer.cpp
branchRCL_3
changeset 14 646a02f170b9
parent 0 c53acadfccc6
child 40 910a23996aa0
equal deleted inserted replaced
8:6752808b2036 14:646a02f170b9
    60 // ConstructL
    60 // ConstructL
    61 // ---------------------------------------------------------------------------
    61 // ---------------------------------------------------------------------------
    62 //
    62 //
    63 void CMdsClauseBuffer::ConstructL( TInt aInitialSize )
    63 void CMdsClauseBuffer::ConstructL( TInt aInitialSize )
    64     {
    64     {
    65     if ( aInitialSize < 1 )
    65     if ( aInitialSize < 1 || aInitialSize > 100000 )
    66     	{
    66     	{
    67     	aInitialSize = 1;
    67     	aInitialSize = 1;
    68     	}
    68     	}
    69     iCurrentBufSize = aInitialSize;
    69     iCurrentBufSize = aInitialSize;
    70     if (aInitialSize > 100000 || aInitialSize < 0)
       
    71     	{
       
    72     	aInitialSize = 0;
       
    73     	}
       
    74 
    70 
    75     iBuffer = HBufC::NewL( iCurrentBufSize );
    71     iBuffer = HBufC::NewL( iCurrentBufSize );
    76     }
    72     }
    77 
    73 
    78 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
   102     if ( iCurrentBufSize >= aRequired  )
    98     if ( iCurrentBufSize >= aRequired  )
   103         {
    99         {
   104         return EFalse;
   100         return EFalse;
   105         }
   101         }
   106 
   102 
       
   103     // realloc and copy
       
   104     iBuffer = iBuffer->ReAllocL( aRequired );
       
   105     
   107 	iCurrentBufSize = aRequired;
   106 	iCurrentBufSize = aRequired;
   108 
       
   109     // realloc and copy
       
   110     iBuffer = iBuffer->ReAllocL( iCurrentBufSize );
       
   111 
   107 
   112     return ETrue;
   108     return ETrue;
   113     }
   109     }
   114 
   110 
   115 // ---------------------------------------------------------------------------
   111 // ---------------------------------------------------------------------------