Fix for N_SE-32753
authorSaravana Balaji <saravana.bs@samsung.com>
Mon, 8 Apr 2013 17:39:24 +0000 (23:09 +0530)
committerSaravana Balaji <saravana.bs@samsung.com>
Tue, 9 Apr 2013 11:15:00 +0000 (16:45 +0530)
Change-Id: I0ccf316a2a415674825a7a04d1a0058a08e743ca
Signed-off-by: Saravana Balaji <saravana.bs@samsung.com>
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp
src/ui/inc/FUiCtrl_EditPresenter.h

index 55dd3f4..899a3ac 100755 (executable)
@@ -184,6 +184,7 @@ _EditPresenter::_EditPresenter(void)
        , __isCursorInitialized(false)
        , __isCursorDisabled(false)
        , __isInitialized(false)
+       , __isInitializing(false)
        , __isMovingCursorByTouchMove(false)
        , __isTouchMoving(false)
        , __isTouchPressed(false)
@@ -1325,6 +1326,8 @@ _EditPresenter::InitializeAtFirstDrawing(void)
 {
        result r = E_SUCCESS;
 
+       __isInitializing = true;
+
        Resize();
 
        InitializeParentPanel();
@@ -8413,13 +8416,14 @@ _EditPresenter::CalculateFlexibleHeightF(void)
 
                float maxHeight = CalculateMaximumFlexibleHeight();
 
-               if (expectedEditHeight >= maxHeight)
+               //If InitialBounds is more than expectedEdit height, set flexible height as initial height
+               if (expectedEditHeight < __initialBounds.height)
                {
-                       height = maxHeight;
+                       height = __initialBounds.height;
                }
-               else if (expectedEditHeight < __initialBounds.height)
+               else if (expectedEditHeight >= maxHeight)
                {
-                       height = __initialBounds.height;
+                       height = maxHeight;
                }
                else
                {
@@ -8515,6 +8519,11 @@ _EditPresenter::SetFlexBounds(const Rectangle& bounds)
 {
        result r = E_SUCCESS;
 
+       if (!__isInitializing)
+       {
+               return E_SUCCESS;
+       }
+
        _ExpandableEditAreaEventStatus expandableEditAreaStatus = _EXPANDABLE_EDITAREA_EVENT_ADDED;
        if (__pEdit->GetBounds().height > bounds.height)
        {
@@ -8556,6 +8565,11 @@ _EditPresenter::SetFlexBounds(const FloatRectangle& bounds)
 {
        result r = E_SUCCESS;
 
+       if (!__isInitializing)
+       {
+               return E_SUCCESS;
+       }
+
        _ExpandableEditAreaEventStatus expandableEditAreaStatus = _EXPANDABLE_EDITAREA_EVENT_ADDED;
        if (__pEdit->GetBoundsF().height > bounds.height)
        {
index 1c991f1..5f148c2 100755 (executable)
@@ -1306,8 +1306,6 @@ _TokenEditPresenter::InitializeTokenVisibilityAt(int ndex)
 float
 _TokenEditPresenter::GetMaxTextHeight(void)
 {
-       result r = E_SUCCESS;
-
        Font *pFont = null;
        float maxHeight = __editContentFontSize;
 
index 00b5044..2a7acd4 100644 (file)
@@ -518,6 +518,7 @@ private:
        bool __isCursorDisabled;
        // todo : check InitAtFirstDrawing
        bool __isInitialized;
+       bool __isInitializing;
        // todo : check
        bool __isMovingCursorByTouchMove;
        bool __isTouchMoving;