// Open Service Platform
// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://floralicense.org/license/
+// http://www.apache.org/licenses/LICENSE-2.0/
//
// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
+// distributed under the License is distributed on an ”AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
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*
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);
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;
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);
}
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);
}
+const Font*
+TextCutLink::GetFont(void) const
+{
+ if (__isEdited)
+ {
+ return TextSimple::GetCurrentFont();
+ }
+
+ return __pLinkFont;
+}
+
Font*
TextCutLink::GetCurrentFont(void) const
{