commonuis/CommonUi/src/DocumentHandler.cpp
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 10 9f56a4e1b8ab
--- a/commonuis/CommonUi/src/DocumentHandler.cpp	Tue Feb 02 01:00:49 2010 +0200
+++ b/commonuis/CommonUi/src/DocumentHandler.cpp	Fri Feb 19 23:04:46 2010 +0200
@@ -1398,10 +1398,20 @@
             {
             User::LeaveIfError(aSharableFile.Open(iSharableFS,aFileName,EFileShareReadersOrWriters));
             }
-        else if ( err != KErrNone )
-            {
-            error = err; // Otherwise possible KErrNotReady caused by hotswap leads to crash later
-            }
+        else if ( err == KErrTooBig )
+        	{
+			RFile64* file64 = NULL;
+			file64 = static_cast<RFile64*> (&aSharableFile);
+			if( file64 != NULL )
+				{
+				err = file64->Open(iSharableFS,aFileName,EFileShareReadersOnly);
+				if( err == KErrInUse )
+					{
+					User::LeaveIfError(aSharableFile.Open(iSharableFS,aFileName,EFileShareReadersOrWriters));
+					}
+				}
+        	}
+        error = err; // Otherwise possible KErrNotReady caused by hotswap leads to crash later           
         }
     #ifdef _DEBUG
     RDebug::Print( _L("DocumentHandler: CDocumentHandler::OpenTempFileL: finished with error=%d."), error);