--- a/src/hbcore/effects/hbeffectxmlparser.cpp Thu May 27 13:10:59 2010 +0300
+++ b/src/hbcore/effects/hbeffectxmlparser.cpp Fri Jun 11 13:58:22 2010 +0300
@@ -46,7 +46,7 @@
Constructor.
*/
HbEffectXmlParser::HbEffectXmlParser()
- :mFxmlData(0)
+ : mFxmlData(0)
{
}
@@ -74,7 +74,7 @@
qWarning("HbEffectXmlParser: Document element is invalid (not <layers>");
raiseError("HbEffectXmlParser::read The document is not an valid effect definitions document.");
}
- }
+ }
}
if (error()) {
@@ -141,8 +141,9 @@
readNext();
if (isEndElement()) {
- if (name() == FXML_LAYERS)
+ if (name() == FXML_LAYERS) {
break;
+ }
}
if (isStartElement()) {
@@ -152,14 +153,11 @@
else if (name() == FXML_LAYERGROUP) {
// Not needed
- }
- else if (name() == FXML_BLENDING) {
+ } else if (name() == FXML_BLENDING) {
readBlendingElement();
- }
- else if (name() == FXML_COMMENT) {
+ } else if (name() == FXML_COMMENT) {
// Comments are skipped
- }
- else if (name() == FXML_FILTER) {
+ } else if (name() == FXML_FILTER) {
#ifdef HB_FILTER_EFFECTS
readFilterData();
#endif
@@ -186,13 +184,11 @@
if (isStartElement()) {
if (name() == FXML_PARAM) {
mFxmlData->appendParamData(readParamData());
- }
- else if (name() == FXML_FILTER) {
+ } else if (name() == FXML_FILTER) {
#ifdef HB_FILTER_EFFECTS
readFilterData();
#endif
- }
- else {
+ } else {
readUnknownElement();
}
}
@@ -211,7 +207,7 @@
// Parse filter type
QXmlStreamAttributes attrs = attributes();
- foreach (const QXmlStreamAttribute &attr, attrs) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
// "type" = ...
if (attr.name().toString() == FXML_PARAM_TYPE) {
filterData.setType(attr.value().toString());
@@ -247,18 +243,18 @@
// This parses information inside one <param> field.
// E.g. "scale_x", "scale_y", "scale_origin_x"
-//
+//
HbEffectFxmlParamData HbEffectXmlParser::readParamData()
{
Q_ASSERT(isStartElement() && name() == FXML_PARAM);
-
+
HbEffectFxmlParamData param(mFxmlData->memoryType());
HbKeyFrame kf(mFxmlData->memoryType());
QXmlStreamAttributes attrs = attributes();
// Populate the PARAM attributes
- foreach (const QXmlStreamAttribute &attr, attrs) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
// "name" = ...
if (attr.name().toString() == FXML_PARAM_NAME) {
param.setName(attr.value().toString());
@@ -293,7 +289,7 @@
// <marker> tag
else if (name() == FXML_MARKER) {
QXmlStreamAttributes attrs = attributes();
-
+
enum {
Undefined = 0,
Start,
@@ -301,7 +297,7 @@
} loopType = Undefined;
// Fetch "type" attribute from <marker> tag
- foreach (const QXmlStreamAttribute &attr, attrs) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
if (attr.name().toString() == FXML_PARAM_TYPE) {
QString s = attr.value().toString();
if (s == FXML_LOOP_START) {
@@ -315,7 +311,7 @@
if (loopType != Undefined) {
// Fetch "at" attribute from <marker> tag
- foreach (const QXmlStreamAttribute &attr, attrs) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
if (attr.name().toString() == FXML_PARAM_AT) {
QString s = attr.value().toString();
bool ok = false;
@@ -343,11 +339,11 @@
// <keyframe> tag
else if (name() == FXML_KEYFRAME) {
QXmlStreamAttributes attrs = attributes();
-
+
bool ok = false;
// Fetch "at" attribute from <keyframe> tag
- foreach (const QXmlStreamAttribute &attr, attrs) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
if (attr.name().toString() == FXML_PARAM_AT) {
QString s = attr.value().toString();
kf.pos = s.toFloat(&ok);
@@ -373,27 +369,26 @@
}
}
//<start> element
- else if(name() == FXML_KEYWORD_START) {
+ else if (name() == FXML_KEYWORD_START) {
QXmlStreamAttributes attrs = attributes();
- foreach (const QXmlStreamAttribute &attr, attrs) {
- if( attr.name() == FXML_PARAM_REF ) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
+ if (attr.name() == FXML_PARAM_REF) {
param.setStartRef(attr.value().toString());
}
}
param.setAttribute(FXML_KEYWORD_START, readElementText());
}
//<end> element
- else if(name() == FXML_KEYWORD_END) {
+ else if (name() == FXML_KEYWORD_END) {
QXmlStreamAttributes attrs = attributes();
- foreach (const QXmlStreamAttribute &attr, attrs) {
- if( attr.name() == FXML_PARAM_REF ) {
+ foreach(const QXmlStreamAttribute & attr, attrs) {
+ if (attr.name() == FXML_PARAM_REF) {
param.setEndRef(attr.value().toString());
}
}
param.setAttribute(FXML_KEYWORD_END, readElementText());
- }
- else {
+ } else {
readUnknownElement();
}
}