224 aResourceReader.ReadUint32L(); // skip over LONG reserved_long |
224 aResourceReader.ReadUint32L(); // skip over LONG reserved_long |
225 aResourceReader.ReadUint32L(); // skip over LLINK reserved_llink |
225 aResourceReader.ReadUint32L(); // skip over LLINK reserved_llink |
226 |
226 |
227 // read LTEXT caption |
227 // read LTEXT caption |
228 PtrC16* viewCaption = aResourceReader.ReadTPtrCL(); |
228 PtrC16* viewCaption = aResourceReader.ReadTPtrCL(); |
|
229 |
229 if(NULL != viewCaption) |
230 if(NULL != viewCaption) |
230 { |
231 { |
231 viewData->SetCaptionL(viewCaption); |
232 viewData->SetCaptionL(viewCaption); |
232 |
233 |
233 viewCaption->iPtr = NULL; //To Avoid double delete in destructor. To be destroyed by RResourceReader. |
234 viewCaption->iPtr = NULL; //To Avoid double delete in destructor. To be destroyed by RResourceReader. |
237 const TInt numOfViewIcons = aResourceReader.ReadInt16L(); |
238 const TInt numOfViewIcons = aResourceReader.ReadInt16L(); |
238 viewData->SetNumOfViewIcons(numOfViewIcons); |
239 viewData->SetNumOfViewIcons(numOfViewIcons); |
239 |
240 |
240 // read LTEXT icon_file |
241 // read LTEXT icon_file |
241 PtrC16* viewIconFile = aResourceReader.ReadTPtrCL(); |
242 PtrC16* viewIconFile = aResourceReader.ReadTPtrCL(); |
|
243 |
242 if(NULL != viewIconFile) |
244 if(NULL != viewIconFile) |
243 { |
245 { |
244 |
246 ConvertToPlatformSpecificPath(viewIconFile->iPtr, viewIconFile->iMaxLength); |
245 Ptr16* fullViewIconFileName = ViewDataIconFileNameL(viewIconFile); |
247 Ptr16* fullViewIconFileName = ViewDataIconFileNameL(viewIconFile); |
246 if (fullViewIconFileName) |
248 if (fullViewIconFileName) |
247 { |
249 { |
248 viewData->SetIconFileNameL(fullViewIconFileName); |
250 viewData->SetIconFileNameL(fullViewIconFileName); |
249 viewData->SetNonMbmIconFile(true); |
251 viewData->SetNonMbmIconFile(true); |
285 * aIconFileName may contain a valid string in some format (for eg. URI format) other than path to a regular file on disk |
287 * aIconFileName may contain a valid string in some format (for eg. URI format) other than path to a regular file on disk |
286 * and that can be a mbm or non-mbm file. Such a filename will be reported as invalid filename by iFs.IsValidName() method. |
288 * and that can be a mbm or non-mbm file. Such a filename will be reported as invalid filename by iFs.IsValidName() method. |
287 * aIconFileName will be returned since it is a valid string. |
289 * aIconFileName will be returned since it is a valid string. |
288 */ |
290 */ |
289 ParsePtrC parsePtr(aIconFileName); |
291 ParsePtrC parsePtr(aIconFileName); |
290 if (parsePtr.IsWild() || !parsePtr.PathPresent() || !parsePtr.NamePresent()) |
292 |
|
293 if ( parsePtr.IsWild() || !parsePtr.PathPresent() || !parsePtr.NamePresent() ) |
|
294 { |
|
295 parsePtr.SetToNull(); |
291 return NULL; |
296 return NULL; |
|
297 } |
292 |
298 |
293 filename = new Ptr16(aIconFileName->iMaxLength); |
299 filename = new Ptr16(aIconFileName->iMaxLength); |
294 if(NULL==filename || NULL == filename->GetPtr()) |
300 if(NULL==filename || NULL == filename->GetPtr()) |
295 { |
301 { |
|
302 parsePtr.SetToNull(); |
296 std::string errMsg= "Failed : Error in Reading File. Memory Allocation Failed"; |
303 std::string errMsg= "Failed : Error in Reading File. Memory Allocation Failed"; |
297 throw CResourceFileException(errMsg); |
304 throw CResourceFileException(errMsg); |
298 } |
305 } |
299 filename->UpdateLength(aIconFileName->iMaxLength); |
306 filename->UpdateLength(aIconFileName->iMaxLength); |
300 BufCpy(filename->GetPtr(),aIconFileName->iPtr,aIconFileName->iMaxLength); |
307 BufCpy(filename->GetPtr(),aIconFileName->iPtr,aIconFileName->iMaxLength); |