add size check for app widget(ignore not supported sizes)
authorjungmin76.park <jungmin76.park@samsung.com>
Fri, 19 Apr 2013 07:17:03 +0000 (16:17 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Fri, 19 Apr 2013 07:17:03 +0000 (16:17 +0900)
Change-Id: I35453c8213b032a6666bf4b678236915fdaa8ec2
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
src/XmlHandler/Parser/ManifestLiveboxesParser.cpp
src/XmlHandler/Parser/ManifestLiveboxesParser.h

index 0a4c3ff..8deedcc 100755 (executable)
@@ -211,8 +211,30 @@ ManifestLiveboxesParser::OnLiveboxEndElement(void)
 }
 
 bool
+ManifestLiveboxesParser::IsValidSize(const char *pCharacters)
+{
+       if (strcasecmp(pCharacters, "1x1") == 0
+         || strcasecmp(pCharacters, "2x1") == 0
+         || strcasecmp(pCharacters, "2x2") == 0
+         || strcasecmp(pCharacters, "4x1") == 0
+         || strcasecmp(pCharacters, "4x2") == 0
+         || strcasecmp(pCharacters, "4x3") == 0
+         || strcasecmp(pCharacters, "4x4") == 0 )
+       {
+               return true;
+       }
+       return false;
+}
+
+bool
 ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
 {
+       if( IsValidSize(pCharacters) == false)
+       {
+               AppLog("  <Size>%s</Size> <-- The size isn't supported by native c++ app widget, so ignored.", pCharacters);
+               return true;
+       }
+
        ManifestHandler* pHandler = GetHandler();
        TryReturn(pHandler, false, "pHandler is null");
 
index 2c409a3..7bb00f9 100755 (executable)
@@ -58,6 +58,8 @@ private:
        bool OnDisplayNameValue(const char *pCharacters);
        bool OnConfigurationAppControlAppIdValue(const char* pCharacters);
 
+       static bool IsValidSize(const char *pCharacters);
+
 private:
        AppData* __pAppData;
        Tizen::Base::Collection::ArrayList* __pLiveboxDataList;