Diff between master and tizen_2.1
authorKunal Sinha <kunal.sinha@samsung.com>
Wed, 22 May 2013 15:09:22 +0000 (20:39 +0530)
committerKunal Sinha <kunal.sinha@samsung.com>
Wed, 22 May 2013 15:09:22 +0000 (20:39 +0530)
Change-Id: I165adbface8a8b0009ab93ee9cb22f3df4845b58
Signed-off-by: Kunal Sinha <kunal.sinha@samsung.com>
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp

index 4eafbba..6a36e8b 100644 (file)
@@ -465,8 +465,8 @@ _TokenEditPresenter::Initialize(const _Control& control)
 
        SetKeypadEnabled(true);
 
-       float tokenLeftMargin = 0.0f;
-       float tokenRightMargin = 0.0f;
+       float leftMargin = 0.0f;
+       float rightMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenBottomMargin = 0.0f;
        float tokenHeight = 0.0f;
@@ -474,17 +474,17 @@ _TokenEditPresenter::Initialize(const _Control& control)
        Color focusTokenColor;
        Bitmap* pTokenBgFocusBitmap = null;
 
-       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
-       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, rightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
        GET_COLOR_CONFIG(TOKENEDIT::BG_FOCUS, focusTokenColor);
 
        // For drawing token in specific area
-       __clientRect.x = tokenLeftMargin;
+       __clientRect.x = leftMargin;
        __clientRect.y = tokenTopMargin;
-       __clientRect.width = __pTokenEdit->GetBoundsF().width - tokenLeftMargin - tokenRightMargin;
+       __clientRect.width = __pTokenEdit->GetBoundsF().width - leftMargin - rightMargin;
        __clientRect.height = __pTokenEdit->GetBoundsF().height - tokenTopMargin - tokenBottomMargin;
 
        __initTextRect = GetTextBoundsF();
@@ -1333,8 +1333,8 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
 
        int tokenCount = __pTokenList->GetCount();
 
-       float tokenLeftMargin = 0.0f;
-       float tokenRightMargin = 0.0f;
+       float leftMargin = 0.0f;
+       float rightMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenBottomMargin = 0.0f;
        float tokenHeight = 0.0f;
@@ -1345,8 +1345,8 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
        float descriptionTextRightMargin = 0.0f;
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
 
-       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
-       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, rightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
@@ -1388,7 +1388,7 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
                        }
                        else    // Set description text.
                        {
-                               pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                               pToken->displayRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                                pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + __lineSpacing;
 
                        }
@@ -1403,10 +1403,10 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
                                findPrevTokenLoopFlag = false;
                        }
 
-                       float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+                       float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - rightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                        if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth)           // Line change
                        {
-                               pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                               pToken->displayRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                                pToken->displayRect.y = pPreviousToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing;
                                __lineAdded++;
                        }
@@ -1489,8 +1489,8 @@ _TokenEditPresenter::SetInitialBounds(void)
 {
        result r = E_SUCCESS;
 
-       float tokenLeftMargin = 0.0f;
-       float tokenRightMargin = 0.0f;
+       float leftMargin = 0.0f;
+       float rightMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenHeight = 0.0f;
        float tokenMinWidth = 0.0f;
@@ -1502,8 +1502,8 @@ _TokenEditPresenter::SetInitialBounds(void)
        float descriptionTextRightMargin = 0.0f;
        _ControlOrientation orientation = GetEditView()->GetOrientation();
 
-       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
-       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, rightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinWidth);
@@ -1532,11 +1532,11 @@ _TokenEditPresenter::SetInitialBounds(void)
                        }
                        else
                        {
-                               tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
+                               tokenTextRect.x = leftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
                        }
 
                        tokenTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + textBoundsAlignValue;
-                       tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+                       tokenTextRect.width -= tokenTextRect.x + rightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                        tokenTextRect.height = textObjectMaxHeight;
 
                        SetTextBounds(tokenTextRect);
@@ -1549,10 +1549,10 @@ _TokenEditPresenter::SetInitialBounds(void)
                SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
 
                float tempTextRectWidth = 0.0f;
-               tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+               tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - rightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                if (tokenMinWidth > tempTextRectWidth)        // Line change
                {
-                       tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                       tokenTextRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                        tokenTextRect.y = pToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing + textBoundsAlignValue;
                }
                else
@@ -1561,7 +1561,7 @@ _TokenEditPresenter::SetInitialBounds(void)
                        tokenTextRect.y = pToken->displayRect.y + textBoundsAlignValue;
                }
 
-               tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+               tokenTextRect.width -= tokenTextRect.x + rightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                tokenTextRect.height = textObjectMaxHeight;
 
                SetTextBounds(tokenTextRect);
@@ -1952,11 +1952,11 @@ _TokenEditPresenter::TrimTokenAndAdjustEllipsisAt(int index)
 {
        result r = E_SUCCESS;
 
-       float tokenRightMargin = 0.0f;
+       float rightMargin = 0.0f;
        float tokenMinimumSize = 0.0f;
 
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
-       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, rightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinimumSize);
 
        _Token* pToken = null;
@@ -1966,7 +1966,7 @@ _TokenEditPresenter::TrimTokenAndAdjustEllipsisAt(int index)
        FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF();
        FloatRectangle tokenRect = pToken->displayRect;
 
-       float remainWidth = tokenEditBounds.width - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+       float remainWidth = tokenEditBounds.width - rightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
 
        float dspTokenWidth = tokenRect.x + tokenRect.width;
        float dspTokenGap = dspTokenWidth - remainWidth;