Applied Float point
authorYunji Park <yunji19.park@samsung.com>
Tue, 2 Apr 2013 12:53:37 +0000 (21:53 +0900)
committerYunji Park <yunji19.park@samsung.com>
Tue, 2 Apr 2013 12:53:37 +0000 (21:53 +0900)
Change-Id: Idd9bc3995f2baaffe2cb9f9712d0b3dc21c74040

src/graphics/CMakeLists.txt
src/graphics/inc/FGrp_TextTextObject.h
src/graphics/text/FGrp_TextTextComposite.cpp
src/graphics/text/FGrp_TextTextComposite.h
src/graphics/text/FGrp_TextTextCutLink.cpp
src/graphics/text/FGrp_TextTextObject.cpp
src/graphics/text/FGrp_TextTextSimple.cpp

index f4fb409..f466f88 100644 (file)
@@ -88,7 +88,6 @@ SET (${this_target}_SOURCE_FILES
        text/FGrp_TextTextSimple.cpp
        text/FGrp_TextTextSimpleList.cpp
        text/FGrp_TextTextUtility.cpp
-       text/FGrp_TextTextWidthManager.cpp
 )
 
 
index a98e6af..06263f8 100644 (file)
@@ -38,7 +38,6 @@ class Point;
 namespace _Text
 {
 class TextElement;
-class TextWidthManager;
 class TextComposite;
 class TextColumn;
 
@@ -255,10 +254,6 @@ public:
 
        bool IsAlternateLookEnabled(void) const;
 
-       result SetWidthManagerEnabled(bool widthManagerEnable);
-
-       bool IsWidthManagerEnabled(void) const;
-
        result SetFirstDisplayLineIndexFromTextIndex(int textIndex);
 
        result SetFirstDisplayLineIndex(int lineIndex);
@@ -380,7 +375,7 @@ private:
 
        int GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode = true) const;
 
-       result UpdateChangedInfo(int startTextIndex, int textLength = -1, bool initTextWidthManager = true);
+       result UpdateChangedInfo(int startTextIndex, int textLength = -1);
 
        result NotifyTextAdded(int textIndex, int textLength);
 
@@ -424,7 +419,6 @@ private:
        bool __isEmailLinkColorDefined;
        bool __isPhoneNumberLinkColorDefined;
        Color __linkColor[TEXT_OBJECT_LINK_COLOR_TYPE_MAX];
-       TextWidthManager* __pTextWidthManager;
 
        TextObjectSweepInfo __sweepInfo;
 
index f8e8c7d..2db6e62 100644 (file)
@@ -35,7 +35,6 @@
 #include "FGrp_TextTextComposite.h"
 #include "FGrp_TextTextUtility.h"
 #include "FGrp_CanvasImpl.h"
-#include "FGrp_TextTextWidthManager.h"
 #include "FGrp_CoordinateSystemUtils.h"
 
 using namespace Tizen::Base;
@@ -123,8 +122,6 @@ TextComposite::TextComposite(TextElement* pTextElement)
        __middleEllipsisTextLengthInTail = 0;
        __middleEllipsisWidth = 0;
        __isChanged = false;
-       __pTextWidthManager = null;
-       __widthManagerEnabled = false;
 
        __pSweepInfo = null;
 }
@@ -1818,7 +1815,7 @@ TextComposite::Compose(FloatRectangle& rect, TextColumn* pTextColumn)
        case TEXT_OBJECT_WRAP_TYPE_CHARACTER:
        {
                __pCurrentTextColumn->PrepareCompose();
-               lineCount = ComposeInNormalWrap(rect);
+               lineCount = ComposeInWrap(rect);
                __pCurrentTextColumn->FinishCompose();
                break;
        }
