<tizen:box-icon /> element's occurrence should be 0 or 1
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 26 Sep 2013 14:41:00 +0000 (16:41 +0200)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Fri, 27 Sep 2013 08:54:12 +0000 (17:54 +0900)
[Issue#]   WGL-572
[Problem]  Valid <tizen:box-icon /> element should occur as 0 or 1 time.
[Cause]    Missing proper routine to check this condition.
[Solution] Add routine to check the previous occurrence.

[Verification]
    * Install widget attached to issue: https://bugs.tizendev.org/jira/browse/WGL-572
    * Installation should fail at parsing config.xml.

Change-Id: I9fccb31f77974cfe379d697622d57b4766d49398

src/configuration_parser/widget_parser.cpp

index 6a6b6c4..084ad0e 100644 (file)
@@ -1672,6 +1672,10 @@ class AppWidgetParser : public ElementParser
                 ThrowMsg(Exception::ParseError,
                     "src attribute of box-icon element is mandatory - ignoring");
             }
+            if (!m_data.m_icon.empty()) {
+                ThrowMsg(Exception::ParseError,
+                    "<tizen:box-icon /> element should occur as 0 or 1 time");
+            }
             m_data.m_icon = m_icon;
         }