fixed bug(N_SE-46042, N_SE-46098)
authorChulheon <ch.jeong47@samsung.com>
Sun, 14 Jul 2013 07:43:11 +0000 (16:43 +0900)
committerChulheon <ch.jeong47@samsung.com>
Sun, 14 Jul 2013 07:43:11 +0000 (16:43 +0900)
Change-Id: I9a70f16d42c53833833a7ab506c1ba4e117b437d

src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_Keypad.cpp
src/ui/inc/FUiCtrl_Edit.h

index 57f052d..73466c0 100755 (executable)
@@ -2018,6 +2018,14 @@ _Edit::OnFocusLost(const _Control& source)
 }
 
 result
+_Edit::OnAttachingToMainTree(const _Control* pParent)
+{
+       __isDestroyed = false;
+
+       return E_SUCCESS;
+}
+
+result
 _Edit::OnAttachedToMainTree(void)
 {
        if (__isAccessibilityCreated)
index d842f9a..f696157 100644 (file)
@@ -274,8 +274,8 @@ _EditCopyPasteMagnifier::CaptureTextArea(Canvas& canvas)
        float captureHeight = 0.0f;
        float capturePosX = 0.0f;
        float capturePosY = 0.0f;
-       float adjustPoxX = 0.0f;
-       float adjustPoxY = 0.0f;
+       float adjustPosX = 0.0f;
+       float adjustPosY = 0.0f;
        FloatRectangle cursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle captureBounds(0.0f, 0.0f, 0.0f, 0.0f);
 
@@ -293,19 +293,27 @@ _EditCopyPasteMagnifier::CaptureTextArea(Canvas& canvas)
        GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_CAPTURE_POSITION_Y, pEdit->GetOrientation(), capturePosY);
 
        FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
-       captureBounds.x = cursorBounds.x - captureWidth/2.0f;
+
+       // textobject minimum width/height
+       if (pEdit->GetBoundsF().width < textObjectBounds.width)
+       {
+               textObjectBounds.width = pEdit->GetBoundsF().width - pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN) - pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+       }
+
+       captureBounds.x = cursorBounds.x + cursorBounds.width/2.0f - captureWidth/2.0f;
        captureBounds.y = cursorBounds.y + cursorBounds.height/2.0f - captureHeight/2.0f;
        captureBounds.width = captureWidth;
        captureBounds.height = captureHeight;
        captureBounds = textObjectBounds.GetIntersection(captureBounds);
 
-       if (captureBounds.width < captureWidth && captureBounds.x < textObjectBounds.x + textObjectBounds.width - captureBounds.width)
+       if ((cursorBounds.x + cursorBounds.width/2.0f) - captureBounds.x < captureWidth/2.0f)
        {
-               adjustPoxX = captureWidth - captureBounds.width;
+               adjustPosX = captureWidth/2.0f - (cursorBounds.x + cursorBounds.width/2.0f - captureBounds.x);
        }
+
        if (captureBounds.height < captureHeight && captureBounds.y < captureHeight)
        {
-               adjustPoxY = captureHeight - captureBounds.height;
+               adjustPosY = captureHeight - captureBounds.height;
        }
 
        Bitmap* pOriginalBitmp = pEdit->GetCapturedBitmapN(true);
@@ -324,7 +332,7 @@ _EditCopyPasteMagnifier::CaptureTextArea(Canvas& canvas)
        r = bitmap.Scale(CoordinateSystem::AlignToDevice(FloatDimension(bitmap.GetActualWidth()*1.5f, bitmap.GetActualHeight()*1.5f)));
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       canvas.DrawBitmap(CoordinateSystem::AlignToDevice(FloatPoint(capturePosX + adjustPoxX*1.5f, capturePosY + adjustPoxY*1.5f)), bitmap);
+       canvas.DrawBitmap(CoordinateSystem::AlignToDevice(FloatPoint(capturePosX + adjustPosX*1.5f, capturePosY + adjustPosY*1.5f)), bitmap);
 
        delete pOriginalBitmp;
 
index e72b0a1..7f1d2ce 100755 (executable)
@@ -6976,6 +6976,11 @@ _EditPresenter::ShowFullscreenKeypad(void)
 {
        result r = E_SUCCESS;
 
+       if (__isCopyPasteManagerExist)
+       {
+               InitializeCopyPasteManager();
+       }
+
        if (IsKeypadEnabled() == false)
        {
                __pEdit->SetFocused();
index a49499a..d7daef3 100755 (executable)
@@ -851,7 +851,6 @@ _Keypad::OnChangeLayout(_ControlOrientation orientation)
                {
                        GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
                        __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, portraitSize.width, indicatorheight));
-                       __pIndicator->SetIndicatorShowState(true);
                }
                else
                {
index f79c064..004a3ca 100755 (executable)
@@ -469,6 +469,7 @@ public:
        result SendTextEvent(CoreTextEventStatus textEventStatus);
 
        void OnScrollPanelBoundsChanged(void);
+       virtual result OnAttachingToMainTree(const _Control* pParent);
        virtual result OnAttachedToMainTree(void);
        virtual void OnBoundsChanged(void);
        virtual void OnChangeLayout(_ControlRotation rotation);