mobilemessaging/unieditor/application/src/UniEditorSaveOperation.cpp
changeset 2 0bf1d54f37d9
parent 0 72b543305e3a
child 5 4697dfb2d7ad
equal deleted inserted replaced
1:d09ac5c1e252 2:0bf1d54f37d9
   381     // Open store even if we didn't need it here.
   381     // Open store even if we didn't need it here.
   382     // -> We don't need to check later whether the store is open or not.
   382     // -> We don't need to check later whether the store is open or not.
   383     iEditStore = iDocument.Mtm().Entry().EditStoreL();
   383     iEditStore = iDocument.Mtm().Entry().EditStoreL();
   384     if ( iComposeSmil )
   384     if ( iComposeSmil )
   385         {
   385         {
   386         iDocument.DataModel()->SmilList().RemoveSmilL( *iEditStore );
   386          if( !(iSaveType == ESendingSave && iDocument.UniState() == EUniSms) )
   387         if ( iSaveType == ESendingSave )
   387              {
   388             {
   388 	        iDocument.DataModel()->SmilList().RemoveSmilL( *iEditStore );
   389             iDocument.DataModel()->SmilModel().RemoveEmptySlides();
   389 	        if ( iSaveType == ESendingSave )
   390             }
   390 	            {
       
   391 	            iDocument.DataModel()->SmilModel().RemoveEmptySlides();
       
   392 	            }
   391             
   393             
   392         if ( iDocument.DataModel()->SmilModel().SlideCount() != 0 )
   394 	        if ( iDocument.DataModel()->SmilModel().SlideCount() != 0 )
   393             {
   395 	            {
   394             // Model is not empty -> Compose new SMIL
   396 	            // Model is not empty -> Compose new SMIL
   395             iDom = iDocument.DataModel()->SmilModel().ComposeL();
   397 	            iDom = iDocument.DataModel()->SmilModel().ComposeL();
   396             iDocument.DataModel()->SmilList().CreateSmilAttachmentL( *this, *iEditStore, iDom );
   398 	            iDocument.DataModel()->SmilList().CreateSmilAttachmentL( *this, *iEditStore, iDom );
   397             SetPending();
   399 	            SetPending();
   398             return;
   400 	            return;
   399             }
   401 	            }
       
   402              }
   400         }
   403         }
   401         
   404         
   402     iOperationState = EUniEditorSaveFinalize;
   405     iOperationState = EUniEditorSaveFinalize;
   403     CompleteSelf( KErrNone );
   406     CompleteSelf( KErrNone );
   404     }
   407     }
   655     else
   658     else
   656         {
   659         {
   657         
   660         
   658         TBuf<KUniMaxDescription> description;
   661         TBuf<KUniMaxDescription> description;
   659         description.Zero();
   662         description.Zero();
   660         length = subject.Length();
   663         length = subject.Length();     
   661         CMsgExpandableControl* header = static_cast<CMsgExpandableControl*>( iView.ControlById( EMsgComponentIdSubject ) );
       
   662         
       
   663         // Saving as pure text from the editor which may contain emoticons.
   664         // Saving as pure text from the editor which may contain emoticons.
   664         HBufC *text = header->Editor().GetTextInHBufL();
   665         HBufC *text = iHeader.SubjectControl()->Editor().GetTextInHBufL();
   665         CleanupStack::PushL( text );
   666         CleanupStack::PushL( text );
   666         description.Copy( text->Ptr(), length );
   667         description.Copy( text->Ptr(), length );
   667         CleanupStack::PopAndDestroy( text );
   668         CleanupStack::PopAndDestroy( text );
   668        
   669        
   669 
   670