Revision: 201035 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 11:59:08 +0300
branchRCL_3
changeset 49 a7ccb69868af
parent 45 cbffe13eac63
child 54 156dce2f0a3b
Revision: 201035 Kit: 201036
csxhelp/HelpEngine/src/CSXHRuntimeIndexing.cpp
--- a/csxhelp/HelpEngine/src/CSXHRuntimeIndexing.cpp	Wed Sep 01 12:30:56 2010 +0100
+++ b/csxhelp/HelpEngine/src/CSXHRuntimeIndexing.cpp	Wed Sep 15 11:59:08 2010 +0300
@@ -132,7 +132,12 @@
     // rename to index.xml. otherwise, the old index file still exists.
     //
     des.Append( KMasterMetaTmpFile );
-    iFile.Replace( fileSession, des, EFileWrite );
+    TInt err = KErrNone;
+    err = iFile.Replace( fileSession, des, EFileWrite );
+    if ( KErrNone != err || 0 == iFile.SubSessionHandle() )
+        {
+        return;
+        }
     
     HBufC8* driveInfo = HBufC8::NewLC( KMaxDriveInfo );
     TPtr8 ptr = driveInfo->Des();
@@ -146,6 +151,10 @@
     
 void CCSXHRuntimeIndexing::FinishAndCloseIndexFileL()
     {
+    if ( 0 == iFile.SubSessionHandle() )
+        {
+        return;
+        }
     RFs& fileSession = iCoeEnv->FsSession();
     iFile.Write( KIndexCollectEnd );
     iFile.Close();  
@@ -186,6 +195,10 @@
       
 void CCSXHRuntimeIndexing::RuntimeGenerateIndexL( const CCSXHHtmlTOC1& aToc1, const TDesC& aFeature )
     {
+    if ( 0 == iFile.SubSessionHandle() )
+        {
+        return;
+        }
     // Form into an entry, like
     // <collection FeatureID="-1" id="0x10005951" navtitle="Bluetooth"></collection>
     HBufC8* appName = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aToc1.GetName() );