fixed bug (N_SE-40366/P130607-2431)
authorChulheon <ch.jeong47@samsung.com>
Thu, 20 Jun 2013 10:19:28 +0000 (19:19 +0900)
committerChulheon <ch.jeong47@samsung.com>
Thu, 20 Jun 2013 10:19:28 +0000 (19:19 +0900)
Change-Id: Id9e23cb72acb4790735461607e8eb3ee6b7295f6

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUiCtrl_EditCopyPasteManager.h
src/ui/resource/FUi_ResourceEditConfig.cpp

index 84969db..b8e74d7 100644 (file)
@@ -537,7 +537,9 @@ _EditCopyPasteHandler::CreateCopyPasteMagnifier(void)
                        pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, cursorBounds);                 
                }
                __pCopyPasteMagnifier = _EditCopyPasteMagnifier::CreateInstanceN(FloatPoint(cursorBounds.x, cursorBounds.y), __handlerCursorPos, __pCopyPasteManager);
-               SysTryReturn(NID_UI_CTRL, pEdit, false, E_INVALID_STATE, "[E_INVALID_STATE] pEdit is null.\n");
+               SysTryReturn(NID_UI_CTRL, __pCopyPasteMagnifier, false, E_INVALID_STATE, "[E_INVALID_STATE] __pCopyPasteMagnifier is null.\n");
+
+               __pCopyPasteMagnifier->SetRowColumnIndex(__rowIndex, __columnIndex);
        }
        return true;
 }
@@ -2552,6 +2554,7 @@ _EditCopyPasteManager::OnActionPerformed(const _Control& source, int actionId)
                break;
 
        case COPY_PASTE_COPY_ID:
+               ReleaseCopyPastePopup();
                SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_COPY);
                break;
 
@@ -2566,6 +2569,7 @@ _EditCopyPasteManager::OnActionPerformed(const _Control& source, int actionId)
        case COPY_PASTE_CLIPBOARD_ID:
                __needToReleaseBlock = false;
                pClipBoard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
+               ReleaseCopyPastePopup();
                SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_CLIPBOARD);
                break;
        case COPY_PASTE_SEARCH_ID:
@@ -2826,4 +2830,34 @@ _EditCopyPasteManager::GetCopyPastePopup(void) const
        return __pCopyPastePopup;
 }
 
+void
+_EditCopyPasteManager::GetHandlerRowColumnIndex(bool singleHandler, bool leftHandler, int& rowIndex, int& columnIndex) const
+{
+       HandlerType handlerType = HANDLER_TYPE_MAX;
+       if (singleHandler)
+       {
+               handlerType = HANDLER_TYPE_CENTER;
+       }
+       else if (leftHandler)
+       {
+               handlerType = HANDLER_TYPE_LEFT;
+       }
+       else
+       {
+               handlerType = HANDLER_TYPE_RIGHT;
+       }
+
+       if (__pHandle[handlerType])
+       {
+               __pHandle[handlerType]->GetHandlerRowColumnIndex(rowIndex, columnIndex);
+       }
+       else
+       {
+               rowIndex = -1;
+               columnIndex = -1;
+       }
+
+       return;
+}
+
 }}} // Tizen::Ui::Controls
index b505853..2c0192a 100755 (executable)
@@ -1965,6 +1965,11 @@ _EditPresenter::DrawTextBlockLine(Canvas& canvas)
        }
        int startRange = 0;
        int lengthRange = 0;
+       int rowIndex = -1;
+       int columnIndex = -1;
+
+       Color textBlockLineColor;
+       GET_COLOR_CONFIG(EDIT::CURSOR_NORMAL, textBlockLineColor);
 
        GetBlockRange(startRange, lengthRange);
 
@@ -1972,9 +1977,20 @@ _EditPresenter::DrawTextBlockLine(Canvas& canvas)
        FloatRectangle textObjectBounds = __textObjectBounds;
        textObjectBounds.x -= 1;
        textObjectBounds.width = textObjectBounds.width + 2;
