Create string tightly when retrive string from cbhm
authorTaeyun An <ty.an@samsung.com>
Tue, 9 Jul 2013 05:33:27 +0000 (14:33 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 10 Jul 2013 03:11:09 +0000 (03:11 +0000)
[Title] Create string tightly when retrive string from cbhm
[Issue#] DCM-1658
[Problem] \u0000 null value is inserted at the end of string.
[Cause] Included null value string length is returned when use XGetWindowProperty API.
[Solution] Create string tightly when retrive string from cbhm

Change-Id: Ifc48ac491a33f0953b808029f45841c4a8174751

Source/WebKit2/UIProcess/API/efl/tizen/ClipboardHelper.cpp

index 81b5b10..6e6d6d7 100755 (executable)
@@ -696,14 +696,14 @@ String ClipboardHelper::getCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property,
         return String();
     }
 
-    String chbmData;
+    String cbhmData;
 
     switch (dataUnitSize) {
     case 8:
-        chbmData = String::fromUTF8(pData, dataLength);
+        cbhmData = String::fromUTF8(pData);
         break;
     case 16:
-        chbmData = String(reinterpret_cast<UChar*>(pData), dataLength);
+        cbhmData = String(reinterpret_cast<UChar*>(pData), dataLength);
         LOG_ERROR("case 16");
         break;
     case 32:
@@ -718,7 +718,7 @@ String ClipboardHelper::getCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property,
     if (pDataType)
         *pDataType = type;
 
-    return chbmData;
+    return cbhmData;
 }
 
 bool ClipboardHelper::retrieveClipboardItem(int index, int* format, String* pData)