fixed bug N_SE-41602
authorChulheon <ch.jeong47@samsung.com>
Sat, 15 Jun 2013 07:22:54 +0000 (16:22 +0900)
committerChulheon <ch.jeong47@samsung.com>
Sat, 15 Jun 2013 07:22:54 +0000 (16:22 +0900)
Change-Id: I6c0811194a77a8d0bd6536b4eec0f4edd5cf82fa

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp

index 312f682..1dcab12 100644 (file)
@@ -1909,6 +1909,11 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
                return;
        }
 
+       if (__pEdit->GetTextLength() == 0 && (__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER))
+       {
+               return;
+       }
+
        __contextMenuHeight = contextMenuHeight + contextMenuTopMargin + contextMenuBottomMargin + contextMenuArrowHeight;
        if (isClipped && __pEdit->IsViewModeEnabled() == false && __pEdit->GetTextLength() > 0 && orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
index bc43328..a460484 100755 (executable)
@@ -2779,7 +2779,8 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec
                cursorBounds.height -= cursorHeightDiff;
        }
 
-       if (cursorBounds.y + cursorBounds.height > textBounds.y + textBounds.height)
+       if ((cursorBounds.y + cursorBounds.height > textBounds.y + textBounds.height) &&
+               (cursorBounds.y < textBounds.y + textBounds.height))
        {
                float cursorHeightDiff = cursorBounds.y + cursorBounds.height - textBounds.y - textBounds.height - 1.0f;
                cursorBounds.height -= cursorHeightDiff;
@@ -2887,7 +2888,8 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec
                cursorBounds.height -= cursorHeightDiff;
        }
 
-       if (cursorBounds.y + cursorBounds.height > textBounds.y + textBounds.height)
+       if ((cursorBounds.y + cursorBounds.height > textBounds.y + textBounds.height) &&
+               (cursorBounds.y < textBounds.y + textBounds.height))
        {
                float cursorHeightDiff = cursorBounds.y + cursorBounds.height - textBounds.y - textBounds.height - 1.0f;
                cursorBounds.height -= cursorHeightDiff;
@@ -3288,7 +3290,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
                                }
                        }
 
-                       if (!__isUSBKeyboardConnected && !__isKeypadExist)
+                       if (!__isUSBKeyboardConnected && !__isKeypadExist && !IsViewModeEnabled())
                        {
                                needToCreatePopup = false;
                        }
@@ -4472,6 +4474,8 @@ _EditPresenter::OnLongPressGestureDetected(void)
 {
        SysLog(NID_UI_CTRL, "OnLongPressGestureDetected");
 
+       __isTouchPressed = false;
+
        _AccessibilityManager* pAccessibilityManager = _AccessibilityManager::GetInstance();
        SysTryReturn(NID_UI_CTRL, pAccessibilityManager, false, E_SYSTEM, "pAccessibilityManager is null");
        if (pAccessibilityManager->IsActivated())
@@ -4494,7 +4498,6 @@ _EditPresenter::OnLongPressGestureDetected(void)
                return true;
        }
 
-       __isTouchPressed = false;
        FloatRectangle cursorBounds;
        InitializeCopyPasteManager();
        if (IsClipped() || GetTextLength())
@@ -5521,14 +5524,14 @@ _EditPresenter::DeleteText(int startCursorPosition, int endCursorPosition)
                __pTextBuffer[i] = 0;
        }
 
-       SetCursorPosition(startCursorPosition);
-
        AdjustRTLTextAlignment(EDIT_TEXT_TYPE_INPUT);
 
        __pTextObject->SetRange(startCursorPosition, endCursorPosition - startCursorPosition);
        r = __pTextObject->NotifyTextChanged(__pTextBuffer, 0, currentLength, -(endCursorPosition - startCursorPosition));
        r = __pTextObject->Compose();
 
+       SetCursorPosition(startCursorPosition);
+
        if (__pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE)
        {
                AdjustFlexibleHeight();