@@ -1836,7 +1833,7 @@ TextComposite::Compose(FloatRectangle& rect, TextColumn* pTextColumn)
                else
                {
                        __pCurrentTextColumn->PrepareCompose();
-                       lineCount = ComposeInWordWrap(rect);
+                       lineCount = ComposeInWrap(rect);
                        __pCurrentTextColumn->CompareDeletedLine();
                        __pCurrentTextColumn->FinishCompose();
                }
@@ -4202,25 +4199,6 @@ TextComposite::ComposeInPartialMode(FloatRectangle& rect)
 }
 
 int
-TextComposite::ComposeInNormalWrap(FloatRectangle& rect)
-{
-       return ComposeInWrap(rect);
-}
-
-int
-TextComposite::ComposeInWordWrap(FloatRectangle& rect)
-{
-       if (IsWidthManagerEnabled())
-       {
-               return ComposeInWrapByTextWidth(rect);
-       }
-       else
-       {
-               return ComposeInWrap(rect);
-       }
-}
-
-int
 TextComposite::ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect)
 {
        int endType = TEXT_RETBY_NORMAL;
@@ -4743,195 +4721,6 @@ TextComposite::IsComposeDone() const
        return __pCurrentTextColumn->IsComposeDone();
 }
 
-int
-TextComposite::ComposeInWrapByTextWidth(FloatRectangle& rect)
-{
-       SysTryReturn(NID_GRP, __pCurrentTextColumn, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
-
-       FloatRectangle lineBounds;
-       int lineCount = 0;
-       int textIndex = 0;
-       int remainingLength = 0;
-       float remainingWidth = 0;
-       float remainingHeight = 0;
-       float offsetY = 0;
-       bool hasPrevLine = false;
-       int endType = TEXT_RETBY_NORMAL;
-       FloatDimension lineTextSize;
-       int lineOffset = 0;
-       int lineLength = 0;
-       TextLine* pTextLine = null;
-
-       pTextLine = __pCurrentTextColumn->GetPrevLineChangedStartLine();
-       if (pTextLine != null)
-       {
-               endType = pTextLine->GetEndType();
-               lineOffset = pTextLine->GetTextOffset();
-               lineLength = pTextLine->GetTextLength();
-               lineBounds = pTextLine->GetBoundsF();
-               pTextLine->GetRegion(0, pTextLine->GetTextLength(), lineTextSize.width, lineTextSize.height);
-
-               if (endType != TEXT_RETBY_LINEFEED)
-               {
-                       textIndex = lineOffset;
-                       remainingLength = __length - textIndex;
-                       remainingWidth = rect.width;
-                       hasPrevLine = true;
-
-                       if (remainingLength == 0)
-                       {
-                               return -1;
-                       }
-               }
-               else
-               {
-                       textIndex = lineOffset + lineLength;
-                       remainingLength = __length - textIndex;
-                       remainingWidth = rect.width;
-                       offsetY = lineBounds.y + lineBounds.height;
-                       lineBounds.y = offsetY;
-
-                       if (remainingLength == 0)
-                       {
-                               lineTextSize.height = lineBounds.height;
-
-                               pTextLine = new (std::nothrow)TextLine(this);
-                               SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
-
-                               pTextLine->SetBounds(lineBounds);
-                               pTextLine->SetRegion(0.0f, lineTextSize.height);
-                               pTextLine->SetTextLength(0);
-                               pTextLine->SetTextOffset(textIndex);
-                               pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
-                               GetTextExtentList(pTextLine);
-
-                               __pCurrentTextColumn->AddLineDuringCompose(pTextLine);
-
-                               return 1;
-                       }
-               }
-       }
-       else
-       {
-               textIndex = 0;
-               remainingLength = __length;
-               remainingWidth = rect.width;
-               lineBounds.x = rect.x;
-               lineBounds.y = 0;
-               lineBounds.width = rect.width;
-       }
-
-       remainingHeight = rect.height;
-
-       __pTextWidthManager->StartCompose(textIndex);
-
-       TextLineComposeInfo composeInfo;
-       composeInfo.height = 0;
-       composeInfo.width = 0;
-       composeInfo.length = 0;
-       composeInfo.endType = TEXT_RETBY_NORMAL;
-
-       while (remainingLength != 0)
-       {
-               __pTextWidthManager->GetCurrentLineInfo(remainingWidth, composeInfo);
-               composeInfo.height += __lineSpacing;
-
-               if (hasPrevLine)
-               {
-                       lineBounds.height = composeInfo.height;
-                       pTextLine->SetBounds(lineBounds);
-                       pTextLine->SetRegion(composeInfo.width, composeInfo.height);
-                       pTextLine->SetTextLength(composeInfo.length);
-                       pTextLine->SetEndType(composeInfo.endType);
-                       hasPrevLine = false;
-               }
-               else
-               {
-                       if (composeInfo.length == 0)
-                       {
-                               composeInfo.length = 1;
-                       }
-
-                       pTextLine = new (std::nothrow)TextLine(this);
-                       SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
-
-                       lineBounds.height = composeInfo.height;
-
-                       pTextLine->SetBounds(lineBounds);
-                       pTextLine->SetTextOffset(textIndex);
-                       pTextLine->SetRegion(composeInfo.width, composeInfo.height);
-                       pTextLine->SetTextLength(composeInfo.length);
-                       pTextLine->SetEndType(composeInfo.endType);
-                       GetTextExtentList(pTextLine);
-
-                       __pCurrentTextColumn->AddLineDuringCompose(pTextLine);
-                       lineCount++;
-               }
-
-               if (__pCurrentTextColumn->IsComposeDone())
-               {
-                       break;
-               }
-
-               textIndex += composeInfo.length;
-               remainingLength -= composeInfo.length;
-               remainingHeight -= composeInfo.height;
-
-               if (remainingLength > 0)
-               {
-                       float nextY = lineBounds.y + lineBounds.height;
-
-                       lineBounds.x = rect.x;
-                       lineBounds.y = nextY;
-                       lineBounds.width = rect.width;
-                       lineTextSize.height = 0;
-                       remainingWidth = rect.width;
-               }
-               else
-               {
-                       if (composeInfo.endType == TEXT_RETBY_LINEFEED)
-                       {
-                               float nextY = lineBounds.y + lineBounds.height;
-                               lineTextSize.height = lineBounds.height;
-
-                               pTextLine = new (std::nothrow)TextLine(this);
-                               SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
-
-                               lineBounds.x = rect.x;
-                               lineBounds.y = nextY;
-                               lineBounds.width = rect.width;
-                               lineBounds.height = lineTextSize.height;
-
-                               pTextLine->SetBounds(lineBounds);
-                               pTextLine->SetRegion(0.0f, lineTextSize.height);
-                               pTextLine->SetTextLength(0);
-                               pTextLine->SetTextOffset(textIndex);
-                               pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
-                               GetTextExtentList(pTextLine);
-
-                               __pCurrentTextColumn->AddLineDuringCompose(pTextLine);
-
-                               lineCount++;
-
-                               pTextLine = null;
-                               break;
-                       }
-                       else
-                       {
-                               pTextLine = null;
-                       }
-               }
-       }
-
-       __pTextWidthManager->EndCompose();
-
-       FloatDimension columnSize;
-       __pCurrentTextColumn->GetRegion(0, __length, columnSize.width, columnSize.height);
-       rect.height = columnSize.height;
-
-       return lineCount;
-}
-
 result
 TextComposite::GetCutLinkObjectInfo(int cutLinkIndex, int& textStartIndex, int& textLength) const
 {
@@ -5292,24 +5081,6 @@ TextComposite::GetDisplayableText(FloatRectangle displayRect, TextObjectActionTy
        return text;
 }
 
-void
-TextComposite::SetTextWidthManager(TextWidthManager* pTextWidthManager)
-{
-       __pTextWidthManager = pTextWidthManager;
-}
-
-void
-TextComposite::SetWidthManagerEnabled(bool widthManagerEnable)
-{
-       __widthManagerEnabled = widthManagerEnable;
-}
-
-bool
-TextComposite::IsWidthManagerEnabled(void) const
-{
-       return __widthManagerEnabled;
-}
-
 result
 TextComposite::SetWorkWidth(Font* pFont, wchar_t* pText, int workStart, int textLength)
 {
index 1b32c16..fee5c2f 100644 (file)
@@ -39,7 +39,6 @@ class TextCutLink;
 class TextLine;
 class TextColumn;
 class TextCutLinkListInfo;
-class TextWidthManager;
 struct NoneWrapComposeInfo;
 
 class TextComposite
@@ -215,10 +214,6 @@ public:
 
        float GetComposePartialLimitHeightF(void) const;
 
-       void SetWidthManagerEnabled(bool widthManagerEnable);
-
-       bool IsWidthManagerEnabled(void) const;
-
        void SetTextObjectEllipsisType(TextObjectEllipsisType type);
 
        TextObjectEllipsisType GetTextObjectEllipsisType(void) const;
@@ -251,8 +246,6 @@ public:
 
        bool InitPartialComposeMode(void);
 
-       void SetTextWidthManager(TextWidthManager* pTextWidthManager);
-
        TextElement* SearchTextElement(TextElementType type, int textIndex, int& elementTextOffset) const;
 
        TextElementType GetObjectType(int textIndex) const;
@@ -288,14 +281,8 @@ public:
 private:
        int ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo = null);
 
-       int ComposeInNormalWrap(FloatRectangle& rect);
-
-       int ComposeInWordWrap(FloatRectangle& rect);
-
        int ComposeInWrap(FloatRectangle& rect);
 
-       int ComposeInWrapByTextWidth(FloatRectangle& rect);
-
        int ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect);
 
        int ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect);
