messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp
changeset 31 ebfee66fde93
child 47 5b14749788d7
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *       Provides CUniDataModel class methods.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 // ========== INCLUDE FILES ================================
       
    23 
       
    24 
       
    25 #include <eikenv.h>
       
    26 #include <eikdoc.h>
       
    27 
       
    28 #include <msvstd.h>                     // TMsvEntry
       
    29 #include <msvapi.h>
       
    30 #include <msvuids.h>                    // Msgs Uids
       
    31 #include <mtclbase.h>                   // CBaseMtm
       
    32 #include <mmsvattachmentmanager.h>
       
    33 #include <cmsvattachment.h>
       
    34 #include <cmsvmimeheaders.h>
       
    35 
       
    36 #include <bautils.h>
       
    37 
       
    38 /*
       
    39 #include <muiumsvuiserviceutilities.h>  //Disk space check
       
    40 #include <msgattachmentinfo.h>
       
    41 */
       
    42 
       
    43 #include <gmxmldocument.h>
       
    44 #include <gmxmlnode.h>
       
    45 #include <gmxmlelement.h>
       
    46 
       
    47 // Features
       
    48 #include <featmgr.h>
       
    49 #include <bldvariant.hrh>
       
    50 
       
    51 // MsgMedia
       
    52 #include <MsgMediaResolver.h>
       
    53 #include <MsgMediaInfo.h>
       
    54 #include <MsgTextInfo.h>
       
    55 
       
    56 #include <MmsConformance.h>
       
    57 
       
    58 #include "UniDataModel.h"
       
    59 #include "UniSmilModel.h"
       
    60 
       
    61 #include "UniDataUtils.h"
       
    62 #include "UniModelConst.h"
       
    63 #include "UniObjectList.h"
       
    64 #include "UniSmilList.h"
       
    65 #include "UniObject.h"
       
    66 #include "UniTextObject.h"
       
    67 #include "UniMimeInfo.h"
       
    68 
       
    69 #include "UniSmilUtils.h"
       
    70 //#include "UniEditorLogging.h"
       
    71 //#include "messagingvariant.hrh"
       
    72 #include "MsgMimeTypes.h"
       
    73 #include <e32base.h>
       
    74 
       
    75 // ========== CONSTANTS ====================================
       
    76 
       
    77 // ---------------------------------------------------------
       
    78 // CUniDataModel::Constructor
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 CUniDataModel::CUniDataModel( RFs& aFs, CBaseMtm& aMtm ) :
       
    82     iFs( aFs ),
       
    83     iMtm( aMtm ),
       
    84     iSmilModel( NULL ),
       
    85     iDom( NULL )
       
    86     {
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CUniDataModel::NewL
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 EXPORT_C CUniDataModel* CUniDataModel::NewL( RFs& aFs, CBaseMtm& aMtm )
       
    94     {
       
    95     CUniDataModel* self =  new ( ELeave ) CUniDataModel( aFs, aMtm );
       
    96     CleanupStack::PushL( self );
       
    97     self->ConstructL();
       
    98     CleanupStack::Pop( self );
       
    99     return self;
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------
       
   103 // CUniDataModel::ConstructL
       
   104 // ---------------------------------------------------------
       
   105 //
       
   106 EXPORT_C void CUniDataModel::ConstructL()
       
   107     {
       
   108 #ifdef _DEBUG_TRACES_
       
   109     qCritical() << " CUniDataModel ConstructL start";
       
   110 #endif
       
   111     iDataUtils = CUniDataUtils::NewL( iFs );
       
   112     iObjectList = CUniObjectList::NewL( iMtm, *iDataUtils );
       
   113     iAttachmentList = CUniObjectList::NewL( iMtm, *iDataUtils );
       
   114     iSmilList = CUniSmilList::NewL( iMtm );
       
   115     iSmilModel = CUniSmilModel::NewL( iFs, iMtm, *iDataUtils, *iObjectList );
       
   116 
       
   117     iMediaResolver = CMsgMediaResolver::NewL();
       
   118     iMediaResolver->SetCharacterSetRecognition( EFalse );
       
   119 
       
   120     iMmsConformance = CMmsConformance::NewL();
       
   121     iMmsConformance->CheckCharacterSet( EFalse );
       
   122     
       
   123 #ifdef _DEBUG_TRACES_
       
   124     qCritical() << " CUniDataModel ConstructL End";
       
   125 #endif
       
   126     }
       
   127 
       
   128 // ---------------------------------------------------------
       
   129 // CUniDataModel::~CUniDataModel
       
   130 //
       
   131 // Destructor.
       
   132 // ---------------------------------------------------------
       
   133 //
       
   134 EXPORT_C CUniDataModel::~CUniDataModel()
       
   135     {
       
   136     delete iMediaResolver;
       
   137     delete iMmsConformance;
       
   138     delete iSmilModel;
       
   139     delete iObjectList;
       
   140     delete iAttachmentList;
       
   141     delete iSmilList;
       
   142     delete iDataUtils;
       
   143     delete iParser;
       
   144     delete iDom;
       
   145     }
       
   146 
       
   147 // ---------------------------------------------------------
       
   148 // CUniDataModel::RestoreL
       
   149 //
       
   150 // Initialise the model.
       
   151 // ---------------------------------------------------------
       
   152 //
       
   153 EXPORT_C void CUniDataModel::RestoreL(
       
   154         MUniDataModelObserver& aObserver,
       
   155         TBool aRemoveCorrupted /*= ETrue*/,
       
   156         TBool aAllowSmil /*= ETrue*/ )
       
   157     {
       
   158     iObserver = &aObserver;
       
   159     iSmilType = ENoSmil;
       
   160 
       
   161     if ( iMtm.Entry().HasStoreL() )
       
   162     	{
       
   163         FindAndHandleCorruptL( aRemoveCorrupted );
       
   164 
       
   165         TBool readOnly = iMtm.Entry().Entry().ReadOnly();
       
   166         CMsvStore* store = readOnly
       
   167         	? iMtm.Entry().ReadStoreL()
       
   168         	: iMtm.Entry().EditStoreL();
       
   169         CleanupStack::PushL( store );
       
   170         MMsvAttachmentManager& manager = store->AttachmentManagerL();
       
   171         CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
       
   172 
       
   173         iParseResult = 0;
       
   174 
       
   175         iOrigAttachmentCount = manager.AttachmentCount();
       
   176 
       
   177         for ( TInt i = 0; i < iOrigAttachmentCount ; ++i )
       
   178             {
       
   179             CMsvAttachment* attachment = manager.GetAttachmentInfoL( i );
       
   180             CleanupStack::PushL( attachment );
       
   181             msvMime->RestoreL( *attachment );
       
   182 
       
   183             TBuf8<KMaxDataTypeLength> contentType;
       
   184             contentType.Copy( msvMime->ContentType() );
       
   185             contentType.Append( _L8("/") );
       
   186             contentType.Append( msvMime->ContentSubType() );
       
   187 
       
   188             // Put smil attas to own array, except if SendUi
       
   189             if ( aAllowSmil &&
       
   190                 contentType.CompareF( KMsgMimeSmil ) == 0 )
       
   191                 {
       
   192                 iSmilList->AddSmilAttachmentL( manager, attachment->Id() );
       
   193                 CleanupStack::PopAndDestroy( attachment );
       
   194                 continue;
       
   195                 }
       
   196 
       
   197             RFile readFile = manager.GetAttachmentFileL( i );
       
   198             CleanupClosePushL( readFile );
       
   199             CUniObject* newObj = CreateObjectFromAttachmentLC(
       
   200                 contentType,
       
   201                 readFile,
       
   202                 manager,
       
   203                 *attachment );
       
   204 
       
   205             if ( newObj->Attachment() )
       
   206                 {
       
   207                 iAttachmentList->AddObjectL( newObj );
       
   208                 }
       
   209             else
       
   210                 {
       
   211                 iObjectList->AddObjectL( newObj );
       
   212                 }
       
   213 
       
   214             CleanupStack::Pop( newObj );
       
   215             CleanupStack::PopAndDestroy( &readFile );
       
   216             CleanupStack::PopAndDestroy( attachment );
       
   217             } // for
       
   218 
       
   219         CleanupStack::PopAndDestroy( msvMime );
       
   220 
       
   221 
       
   222 
       
   223         //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit start");
       
   224 
       
   225 
       
   226         //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit end");
       
   227         CleanupStack::PopAndDestroy( store );
       
   228 
       
   229         if ( iSmilList->Count() == 1 )
       
   230             {
       
   231             RFile smilFile = iDataUtils->GetAttachmentFileL( iMtm, iSmilList->GetSmilAttachmentByIndex( 0 ) );
       
   232             iParser = CMDXMLParser::NewL( this );
       
   233             iParser->ParseFile( smilFile );
       
   234             if( !iObjWait.IsStarted() )
       
   235                 {
       
   236                 iObjWait.Start();
       
   237                 }
       
   238             }
       
   239         else
       
   240             {
       
   241             if ( iSmilList->Count() > 1 )
       
   242                 {
       
   243                 iSmilType = EMultipleSmil;
       
   244                 }
       
   245             iParseResult = iSmilModel->ParseL( NULL ); // Try to create something anyway
       
   246             
       
   247             FinalizeRestoreL( KErrNone );
       
   248             }
       
   249     	}
       
   250     else
       
   251     	{
       
   252         FinalizeRestoreL( KErrNone );
       
   253     	}
       
   254     }
       
   255 
       
   256 // ---------------------------------------------------------
       
   257 // CUniDataModel::AddAttachmentL
       
   258 // ---------------------------------------------------------
       
   259 //
       
   260 EXPORT_C CUniObject* CUniDataModel::AddAttachmentL(
       
   261         MUniObjectSaveObserver& aObserver,
       
   262         CMsgMediaInfo* aMedia,
       
   263         CMsvAttachment::TMsvAttachmentType aSaveType /*= CMsvAttachment::EMsvLinkedFile*/ )
       
   264     {
       
   265     CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia );
       
   266 
       
   267     // Update attachment list
       
   268     iAttachmentList->AddObjectL( obj );
       
   269     obj->SetAttachment( ETrue );
       
   270 
       
   271     CleanupStack::Pop( obj );
       
   272     obj->Save( aObserver, aSaveType );
       
   273 
       
   274     return obj;
       
   275     }
       
   276 
       
   277 // ---------------------------------------------------------
       
   278 // CUniDataModel::AddStoredAttachmentL
       
   279 // ---------------------------------------------------------
       
   280 //
       
   281 EXPORT_C CUniObject* CUniDataModel::AddStoredAttachmentL( TMsvAttachmentId aAttachmentId,
       
   282                                                           CMsgMediaInfo* aMedia )
       
   283     {
       
   284     CMsvStore* store = iMtm.Entry().EditStoreL();
       
   285     CleanupStack::PushL( store );
       
   286 
       
   287     MMsvAttachmentManager& manager = store->AttachmentManagerL();
       
   288     MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
       
   289     CMsvAttachment* attachment = manager.GetAttachmentInfoL( aAttachmentId );
       
   290     CleanupStack::PushL( attachment );
       
   291 
       
   292     CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia, manager, *attachment );
       
   293 
       
   294     managerSync.ModifyAttachmentInfoL( attachment );
       
   295     CleanupStack::Pop( 2, attachment ); //obj, attachment
       
   296     CleanupStack::PushL( obj );
       
   297     store->CommitL();
       
   298 
       
   299     // Update attachment list
       
   300     iAttachmentList->AddObjectL( obj );
       
   301     obj->SetAttachment( ETrue );
       
   302 
       
   303     CleanupStack::Pop( obj );
       
   304     CleanupStack::PopAndDestroy( store );
       
   305     return obj;
       
   306     }
       
   307 
       
   308 // ---------------------------------------------------------
       
   309 // CUniDataModel::FinalizeMediaParse
       
   310 // ---------------------------------------------------------
       
   311 //
       
   312 EXPORT_C void CUniDataModel::FinalizeMediaParse()
       
   313     {
       
   314     while ( iObjectToParse )
       
   315         {
       
   316         if ( !iObjWait.IsStarted() )
       
   317             {
       
   318             iObjWait.Start();
       
   319             }
       
   320         }
       
   321     }
       
   322 
       
   323 // ---------------------------------------------------------
       
   324 // CUniDataModel::MediaInfoParsed
       
   325 // ---------------------------------------------------------
       
   326 //
       
   327 void CUniDataModel::MediaInfoParsed()
       
   328     {
       
   329     if ( iObjectToParse->MediaInfo()->Corrupt() )
       
   330         {
       
   331         iObjectToParse->SetCorrupted( ETrue );
       
   332         }
       
   333     ParseNextObject();
       
   334     if ( iObjWait.IsStarted() )
       
   335         {
       
   336         iObjWait.AsyncStop();
       
   337         }
       
   338   //  CActiveScheduler::Stop();
       
   339     }
       
   340 
       
   341 // ---------------------------------------------------------
       
   342 // CUniDataModel::ParseNextObject
       
   343 // ---------------------------------------------------------
       
   344 //
       
   345 void CUniDataModel::ParseNextObject()
       
   346     {
       
   347     CUniObjectList* list = iObjectList;
       
   348 
       
   349     while ( list )
       
   350         {
       
   351         for ( TInt i = 0; i < list->Count(); ++i )
       
   352             {
       
   353             iObjectToParse = list->GetByIndex( i );
       
   354             if ( !iObjectToParse->MediaInfo()->Parsed() &&
       
   355                  !iObjectToParse->MediaInfo()->ParseError() )
       
   356                 {
       
   357                 RFile file;
       
   358                 TRAPD( error, file = iDataUtils->GetAttachmentFileL( iMtm, iObjectToParse->AttachmentId() ) );
       
   359 
       
   360                 if ( error == KErrNone )
       
   361                     {
       
   362                     iObjectToParse->MediaInfo()->ParseInfoDetails( file, *( iMediaResolver->DRMHelper() ), *this );
       
   363                    // CActiveScheduler::Start();
       
   364                     file.Close();
       
   365                     return;
       
   366                     }
       
   367                 else
       
   368                     {
       
   369                     iObjectToParse->SetCorrupted( ETrue );
       
   370                     file.Close();
       
   371                     }
       
   372                 }
       
   373             }
       
   374         if ( list == iObjectList )
       
   375             {
       
   376             list = iAttachmentList;
       
   377             }
       
   378         else
       
   379             {
       
   380             list = NULL;
       
   381             }
       
   382         }
       
   383    iObjectToParse = NULL;
       
   384    }
       
   385 
       
   386 // ---------------------------------------------------------
       
   387 // CUniDataModel::ParseFileCompleteL
       
   388 // ---------------------------------------------------------
       
   389 //
       
   390 void CUniDataModel::ParseFileCompleteL()
       
   391     {
       
   392     TRAPD( err, DoParseFileCompleteL() );
       
   393     FinalizeRestoreL( err );
       
   394     }
       
   395 
       
   396 // ---------------------------------------------------------
       
   397 // CUniDataModel::DoParseFileCompleteL
       
   398 // ---------------------------------------------------------
       
   399 //
       
   400 void CUniDataModel::DoParseFileCompleteL()
       
   401     {
       
   402     iDom = iParser->DetachXMLDoc();
       
   403     iSmilType = UniSmilUtils::GetSmilTypeL( iDom );
       
   404     if ( iSmilType == ENoSmil )
       
   405         {
       
   406         iParseResult = iSmilModel->ParseL( NULL );
       
   407         }
       
   408     else if ( iSmilType == EMmsSmil )
       
   409         {
       
   410         TRAPD( err, ( iParseResult = iSmilModel->ParseL( iDom ) ) );
       
   411         if ( err )
       
   412             {
       
   413             iSmilType = E3GPPSmil;
       
   414             iParseResult = 0;
       
   415             FindDomObjectRefCountsL();
       
   416             }
       
   417         }
       
   418     else
       
   419         {
       
   420         FindDomObjectRefCountsL();
       
   421         }
       
   422     }
       
   423 
       
   424 
       
   425 // ---------------------------------------------------------
       
   426 // CUniDataModel::FinalizeRestoreL
       
   427 // ---------------------------------------------------------
       
   428 //
       
   429 void CUniDataModel::FinalizeRestoreL( TInt aError )
       
   430     {
       
   431     if ( !aError )
       
   432         {
       
   433         // Won't leave.
       
   434         FindAttachmentsL();
       
   435         }
       
   436     iObserver->RestoreReady( iParseResult, aError );
       
   437 
       
   438     ParseNextObject();
       
   439     
       
   440     if ( iObjWait.IsStarted() )
       
   441         {
       
   442         iObjWait.AsyncStop();
       
   443         }
       
   444     
       
   445     }
       
   446 
       
   447 // ---------------------------------------------------------
       
   448 // CUniSmilModel::FindAttachmentsL
       
   449 //
       
   450 //
       
   451 // ---------------------------------------------------------
       
   452 //
       
   453 void CUniDataModel::FindAttachmentsL()
       
   454     {
       
   455     for ( TInt i = iObjectList->Count(); --i >= 0; )
       
   456         {
       
   457         CUniObject* obj = iObjectList->GetByIndex( i );
       
   458         if ( !obj->ReferenceCount() )
       
   459             {
       
   460             //don't remove from store -> cannot leave
       
   461             iObjectList->RemoveObjectL( obj, EFalse );
       
   462             iAttachmentList->AddObjectL( obj );
       
   463             obj->SetAttachment( ETrue );
       
   464             }
       
   465         }
       
   466     }
       
   467 
       
   468 // ---------------------------------------------------------
       
   469 // FindAndHandleCorruptL
       
   470 //
       
   471 // ---------------------------------------------------------
       
   472 void CUniDataModel::FindAndHandleCorruptL( TBool aRemoveCorrupted )
       
   473     {
       
   474     CMsvEntrySelection* corSel = FindCorruptLC();
       
   475     iCorruptedCount = corSel->Count();
       
   476 
       
   477     if ( iCorruptedCount > 0 )
       
   478         {
       
   479         if ( aRemoveCorrupted )
       
   480             {
       
   481             CMsvStore* store = iMtm.Entry().EditStoreL();
       
   482             CleanupStack::PushL( store );
       
   483             MMsvAttachmentManager& manager = store->AttachmentManagerL();
       
   484             MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
       
   485 
       
   486             for (TInt i = iCorruptedCount; --i >= 0 ;)
       
   487                 {
       
   488                 // Editor tries to recover by deleting corrupted ones
       
   489                 // Note: This means that SMIL parsing will fail with ESmil_Missing_Objects.
       
   490                 //       and object order is not maintained. But better to do it this
       
   491                 //       way so that message can be opened.
       
   492                 TRAP_IGNORE ( managerSync.RemoveAttachmentL(
       
   493                     CUniDataUtils::IndexPositionOfAttachmentL( manager, corSel->At( i ) ) ) );
       
   494                 }
       
   495             store->CommitL();
       
   496             CleanupStack::PopAndDestroy( store );
       
   497             }
       
   498         else
       
   499             {
       
   500             // In viewer case consider message corrupted and leave.
       
   501             // Model not made viewer should exit.
       
   502             User::Leave( KErrCorrupt );
       
   503             }
       
   504         }
       
   505 
       
   506     CleanupStack::PopAndDestroy( corSel );
       
   507     }
       
   508 
       
   509 // ---------------------------------------------------------
       
   510 // FindCorruptLC
       
   511 //
       
   512 // ---------------------------------------------------------
       
   513 CMsvEntrySelection* CUniDataModel::FindCorruptLC()
       
   514     {
       
   515     CMsvEntrySelection* corrupts = new(ELeave) CMsvEntrySelection();
       
   516     CleanupStack::PushL( corrupts );
       
   517 
       
   518     if ( iMtm.Entry().HasStoreL() )
       
   519     	{
       
   520         CMsvStore* store = iMtm.Entry().ReadStoreL();
       
   521         CleanupStack::PushL( store );
       
   522         MMsvAttachmentManager& manager = store->AttachmentManagerL();
       
   523 
       
   524         TInt count = manager.AttachmentCount();
       
   525         for( TInt i = count; --i >= 0; )
       
   526             {
       
   527             CMsvAttachment* atta = manager.GetAttachmentInfoL( i );
       
   528             TMsvAttachmentId attaId = atta->Id();
       
   529             delete atta;
       
   530 
       
   531             RFile attaFile;
       
   532             TRAPD( err, attaFile = manager.GetAttachmentFileL( attaId ) );
       
   533             // if error, hardly no need to close
       
   534             attaFile.Close();
       
   535             if ( err )
       
   536                 {
       
   537                 corrupts->AppendL( attaId );
       
   538                 }
       
   539             }
       
   540 
       
   541         CleanupStack::PopAndDestroy( store );
       
   542     	}
       
   543     return corrupts;
       
   544     }
       
   545 
       
   546 // ---------------------------------------------------------
       
   547 // CreateObjectFromAttachmentLC
       
   548 //
       
   549 // ---------------------------------------------------------
       
   550 CUniObject* CUniDataModel::CreateObjectFromAttachmentLC(
       
   551                             const TPtrC8&               aMimeType,
       
   552                             RFile&                      aFile,
       
   553                             MMsvAttachmentManager&      aManager,
       
   554                             CMsvAttachment&             aAttachment )
       
   555     {
       
   556     // Linked attachments are handles similarly as ordinary ones.
       
   557     CUniObject* object = NULL;
       
   558     CMsgMediaInfo* info = NULL;
       
   559     if ( aMimeType.CompareF( KMsgMimeTextPlain ) == 0 )
       
   560         {
       
   561         TDataType mimeType( aMimeType );
       
   562         info = iMediaResolver->CreateMediaInfoL( aFile, mimeType );
       
   563         }
       
   564     else
       
   565         {
       
   566         info = iMediaResolver->CreateMediaInfoL( aFile );
       
   567         }
       
   568 
       
   569     if ( info->MediaType() == EMsgMediaText ||
       
   570          info->MediaType() == EMsgMediaXhtml )
       
   571         {
       
   572         object = CUniTextObject::NewLC(
       
   573             iFs,
       
   574             iMtm,
       
   575             *iDataUtils,
       
   576             static_cast< CMsgTextInfo* >( info ),
       
   577             aManager,
       
   578             aAttachment );
       
   579         }
       
   580     else
       
   581         {
       
   582         object = CUniObject::NewLC(
       
   583             iFs,
       
   584             iMtm,
       
   585             *iDataUtils,
       
   586             info,
       
   587             aManager,
       
   588             aAttachment );
       
   589         }
       
   590     // Media info is to be parsed asynchronously!
       
   591 
       
   592     return object;
       
   593     }
       
   594 
       
   595 // ---------------------------------------------------------
       
   596 // GetDomObjectRefCounts
       
   597 //
       
   598 // ---------------------------------------------------------
       
   599 void CUniDataModel::FindDomObjectRefCountsL()
       
   600     {
       
   601     CMDXMLNode* node = iDom->DocumentElement()->FirstChild();
       
   602     CUniObject* obj = NULL;
       
   603 
       
   604     while ( node )
       
   605         {
       
   606         if ( UniSmilUtils::IsMediaElem( node ) ) // Filtering of structural nodes.
       
   607             {
       
   608             obj = iObjectList->GetByNodeL( node );
       
   609             if ( obj )
       
   610                 {
       
   611                 obj->SetReferenceCount( obj->ReferenceCount() + 1 );
       
   612                 }
       
   613 
       
   614             }
       
   615         node = UniSmilUtils::NextNode( node );
       
   616         }
       
   617 
       
   618     }
       
   619 
       
   620 //  End of File