From 896f39812aff9ef51088b09325b48edcbe49b401 Mon Sep 17 00:00:00 2001 From: Bumseung Cho Date: Wed, 8 May 2013 15:54:15 +0900 Subject: [PATCH] Empty value in theme xml will be ignored. Change-Id: Id314eee56d9d2837186b0cc93f0d74987058afb2 Signed-off-by: Bumseung Cho --- src/ui/resource/FUi_ResourceConfigParser.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ui/resource/FUi_ResourceConfigParser.cpp b/src/ui/resource/FUi_ResourceConfigParser.cpp index 022cbe4..7520e54 100644 --- a/src/ui/resource/FUi_ResourceConfigParser.cpp +++ b/src/ui/resource/FUi_ResourceConfigParser.cpp @@ -654,11 +654,14 @@ ConfigParser::AddImage(const xmlChar** pAttributes) if (__pMapContainer->GetImageMap()->GetValue(resourceKey, pItem) == E_SUCCESS) { int len = ((char*) pAttributes[i]+1 != null) ? mbstowcs(null, (char*) pAttributes[i]+1, 0) : 0; - wchar_t* pValue = new (std::nothrow) wchar_t [len +1]; - len = mbstowcs(pValue, (char*) pAttributes[i]+1, len); - pValue[len] = '\0'; - pItem->SetImageFileName(pValue); - __pMapContainer->GetImageMap()->ChangeValue(resourceKey, pItem); + if(len > 0) + { + wchar_t* pValue = new (std::nothrow) wchar_t [len +1]; + len = mbstowcs(pValue, (char*) pAttributes[i]+1, len); + pValue[len] = '\0'; + pItem->SetImageFileName(pValue); + __pMapContainer->GetImageMap()->ChangeValue(resourceKey, pItem); + } } else { @@ -722,8 +725,11 @@ ConfigParser::AddAnimationFrame(const xmlChar** pAttributes) { if (xmlStrcasecmp(pAttributes[i], (xmlChar*) "Image") == 0) { - fileName = (char*) pAttributes[++i]; - fileName.SubString(1, fileName); + int len = ((char*) pAttributes[i+1]+1 != null) ? mbstowcs(null, (char*) pAttributes[i+1]+1, 0) : 0; + if(len > 0) + { + fileName = (char*) pAttributes[++i]+1; + } } if (xmlStrcasecmp(pAttributes[i], (xmlChar*) "Duration") == 0) { -- 2.7.4