@@ -355,8 +342,6 @@ private:
        int __middleEllipsisTextLengthInTail;
        float __headEllipsisWidth;
        int __headEllipsisTextLength;
-       TextWidthManager* __pTextWidthManager;
-       bool __widthManagerEnabled;
 
        TextObjectSweepInfo* __pSweepInfo;
 
index 3c37ccb..a042bf3 100644 (file)
@@ -74,20 +74,17 @@ result
 TextCutLink::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
                                        const TextObjectActionType action)
 {
-       SysTryReturn(NID_GRP
-                       , displayRect.x >= 0 && displayRect.y >= 0
+       SysTryReturn(NID_GRP, displayRect.x >= 0 && displayRect.y >= 0
                        , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
-       return TextSimple::Draw(canvasImpl, displayRect, startTextIndex, textLength, align, action);
+       return Draw(canvasImpl, displayRect, startTextIndex, textLength, align, action);
 }
 
 result
 TextCutLink::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
                                                const TextObjectActionType action)
 {
-       Rectangle intDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
-       return Draw(canvasImpl, intDisplayRect, startTextIndex, textLength, align, action);
+       return TextSimple::Draw(canvasImpl, displayRect, startTextIndex, textLength, align, action);
 }
 
 TextElement*
@@ -98,9 +95,7 @@ TextCutLink::CloneN(TextComponentInfoValueType type, unsigned int value)
        pLinkElement = new (std::nothrow) TextCutLink(__isEditable, __linkType, _pText, _length,
                        TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, _pFont, _foregroundColor, _backgroundColor, _outlineColor);
 
-       SysTryReturn(NID_GRP
-               , pLinkElement
-               , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
+       SysTryReturn(NID_GRP, pLinkElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
 
        TextElement::CopyMembers(pLinkElement);
 
@@ -117,27 +112,21 @@ TextCutLink::CopyN(int textStartIndex, int textLength)
 
        TextCutLink* pLinkElement = null;
 
-       SysTryReturn(NID_GRP
-                       , textStartIndex < _length
-                       , null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+       SysTryReturn(NID_GRP, textStartIndex < _length, null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
        if (textStartIndex + textLength > _length)
        {
                textLength = _length - textStartIndex;
        }
 
-       SysTryReturn(NID_GRP
-                       , textLength >= 0
-                       , null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+       SysTryReturn(NID_GRP, textLength >= 0, null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
        pText = &_pText[_offset + textStartIndex];
 
        pLinkElement = new (std::nothrow) TextCutLink(__isEditable, __linkType, pText, textLength, _sourceType,
                        _pFont, _foregroundColor, _backgroundColor, _outlineColor);
 
-       SysTryReturn(NID_GRP
-               , pLinkElement
-               , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
+       SysTryReturn(NID_GRP, pLinkElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
 
        pLinkElement->_isBackgroundDrawingModeEnabled = _isBackgroundDrawingModeEnabled;
        pLinkElement->__isEdited = __isEdited;
@@ -230,9 +219,7 @@ TextCutLink::ResetUserColor(void)
 result
 TextCutLink::SetTextOffset(int offset)
 {
-       SysTryReturn(NID_GRP
-               , __isEdited == true
-               , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+       SysTryReturn(NID_GRP, __isEdited == true, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
        return TextSimple::SetTextOffset(offset);
 }
@@ -240,9 +227,7 @@ TextCutLink::SetTextOffset(int offset)
 result
 TextCutLink::ChangeTextOffset(wchar_t* pText, int gap)
 {
-       SysTryReturn(NID_GRP
-               , __isEdited == true
-               , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+       SysTryReturn(NID_GRP, __isEdited == true, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
        return TextSimple::ChangeTextOffset(pText, gap);
 }
index 5d33ab1..5e70a41 100644 (file)
@@ -35,7 +35,6 @@
 #include "FGrp_TextTextLine.h"
 #include "FGrp_TextTextColumn.h"
 #include "FGrp_TextTextUtility.h"
-#include "FGrp_TextTextWidthManager.h"
 #include "FGrp_Screen.h"
 #include "FGrp_CoordinateSystemUtils.h"
 
@@ -87,7 +86,6 @@ TextObject::TextObject(void)
        __rect.height = 0;
        __slidingGap = 30;
        __slidingStep = 2;
-       __pTextWidthManager = null;
        __linkViewModeEnabled = false;
        __isUrlLinkColorDefined = false;
        __isEmailLinkColorDefined = false;
@@ -116,7 +114,6 @@ TextObject::~TextObject(void)
 {
        Release(__pCompositeText);
        Release(__pTextColumn);
-       Release(__pTextWidthManager);
        Release(__pDefaultFont);
 }
 
@@ -136,7 +133,6 @@ TextObject::Construct(void)
        __slidingStep = 2;
        __isAlternateLookEnabled = false;
        __linkViewModeEnabled = false;
-       __pTextWidthManager = null;
 
        __pCompositeText = new (std::nothrow)TextComposite();
        SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
@@ -159,7 +155,6 @@ CATCH:
        Release(__pDefaultFont);
        Release(__pCompositeText);
        Release(__pTextColumn);
-       Release(__pTextWidthManager);
 
        return r;
 }
@@ -180,7 +175,6 @@ TextObject::Construct(const Rectangle& rect)
        __slidingStep = 2;
        __isAlternateLookEnabled = false;
        __linkViewModeEnabled = false;
-       __pTextWidthManager = null;
        __rect = _CoordinateSystemUtils::ConvertToFloat(rect);
 
        __pCompositeText = new (std::nothrow)TextComposite();
@@ -204,7 +198,6 @@ CATCH:
        Release(__pDefaultFont);
        Release(__pCompositeText);
        Release(__pTextColumn);
-       Release(__pTextWidthManager);
 
        return r;
 }
@@ -225,7 +218,6 @@ TextObject::Construct(const FloatRectangle& rect)
        __slidingStep = 2;
        __isAlternateLookEnabled = false;
        __linkViewModeEnabled = false;
-       __pTextWidthManager = null;
        __rect = rect;
 
        __pCompositeText = new (std::nothrow)TextComposite();
@@ -249,7 +241,6 @@ CATCH:
        Release(__pDefaultFont);
        Release(__pCompositeText);
        Release(__pTextColumn);
-       Release(__pTextWidthManager);
 
        return r;
 }
@@ -645,7 +636,7 @@ TextObject::DrawWithOffset(_CanvasImpl& canvasImpl)
 }
 
 result
-TextObject::UpdateChangedInfo(int startTextIndex, int textLength, bool initTextWidthManager)
+TextObject::UpdateChangedInfo(int startTextIndex, int textLength)
 {
        result r = E_SUCCESS;
 
@@ -653,15 +644,6 @@ TextObject::UpdateChangedInfo(int startTextIndex, int textLength, bool initTextW
        {
                r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_UNKONWN, startTextIndex, 0);
                SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               if (__pCompositeText->IsWidthManagerEnabled() && __pTextWidthManager && initTextWidthManager)
-               {
-                       __pTextWidthManager->Finalize();
-                       if (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD)
-                       {
-                               __pTextWidthManager->Initialize(__pCompositeText->GetTextLength());
-                       }
-               }
        }
 
        __isChanged = true;
@@ -1036,7 +1018,7 @@ TextObject::SetBounds(const FloatRectangle& rect)
 
        if (__rect.width != rect.width)
        {
-               UpdateChangedInfo(0, 0, false);
+               UpdateChangedInfo(0, 0);
        }
 
        __rect = rect;
@@ -2429,11 +2411,6 @@ TextObject::NotifyTextAdded(int textIndex, int textLength)
        r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_INSERT, textIndex, textLength);
        SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       if ((__pCompositeText->IsWidthManagerEnabled() == true) && (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD))
-       {
-               __pTextWidthManager->InformTextInsert(textIndex, textLength);
-       }
-
        __isChanged = true;
 
        return E_SUCCESS;
@@ -2447,13 +2424,6 @@ TextObject::NotifyTextDeleted(int textIndex, int textLength)
        r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_REMOVE, textIndex, textLength);
        SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       if ((__pCompositeText->IsWidthManagerEnabled() == true) && (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD))
-       {
-               if (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD)
-               {
-                       __pTextWidthManager->InformTextRemove(textIndex, textLength);
-               }
-       }
        __isChanged = true;
 
        return E_SUCCESS;
@@ -3788,42 +3758,6 @@ TextObject::GetTextObjectEllipsisType(void) const
 }
 
 result
-TextObject::SetWidthManagerEnabled(bool enable)
-{
-       IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
-
-       if (__pCompositeText->IsWidthManagerEnabled() == enable)
-       {
-               return E_SUCCESS;
-       }
-
-       if (enable)
-       {
-               __pTextWidthManager = new (std::nothrow)TextWidthManager(__pCompositeText);
-               SysTryReturn(NID_GRP, __pTextWidthManager, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
-
-               __pCompositeText->SetTextWidthManager(__pTextWidthManager);
-               __pTextWidthManager->Initialize(__pCompositeText->GetTextLength());
-       }
-       else
-       {
-               Release(__pTextWidthManager);
-       }
-
-       __pCompositeText->SetWidthManagerEnabled(enable);
-
-       return E_SUCCESS;
-}
-
-bool
-TextObject::IsWidthManagerEnabled(void) const
-{
-       IF_NOT_CONSTRUCTED(return false);
-
-       return __pCompositeText->IsWidthManagerEnabled();
-}
-
-result
 TextObject::ChangeText(int textIndex)
 {
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
@@ -3997,7 +3931,7 @@ TextObject::GetBoundsAtLineF(int lineIndex) const
        IF_NOT_CONSTRUCTED(return FloatRectangle(-1, -1, -1, -1));
 
        SysTryReturn(NID_GRP, lineIndex >= 0, FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG
-                       , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);
+                       , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);  
 
        TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex);
        SysTryReturn(NID_GRP, pTextLine, FloatRectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
index e20979e..d31c94f 100644 (file)
@@ -123,9 +123,9 @@ int
 TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
                                                        int& width, int& height)
 {
-       int maxWidthF = _CoordinateSystemUtils::ConvertToFloat(maxWidth);
-       int widthF = _CoordinateSystemUtils::ConvertToFloat(width);
-       int heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+       float maxWidthF = _CoordinateSystemUtils::ConvertToFloat(maxWidth);
+       float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+       float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
 
        int r = ForwardAnalyze(startTextIndex, textLength, maxWidthF, wrap, actualLength, widthF, heightF);
 
@@ -160,8 +160,8 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, T
        {
                if (__bitmapProperty.displayEnable)
                {
-                       int bitmapWidth = __bitmapProperty.pBitmap->GetWidth();
-                       int bitmapHeight = __bitmapProperty.pBitmap->GetHeight();
+                       float bitmapWidth = __bitmapProperty.pBitmap->GetWidthF();
+                       float bitmapHeight = __bitmapProperty.pBitmap->GetHeightF();
 
                        if (maxWidth < bitmapWidth)
                        {
@@ -259,7 +259,7 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, T
 
        case TEXT_OBJECT_WRAP_TYPE_WORD:
                actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, textLength, maxWidth, _outline, width, height);
-               int widthcheck = width;
+               float widthcheck = width;
 
                if (_pText[startTextIndex + actualLength] == TEXT_LINE_FEED || _pText[startTextIndex + actualLength] == TEXT_CARRIAGE_RETURN)
                {
@@ -308,7 +308,7 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, T
 
        if (height == 0 && (textLength > 0))
        {
-               height = pFontImpl->GetLeading();
+               height = pFontImpl->GetLeadingF();
        }
 
        if (actualLength < charCount)
@@ -379,13 +379,13 @@ TextSimple::IsChinese(const wchar_t* ch) const
 result
 TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) const
 {
-       float widthF = _CoordinateSystemUtils::ConvertToInteger(width);
-       float heightF = _CoordinateSystemUtils::ConvertToInteger(height);
+       float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+       float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
 
        result r = GetRegion(textIndex, textLength, widthF, heightF);
 
-       width = _CoordinateSystemUtils::ConvertToFloat(widthF);
-       height = _CoordinateSystemUtils::ConvertToFloat(heightF);
+       width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+       height = _CoordinateSystemUtils::ConvertToInteger(heightF);
 
        return r;
 }
@@ -417,8 +417,8 @@ TextSimple::GetRegion(int textIndex, int textLength, float& width, float& height
        {
                if (__bitmapProperty.displayEnable)
                {
-                       width = __bitmapProperty.pBitmap->GetWidth();
-                       height = __bitmapProperty.pBitmap->GetHeight();
+                       width = __bitmapProperty.pBitmap->GetWidthF();
+                       height = __bitmapProperty.pBitmap->GetHeightF();
                }
                else
                {
@@ -457,7 +457,7 @@ TextSimple::GetRegion(int textIndex, int textLength, float& width, float& height
 
        if (height == 0 && (textLength > 0))
        {
-               height = pFontImpl->GetLeading();
+               height = pFontImpl->GetLeadingF();
        }
 
        return E_SUCCESS;
@@ -1398,10 +1398,10 @@ float
 TextSimple::GetBaselineF(void) const
 {
        Font* pCurrentFont = GetCurrentFont();
-       SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
+       SysTryReturn(NID_GRP, pCurrentFont, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
 
        _FontImpl* pFontImpl = _FontImpl::GetInstance(*pCurrentFont);
-       SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+       SysTryReturn(NID_GRP, pFontImpl, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
 
        return (-1) * pFontImpl->GetDescenderF();
 }