From: Youngbok Shin Date: Wed, 12 Sep 2018 07:48:39 +0000 (+0900) Subject: lottie/parser: fix code indentations and a duplicated code X-Git-Tag: submit/tizen/20180917.042405~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02cb018c75085481f9a19a392f3b5522d775dde5;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/parser: fix code indentations and a duplicated code Change-Id: I01280529f6ada36ded67a31d24833049762f52ca --- diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp index 5aa6158..6afbee0 100644 --- a/src/lottie/lottieparser.cpp +++ b/src/lottie/lottieparser.cpp @@ -746,9 +746,7 @@ std::shared_ptr LottieParserImpl::parseLayer() parenting and expressions.*/ RAPIDJSON_ASSERT(PeekType() == kNumberType); layer->mId = GetInt(); - } else if (0 == - strcmp(key, - "parent")) { /*Layer Parent. Uses "ind" of parent.*/ + } else if (0 == strcmp(key, "parent")) { /*Layer Parent. Uses "ind" of parent.*/ RAPIDJSON_ASSERT(PeekType() == kNumberType); layer->mParentId = GetInt(); } else if (0 == strcmp(key, "refId")) { /*preComp Layer reference id*/ @@ -789,8 +787,6 @@ std::shared_ptr LottieParserImpl::parseLayer() layer->mSolidLayer.mColor = toColor(GetString()); } else if (0 == strcmp(key, "tt")) { layer->mMatteType = getMatteType(); - } else if (0 == strcmp(key, "tt")) { - layer->mMatteType = getMatteType(); } else if (0 == strcmp(key, "hasMask")) { layer->mHasMask = GetBool(); } else if (0 == strcmp(key, "masksProperties")) { @@ -1865,31 +1861,31 @@ class LOTDataInspector { public: void visit(LOTCompositionData *obj, std::string level) { - vDebug <<" { " - <isStatic() + vDebug << " { " + << level + << "Composition:: a: " << !obj->isStatic() << ", v: " << obj->mVersion - << ", stFm: "<< obj->startFrame() - << ", endFm: "<< obj->endFrame()<<"\n"; + << ", stFm: " << obj->startFrame() + << ", endFm: " << obj->endFrame()<< "\n"; level.append("\t"); visit(obj->mRootLayer.get(), level); - level.erase(level.end() -1 , level.end()); - vDebug << " } " <mLayerType) + << "{ " + << layerType(obj->mLayerType) << ", id:" << obj->mId << " Pid:" << obj->mParentId << ", a:" << !obj->isStatic() << ", inFm:" << obj->mInFrame << ", outFm:" << obj->mOutFrame - <<"\n"; + << "\n"; visitChildren(static_cast(obj), level); vDebug << level - <<"} " - <mLayerType).c_str() + << "} " + << layerType(obj->mLayerType).c_str() << ", id: " << obj->mId << "\n"; } void visitChildren(LOTGroupData *obj, std::string level) @@ -1901,15 +1897,15 @@ public: void visit(LOTData *obj, std::string level) { switch (obj->mType) { case LOTData::Type::Repeater: { - vDebug << level<<"{ Repeater:"; + vDebug << level << "{ Repeater:"; visitChildren(static_cast(obj), level); - vDebug << level<<"} Repeater"; + vDebug << level << "} Repeater"; break; } case LOTData::Type::ShapeGroup: { - vDebug << level <<"{ ShapeGroup: a:" << !obj->isStatic(); + vDebug << level << "{ ShapeGroup: a:" << !obj->isStatic(); visitChildren(static_cast(obj), level); - vDebug << level <<"} ShapeGroup"; + vDebug << level << "} ShapeGroup"; break; } case LOTData::Type::Layer:{ @@ -1917,44 +1913,44 @@ public: break; } case LOTData::Type::Trim:{ - vDebug << level<<"{ Trim: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Trim: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Rect:{ - vDebug <isStatic() << " }"; + vDebug << level << "{ Rect: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Ellipse:{ - vDebug << level<<"{ Ellipse: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Ellipse: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Shape:{ - vDebug << level<<"{ Shape: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Shape: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Polystar:{ - vDebug << level<<"{ Polystar: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Polystar: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Transform:{ - vDebug << level<<"{ Transform: a: " << !obj->isStatic() << " }"; + vDebug << level << "{ Transform: a: " << !obj->isStatic() << " }"; break; } case LOTData::Type::Stroke:{ - vDebug << level<<"{ Stroke: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Stroke: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::GStroke:{ - vDebug << level<<"{ GStroke: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ GStroke: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::Fill:{ - vDebug << level<<"{ Fill: a:" << !obj->isStatic() << " }"; + vDebug << level << "{ Fill: a:" << !obj->isStatic() << " }"; break; } case LOTData::Type::GFill:{ auto f = static_cast(obj); - vDebug << level<<"{ GFill: a:" << !f->isStatic() + vDebug << level << "{ GFill: a:" << !f->isStatic() << ", ty:" << f->mGradientType << ", s:" << f->mStartPoint.value(0) << ", e:" << f->mEndPoint.value(0) << " }"; break; @@ -2012,7 +2008,7 @@ std::shared_ptr LottieParser::model() #ifdef DEBUG_PRINT_TREE LOTDataInspector inspector; - inspector.visit(model->mRoot.get(),""); + inspector.visit(model->mRoot.get(), ""); #endif return model;