Vector<Character>& srcCharacters = mModel->mLogicalModel->mText;
Vector<Character> displayCharacters;
bool useHiddenText = false;
- if(mHiddenInput && mEventData != nullptr && !mEventData->mIsShowingPlaceholderText)
+ if(mHiddenInput && mEventData != NULL && !mEventData->mIsShowingPlaceholderText)
{
mHiddenInput->Substitute(srcCharacters, displayCharacters);
useHiddenText = true;
TextAbstraction::FontDescription defaultFontDescription;
TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * mFontSizeScale;
- if(IsShowingPlaceholderText() && mEventData && (nullptr != mEventData->mPlaceholderFont))
+ if(IsShowingPlaceholderText() && mEventData && (NULL != mEventData->mPlaceholderFont))
{
// If the placeholder font is set specifically, only placeholder font is changed.
defaultFontDescription = mEventData->mPlaceholderFont->mFontDescription;
defaultPointSize = mEventData->mPlaceholderFont->mDefaultPointSize * mFontSizeScale * 64u;
}
}
- else if(nullptr != mFontDefaults)
+ else if(NULL != mFontDefaults)
{
// Set the normal font and the placeholder font.
defaultFontDescription = mFontDefaults->mFontDescription;
// Create the 'number of glyphs' per character and the glyph to character conversion tables.
mModel->mVisualModel->CreateGlyphsPerCharacterTable(startIndex, mTextUpdateInfo.mStartGlyphIndex, requestedNumberOfCharacters);
mModel->mVisualModel->CreateCharacterToGlyphTable(startIndex, mTextUpdateInfo.mStartGlyphIndex, requestedNumberOfCharacters);
-
- updated = true;
+ updated = true;
}
const Length numberOfGlyphs = glyphs.Count() - currentNumberOfGlyphs;
updated = true;
}
- if((nullptr != mEventData) &&
+ if((NULL != mEventData) &&
mEventData->mPreEditFlag &&
(0u != mModel->mVisualModel->mCharactersToGlyph.Count()))
{
underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
underlineRun.numberOfGlyphs = numberOfIndices;
mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
-
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(false);
- }
break;
}
case Dali::InputMethodContext::PreeditStyle::REVERSE:
underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
underlineRun.numberOfGlyphs = numberOfIndices;
mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
-
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(false);
- }
break;
}
case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_2:
underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
underlineRun.numberOfGlyphs = numberOfIndices;
mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
-
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(false);
- }
break;
}
case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_3:
underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
underlineRun.numberOfGlyphs = numberOfIndices;
mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
-
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(false);
- }
break;
}
case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_4:
underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
underlineRun.numberOfGlyphs = numberOfIndices;
mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
-
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(false);
- }
break;
}
case Dali::InputMethodContext::PreeditStyle::NONE:
updated = true;
}
- if((NO_OPERATION != (SHAPE_TEXT & operations)) &&
- ! ((nullptr != mEventData) &&
- mEventData->mPreEditFlag &&
- (0u != mModel->mVisualModel->mCharactersToGlyph.Count())))
- {
- //Mark-up processor case
- if(mModel->mVisualModel->IsMarkupProcessorEnabled())
- {
- CopyUnderlinedFromLogicalToVisualModels(true);
- }
-
- updated = true;
- }
-
-
// The estimated number of lines. Used to avoid reallocations when layouting.
mTextUpdateInfo.mEstimatedNumberOfLines = std::max(mModel->mVisualModel->mLines.Count(), mModel->mLogicalModel->mParagraphInfo.Count());
float Controller::Impl::GetDefaultFontLineHeight()
{
FontId defaultFontId = 0u;
- if(nullptr == mFontDefaults)
+ if(NULL == mFontDefaults)
{
TextAbstraction::FontDescription fontDescription;
defaultFontId = mFontClient.GetFontId(fontDescription, TextAbstraction::FontClient::DEFAULT_POINT_SIZE * mFontSizeScale);
void Controller::Impl::ChangeState(EventData::State newState)
{
- if(nullptr == mEventData)
+ if(NULL == mEventData)
{
// Nothing to do if there is no text input.
return;
CharacterIndex Controller::Impl::CalculateNewCursorIndex(CharacterIndex index) const
{
- if(nullptr == mEventData)
+ if(NULL == mEventData)
{
// Nothing to do if there is no text input.
return 0u;
void Controller::Impl::UpdateCursorPosition(const CursorInfo& cursorInfo)
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::UpdateCursorPosition %p\n", this);
- if(nullptr == mEventData)
+ if(NULL == mEventData)
{
// Nothing to do if there is no text input.
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::UpdateCursorPosition no event data\n");
void Controller::Impl::RequestRelayout()
{
- if(nullptr != mControlInterface)
+ if(NULL != mControlInterface)
{
mControlInterface->RequestTextRelayout();
}
return actor;
}
-void Controller::Impl::CopyUnderlinedFromLogicalToVisualModels(bool shouldClearPreUnderlineRuns)
-{
- //Underlined character runs for markup-processor
- const Vector<UnderlinedCharacterRun>& underlinedCharacterRuns = mModel->mLogicalModel->mUnderlinedCharacterRuns;
- const Vector<GlyphIndex>& charactersToGlyph = mModel->mVisualModel->mCharactersToGlyph;
- const Vector<Length>& glyphsPerCharacter = mModel->mVisualModel->mGlyphsPerCharacter;
-
- if(shouldClearPreUnderlineRuns)
- {
- mModel->mVisualModel->mUnderlineRuns.Clear();
- }
-
- for(Vector<UnderlinedCharacterRun>::ConstIterator it = underlinedCharacterRuns.Begin(), endIt = underlinedCharacterRuns.End(); it != endIt; ++it)
- {
- CharacterIndex characterIndex = it->characterRun.characterIndex;
- Length numberOfCharacters = it->characterRun.numberOfCharacters;
- for(Length index=0u; index<numberOfCharacters; index++)
- {
- GlyphRun underlineGlyphRun;
- underlineGlyphRun.glyphIndex = charactersToGlyph[characterIndex + index];
- underlineGlyphRun.numberOfGlyphs = glyphsPerCharacter[characterIndex + index];
- mModel->mVisualModel->mUnderlineRuns.PushBack(underlineGlyphRun);
- }
- }
-}
-
} // namespace Text
} // namespace Toolkit