-       CalculateCursorBounds(__textObjectBounds, cursorBounds, startRange);
-       Color textBlockLineColor;
-       GET_COLOR_CONFIG(EDIT::CURSOR_NORMAL, textBlockLineColor);
+
+       if (__pCopyPasteManager)
+       {
+               __pCopyPasteManager->GetHandlerRowColumnIndex(false, true, rowIndex, columnIndex);
+       }
+
+       if (rowIndex != -1 && columnIndex != -1)
+       {
+               CalculateCursorBounds(__textObjectBounds, cursorBounds, rowIndex, columnIndex);
+       }
+       else
+       {
+               CalculateCursorBounds(__textObjectBounds, cursorBounds, startRange);
+       }
 
        if (cursorBounds.x != -1)
        {
@@ -1984,9 +2000,16 @@ _EditPresenter::DrawTextBlockLine(Canvas& canvas)
                canvas.FillRectangle(textBlockLineColor, cursorBounds);
        }
 
-       if (__rowCursorIndex != -1 && __columnCursorIndex != -1)
+       rowIndex = -1;
+       columnIndex = -1;
+
+       if (__pCopyPasteManager)
        {
-               CalculateCursorBounds(__textObjectBounds, cursorBounds, __rowCursorIndex, __columnCursorIndex); 
+               __pCopyPasteManager->GetHandlerRowColumnIndex(false, false, rowIndex, columnIndex);
+       }
+       if (rowIndex != -1 && columnIndex != -1)
+       {
+               CalculateCursorBounds(__textObjectBounds, cursorBounds, rowIndex, columnIndex);
        }
        else
        {
@@ -4492,6 +4515,11 @@ _EditPresenter::OnLongPressGestureDetected(void)
                {
                        SetCursorPosition(cursorPos);
                }
+               else
+               {
+                       cursorPos = GetTextLength();
+                       SetCursorPosition(cursorPos);
+               }
                ScrollPanelToCursorPosition();
                GetCursorBounds(true, cursorBounds);
 
@@ -7634,18 +7662,21 @@ _EditPresenter::OnEditCopyPasteStatusChanged(CoreCopyPasteStatus status, CoreCop
                        break;
                case CORE_COPY_PASTE_ACTION_CUT:
                        __pEdit->CutText();
+                       InitializeCopyPasteManager();
                        break;
                case CORE_COPY_PASTE_ACTION_PASTE:
                        __pEdit->PasteText();
+                       InitializeCopyPasteManager();
                        break;
                case CORE_COPY_PASTE_ACTION_SEARCH:
+                       InitializeCopyPasteManager();
+                       break;
                case CORE_COPY_PASTE_ACTION_CLIPBOARD:
                        __clipboardConnected = true;
-               //fall through
+                       break;
                default:
                        break;
        }
-       InitializeCopyPasteManager();
        __pEdit->Invalidate();
 
        return;
@@ -10117,10 +10148,12 @@ _EditPresenter::GetWordPosition(int cursorPos, int& startPos, int& endPos) const
        {
                cursorPos--;
        }
-
-       if (IsDelimiter(__pTextBuffer[cursorPos]) && cursorPos > 0)
+       else
        {
-               cursorPos--;
+               if (IsDelimiter(__pTextBuffer[cursorPos]) && cursorPos > 0)
+               {
+                       cursorPos--;
+               }
        }
 
        for (int i = cursorPos; i >= 0; i--)
index 3ee3bf0..071e233 100644 (file)
@@ -119,6 +119,7 @@ public:
        Tizen::Graphics::Rectangle GetEditVisibleArea(void) const;
        Tizen::Graphics::FloatRectangle GetEditVisibleAreaF(void) const;
        _ContextMenu* GetCopyPastePopup(void) const;
+       void GetHandlerRowColumnIndex(bool singleHandler, bool leftHandler, int& rowIndex, int& columnIndex) const;
 private:
        _EditCopyPasteManager(const _EditCopyPasteManager& value);
        _EditCopyPasteManager& operator =(const _EditCopyPasteManager& value);
index 961c025..8d088c1 100644 (file)
@@ -40,7 +40,7 @@ START_UI_CONFIG(EDIT);
        ADD_COLOR_CONFIG(CLEAR_ICON_PRESSED, $B042);
        ADD_COLOR_CONFIG(CUT_LINK_TEXT_NORMAL, $B052L5);
        ADD_COLOR_CONFIG(CUT_LINK_BG_NORMAL, $B0217);
-       ADD_COLOR_CONFIG(CURSOR_NORMAL, $F011L12);
+       ADD_COLOR_CONFIG(CURSOR_NORMAL, $F052);
 
        ADD_IMAGE_CONFIG(BG_NORMAL, #00_edit_field_no_line_square_bg.#.png);
        ADD_IMAGE_CONFIG(BG_PRESSED, #00_edit_field_no_line_square_bg.#.png);