Fixed a defect on Locales and Text
authorHokwon Song <hokwon.song@samsung.com>
Tue, 2 Apr 2013 00:49:22 +0000 (09:49 +0900)
committerHokwon Song <hokwon.song@samsung.com>
Tue, 2 Apr 2013 00:49:22 +0000 (09:49 +0900)
Change-Id: I13ebe6e928c942f0d57e81006c88ccbccca28793
Signed-off-by: Hokwon Song <hokwon.song@samsung.com>
src/locales/FLclCalendar.cpp
src/text/FText_GsmEncodingCore.cpp

index 5def2d3..90005d9 100644 (file)
@@ -185,7 +185,7 @@ Calendar::Equals(const Object& obj) const
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
 
        const Calendar* pOtherInstance = dynamic_cast< const Calendar* >(&obj);
-       if ((pOtherInstance == null) || (pOtherInstance->_pCalendarImpl == null))
+       if ((pOtherInstance == null) || (pOtherInstance->_pCalendarImpl == null) || GetType() != pOtherInstance->GetType())
        {
                return false;
        }
index 4208682..53146f1 100644 (file)
@@ -289,6 +289,11 @@ _GsmEncodingCore::EncodeN(const wchar_t* pSrc, int srcLength, int& retLength)
 wchar_t*
 _GsmEncodingCore::DecodeN(const byte* pSrc, int srcLength, int& retLength)
 {
+       if (srcLength > 1 && pSrc && pSrc[srcLength - 1] == '\0')
+       {
+               --srcLength;
+       }
+
        result r = GetCharCount(pSrc, srcLength, retLength);
        SysTryReturn(NID_TEXT, !IsFailed(r), null, r, "[%s] Encoding failed", GetErrorMessage(r));