integrate code from master to tizen_2.1
[platform/framework/native/json.git] / src / FWebJson_JsonWriterImpl.cpp
index d247c7e..52ae101 100644 (file)
@@ -97,8 +97,7 @@ _JsonWriterImpl::Compose(const IJsonValue* pValue, void* pBuffer, int bufferLeng
        SysTryReturn(NID_WEB_JSON, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        unique_ptr<char[]> pText(_StringConverter::CopyToCharArrayN(output));
-       r = GetLastResult();
-       SysTryReturn(NID_WEB_JSON, pText.get(), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       SysTryReturn(NID_WEB_JSON, pText.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
        int charCount = strlen(pText.get());
        charCount = (charCount <= bufferLength) ? charCount : bufferLength;
@@ -119,8 +118,7 @@ _JsonWriterImpl::Compose(const IJsonValue* pValue, ByteBuffer& buffer)
        SysTryReturn(NID_WEB_JSON, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        unique_ptr<ByteBuffer> pByteBuf(StringUtil::StringToUtf8N(output));
-       r = GetLastResult();
-       SysTryReturn(NID_WEB_JSON, pByteBuf.get(), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       SysTryReturn(NID_WEB_JSON, pByteBuf.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
        if (buffer.GetPointer())
        {
@@ -168,8 +166,7 @@ _JsonWriterImpl::ConvertIJsonToString(IJsonValue* pValue, String& outString)
                        JsonObject* pObject = static_cast<JsonObject*>(pValue);
 
                        unique_ptr<JsonMapEnumerator> pMapEnum(pObject->GetMapEnumeratorN());
-                       r = GetLastResult();
-                       SysTryReturn(NID_WEB_JSON, pMapEnum.get(), r, r, "[%s] Propagating.", GetErrorMessage(r));
+                       SysTryReturn(NID_WEB_JSON, pMapEnum.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
                        int itemCount = pObject->GetCount();