fixed prevent
authorChulheon <ch.jeong47@samsung.com>
Mon, 13 May 2013 05:29:29 +0000 (14:29 +0900)
committerChulheon <ch.jeong47@samsung.com>
Mon, 13 May 2013 05:29:29 +0000 (14:29 +0900)
Change-Id: I4e774f77b72415ef3295e8c297b06d31eaf64520

src/ui/controls/FUiCtrl_Edit.cpp

index 87de922..346d4ae 100644 (file)
@@ -596,70 +596,31 @@ _Edit::GetContentSizeInternalF(void) const
        FloatRectangle previousRect = pTextObject->GetBoundsF();
        FloatRectangle newRect = previousRect;
 
-       bool fitToHorizontal = false;
-       bool fitToVertical = true;
-
-       if (fitToHorizontal)
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-               {
-                       newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width;
-               }
-               else
-               {
-                       newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height;
-               }
-               newRect.width -= (GetBoundsF().x + leftMargin + rightMargin);
+               newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().height;
        }
-       if (fitToVertical)
+       else
        {
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-               {
-                       newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().height;
-               }
-               else
-               {
-                       newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().width;
-               }
-               newRect.height -= (GetBoundsF().y + textTopMargin + textBottomMargin);
+               newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().width;
        }
+       newRect.height -= (GetBoundsF().y + textTopMargin + textBottomMargin);
 
        pTextObject->SetBounds(newRect);
        pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
        pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        pTextObject->Compose();
 
-       if (fitToHorizontal && fitToVertical)
+       float height = pTextObject->GetTotalHeightF();
+       if (height < newRect.height)
        {
-               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
-               float height = pTextObject->GetTotalHeightF();
-               if (height < newRect.height)
-               {
-                       dimension.height = height;
-               }
-               else
-               {
-                       dimension.height = newRect.height;
-               }
-       }
-       else if (fitToHorizontal)
-       {
-               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
-               dimension.height = GetBoundsF().height;
+               dimension.height = height;
        }
-       else if (fitToVertical)
+       else
        {
-               float height = pTextObject->GetTotalHeightF();
-               if (height < newRect.height)
-               {
-                       dimension.height = height;
-               }
-               else
-               {
-                       dimension.height = newRect.height;
-               }
-               dimension.width = newRect.width;
+               dimension.height = newRect.height;
        }
+       dimension.width = newRect.width;
 
        // restore
        pTextObject->SetBounds(previousRect);
@@ -667,14 +628,7 @@ _Edit::GetContentSizeInternalF(void) const
        pTextObject->SetWrap(previousWrapType);
        pTextObject->Compose();
 
-       if (fitToHorizontal)
-       {
-               dimension.width += leftMargin + rightMargin + textLeftMargin + textRightMargin;
-       }
-       if (fitToVertical)
-       {
-               dimension.height += textTopMargin + textBottomMargin;
-       }
+       dimension.height += textTopMargin + textBottomMargin;
 
        return  dimension;
 }