X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=268519b2d845c34147e045a92c66cb4a3fcbbe1e;hp=35009856c99d890d24c99abeb218a6705ff808a8;hb=348f6480ca53f0a1c869d2da077ee3b5e3e405eb;hpb=fd3baac4dbdce72b630debdfe7df9bf732ca873f diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 3500985..268519b 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -68,15 +68,19 @@ namespace Text * * @param[in] eventData The event data pointer. * @param[in] logicalModel The logical model where to add the new font description run. + * @param[out] startOfSelectedText Index to the first selected character. + * @param[out] lengthOfSelectedText Number of selected characters. */ FontDescriptionRun& UpdateSelectionFontStyleRun( EventData* eventData, - LogicalModelPtr logicalModel ) + LogicalModelPtr logicalModel, + CharacterIndex& startOfSelectedText, + Length& lengthOfSelectedText ) { const bool handlesCrossed = eventData->mLeftSelectionPosition > eventData->mRightSelectionPosition; // Get start and end position of selection - const CharacterIndex startOfSelectedText = handlesCrossed ? eventData->mRightSelectionPosition : eventData->mLeftSelectionPosition; - const Length lengthOfSelectedText = ( handlesCrossed ? eventData->mLeftSelectionPosition : eventData->mRightSelectionPosition ) - startOfSelectedText; + startOfSelectedText = handlesCrossed ? eventData->mRightSelectionPosition : eventData->mLeftSelectionPosition; + lengthOfSelectedText = ( handlesCrossed ? eventData->mLeftSelectionPosition : eventData->mRightSelectionPosition ) - startOfSelectedText; // Add the font run. const VectorBase::SizeType numberOfRuns = logicalModel->mFontDescriptionRuns.Count(); @@ -115,8 +119,6 @@ void Controller::SetGlyphType( TextAbstraction::GlyphType glyphType ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -130,6 +132,55 @@ bool Controller::IsMarkupProcessorEnabled() const return mImpl->mMarkupProcessorEnabled; } +void Controller::SetAutoScrollEnabled( bool enable ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled[%s] SingleBox[%s]-> [%p]\n", (enable)?"true":"false", ( mImpl->mLayoutEngine.GetLayout() == LayoutEngine::SINGLE_LINE_BOX)?"true":"false", this ); + + if ( mImpl->mLayoutEngine.GetLayout() == LayoutEngine::SINGLE_LINE_BOX ) + { + if ( enable ) + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled for SINGLE_LINE_BOX\n" ); + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + LAYOUT | + ALIGN | + UPDATE_ACTUAL_SIZE | + UPDATE_DIRECTION | + REORDER ); + + } + else + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled Disabling autoscroll\n"); + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + LAYOUT | + ALIGN | + UPDATE_ACTUAL_SIZE | + REORDER ); + } + + mImpl->mAutoScrollEnabled = enable; + mImpl->RequestRelayout(); + } + else + { + DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored" ); + mImpl->mAutoScrollEnabled = false; + } +} + +bool Controller::IsAutoScrollEnabled() const +{ + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::IsAutoScrollEnabled[%s]\n", (mImpl->mAutoScrollEnabled)?"true":"false" ); + + return mImpl->mAutoScrollEnabled; +} + +CharacterDirection Controller::GetAutoScrollDirection() const +{ + return mImpl->mAutoScrollDirectionRTL; +} + void Controller::SetText( const std::string& text ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" ); @@ -159,6 +210,8 @@ void Controller::SetText( const std::string& text ) if( !text.empty() ) { + mImpl->mVisualModel->SetTextColor( mImpl->mTextColor ); + MarkupProcessData markupProcessData( mImpl->mLogicalModel->mColorRuns, mImpl->mLogicalModel->mFontDescriptionRuns ); @@ -321,8 +374,6 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -369,8 +420,6 @@ void Controller::SetDefaultFontWeight( FontWeight weight ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -397,8 +446,6 @@ void Controller::SetDefaultFontWidth( FontWidth width ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -425,8 +472,6 @@ void Controller::SetDefaultFontSlant( FontSlant slant ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -462,8 +507,6 @@ void Controller::SetDefaultPointSize( float pointSize ) // Clear the font-specific data ClearFontData(); - mImpl->mRecalculateNaturalSize = true; - mImpl->RequestRelayout(); } @@ -479,14 +522,15 @@ float Controller::GetDefaultPointSize() const void Controller::UpdateAfterFontChange( const std::string& newDefaultFont ) { - DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange"); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange"); if( !mImpl->mFontDefaults->familyDefined ) // If user defined font then should not update when system font changes { DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange newDefaultFont(%s)\n", newDefaultFont.c_str() ); - ClearFontData(); mImpl->mFontDefaults->mFontDescription.family = newDefaultFont; - mImpl->mRecalculateNaturalSize = true; + + ClearFontData(); + mImpl->RequestRelayout(); } } @@ -667,6 +711,7 @@ void Controller::SetInputColor( const Vector4& color ) if( NULL != mImpl->mEventData ) { mImpl->mEventData->mInputStyle.textColor = color; + mImpl->mEventData->mInputStyle.isDefaultColor = false; if( EventData::SELECTING == mImpl->mEventData->mState ) { @@ -688,6 +733,10 @@ void Controller::SetInputColor( const Vector4& color ) // Request to relayout. mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | COLOR ); mImpl->RequestRelayout(); + + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; } } } @@ -713,8 +762,12 @@ void Controller::SetInputFontFamily( const std::string& fontFamily ) if( EventData::SELECTING == mImpl->mEventData->mState ) { + CharacterIndex startOfSelectedText = 0u; + Length lengthOfSelectedText = 0u; FontDescriptionRun& fontDescriptionRun = UpdateSelectionFontStyleRun( mImpl->mEventData, - mImpl->mLogicalModel ); + mImpl->mLogicalModel, + startOfSelectedText, + lengthOfSelectedText ); fontDescriptionRun.familyLength = fontFamily.size(); fontDescriptionRun.familyName = new char[fontDescriptionRun.familyLength]; @@ -724,10 +777,21 @@ void Controller::SetInputFontFamily( const std::string& fontFamily ) // The memory allocated for the font family name is freed when the font description is removed from the logical model. // Request to relayout. - mImpl->mOperationsPending = ALL_OPERATIONS; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + VALIDATE_FONTS | + SHAPE_TEXT | + GET_GLYPH_METRICS | + LAYOUT | + UPDATE_ACTUAL_SIZE | + REORDER | + ALIGN ); mImpl->mRecalculateNaturalSize = true; mImpl->RequestRelayout(); + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; + // As the font changes, recalculate the handle positions is needed. mImpl->mEventData->mUpdateLeftSelectionPosition = true; mImpl->mEventData->mUpdateRightSelectionPosition = true; @@ -775,17 +839,32 @@ void Controller::SetInputFontWeight( FontWeight weight ) if( EventData::SELECTING == mImpl->mEventData->mState ) { + CharacterIndex startOfSelectedText = 0u; + Length lengthOfSelectedText = 0u; FontDescriptionRun& fontDescriptionRun = UpdateSelectionFontStyleRun( mImpl->mEventData, - mImpl->mLogicalModel ); + mImpl->mLogicalModel, + startOfSelectedText, + lengthOfSelectedText ); fontDescriptionRun.weight = weight; fontDescriptionRun.weightDefined = true; // Request to relayout. - mImpl->mOperationsPending = ALL_OPERATIONS; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + VALIDATE_FONTS | + SHAPE_TEXT | + GET_GLYPH_METRICS | + LAYOUT | + UPDATE_ACTUAL_SIZE | + REORDER | + ALIGN ); mImpl->mRecalculateNaturalSize = true; mImpl->RequestRelayout(); + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; + // As the font might change, recalculate the handle positions is needed. mImpl->mEventData->mUpdateLeftSelectionPosition = true; mImpl->mEventData->mUpdateRightSelectionPosition = true; @@ -813,17 +892,32 @@ void Controller::SetInputFontWidth( FontWidth width ) if( EventData::SELECTING == mImpl->mEventData->mState ) { + CharacterIndex startOfSelectedText = 0u; + Length lengthOfSelectedText = 0u; FontDescriptionRun& fontDescriptionRun = UpdateSelectionFontStyleRun( mImpl->mEventData, - mImpl->mLogicalModel ); + mImpl->mLogicalModel, + startOfSelectedText, + lengthOfSelectedText ); fontDescriptionRun.width = width; fontDescriptionRun.widthDefined = true; // Request to relayout. - mImpl->mOperationsPending = ALL_OPERATIONS; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + VALIDATE_FONTS | + SHAPE_TEXT | + GET_GLYPH_METRICS | + LAYOUT | + UPDATE_ACTUAL_SIZE | + REORDER | + ALIGN ); mImpl->mRecalculateNaturalSize = true; mImpl->RequestRelayout(); + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; + // As the font might change, recalculate the handle positions is needed. mImpl->mEventData->mUpdateLeftSelectionPosition = true; mImpl->mEventData->mUpdateRightSelectionPosition = true; @@ -851,17 +945,32 @@ void Controller::SetInputFontSlant( FontSlant slant ) if( EventData::SELECTING == mImpl->mEventData->mState ) { + CharacterIndex startOfSelectedText = 0u; + Length lengthOfSelectedText = 0u; FontDescriptionRun& fontDescriptionRun = UpdateSelectionFontStyleRun( mImpl->mEventData, - mImpl->mLogicalModel ); + mImpl->mLogicalModel, + startOfSelectedText, + lengthOfSelectedText ); fontDescriptionRun.slant = slant; fontDescriptionRun.slantDefined = true; // Request to relayout. - mImpl->mOperationsPending = ALL_OPERATIONS; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + VALIDATE_FONTS | + SHAPE_TEXT | + GET_GLYPH_METRICS | + LAYOUT | + UPDATE_ACTUAL_SIZE | + REORDER | + ALIGN ); mImpl->mRecalculateNaturalSize = true; mImpl->RequestRelayout(); + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; + // As the font might change, recalculate the handle positions is needed. mImpl->mEventData->mUpdateLeftSelectionPosition = true; mImpl->mEventData->mUpdateRightSelectionPosition = true; @@ -888,17 +997,32 @@ void Controller::SetInputFontPointSize( float size ) if( EventData::SELECTING == mImpl->mEventData->mState ) { + CharacterIndex startOfSelectedText = 0u; + Length lengthOfSelectedText = 0u; FontDescriptionRun& fontDescriptionRun = UpdateSelectionFontStyleRun( mImpl->mEventData, - mImpl->mLogicalModel ); + mImpl->mLogicalModel, + startOfSelectedText, + lengthOfSelectedText ); fontDescriptionRun.size = static_cast( size * 64.f ); fontDescriptionRun.sizeDefined = true; // Request to relayout. - mImpl->mOperationsPending = ALL_OPERATIONS; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | + VALIDATE_FONTS | + SHAPE_TEXT | + GET_GLYPH_METRICS | + LAYOUT | + UPDATE_ACTUAL_SIZE | + REORDER | + ALIGN ); mImpl->mRecalculateNaturalSize = true; mImpl->RequestRelayout(); + mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = lengthOfSelectedText; + mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = lengthOfSelectedText; + // As the font might change, recalculate the handle positions is needed. mImpl->mEventData->mUpdateLeftSelectionPosition = true; mImpl->mEventData->mUpdateRightSelectionPosition = true; @@ -988,8 +1112,8 @@ Vector3 Controller::GetNaturalSize() mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u; mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mLogicalModel->mText.Count(); - // Store the actual control's width. - const float actualControlWidth = mImpl->mVisualModel->mControlSize.width; + // Store the actual control's size to restore later. + const Size actualControlSize = mImpl->mVisualModel->mControlSize; DoRelayout( Size( MAX_FLOAT, MAX_FLOAT ), static_cast( onlyOnceOperations | @@ -1014,8 +1138,8 @@ Vector3 Controller::GetNaturalSize() // Clear the update info. This info will be set the next time the text is updated. mImpl->mTextUpdateInfo.Clear(); - // Restore the actual control's width. - mImpl->mVisualModel->mControlSize.width = actualControlWidth; + // Restore the actual control's size. + mImpl->mVisualModel->mControlSize = actualControlSize; DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z ); } @@ -1098,7 +1222,7 @@ float Controller::GetHeightForWidth( float width ) bool Controller::Relayout( const Size& size ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f\n", this, size.width, size.height ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, (mImpl->mAutoScrollEnabled)?"true":"false" ); if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) ) { @@ -1114,6 +1238,7 @@ bool Controller::Relayout( const Size& size ) // Not worth to relayout if width or height is equal to zero. DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout (skipped)\n" ); + return glyphsRemoved; } @@ -1136,21 +1261,16 @@ bool Controller::Relayout( const Size& size ) } // Whether there are modify events. - const bool isModifyEventsEmpty = 0u == mImpl->mModifyEvents.Count(); - - // Make sure the model is up-to-date before layouting. - ProcessModifyEvents(); - mImpl->UpdateModel( mImpl->mOperationsPending ); - - // Style operations that need to be done if the text is modified. - if( !isModifyEventsEmpty ) + if( 0u != mImpl->mModifyEvents.Count() ) { + // Style operations that need to be done if the text is modified. mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | COLOR ); } - // Apply the style runs if text is modified. - bool updated = mImpl->UpdateModelStyle( mImpl->mOperationsPending ); + // Make sure the model is up-to-date before layouting. + ProcessModifyEvents(); + bool updated = mImpl->UpdateModel( mImpl->mOperationsPending ); // Layout the text. Size layoutSize; @@ -1191,8 +1311,8 @@ bool Controller::Relayout( const Size& size ) // Clear the update info. This info will be set the next time the text is updated. mImpl->mTextUpdateInfo.Clear(); - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout\n" ); + return updated; } @@ -1359,8 +1479,10 @@ bool Controller::DoRelayout( const Size& size, const CharacterIndex startIndex = mImpl->mTextUpdateInfo.mParagraphCharacterIndex; const Length requestedNumberOfCharacters = mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters; - if( LAYOUT & operations ) + if( NO_OPERATION != ( LAYOUT & operations ) ) { + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::DoRelayout LAYOUT & operations\n"); + // Some vectors with data needed to layout and reorder may be void // after the first time the text has been laid out. // Fill the vectors again. @@ -1378,7 +1500,7 @@ bool Controller::DoRelayout( const Size& size, if( 0u == totalNumberOfGlyphs ) { - if( UPDATE_ACTUAL_SIZE & operations ) + if( NO_OPERATION != ( UPDATE_ACTUAL_SIZE & operations ) ) { mImpl->mVisualModel->SetLayoutSize( Size::ZERO ); } @@ -1429,10 +1551,16 @@ bool Controller::DoRelayout( const Size& size, mImpl->mVisualModel->mLines, layoutSize ); + if( viewUpdated ) { + if ( NO_OPERATION != ( UPDATE_DIRECTION & operations ) ) + { + mImpl->mAutoScrollDirectionRTL = false; + } + // Reorder the lines - if( REORDER & operations ) + if( NO_OPERATION != ( REORDER & operations ) ) { Vector& bidirectionalInfo = mImpl->mLogicalModel->mBidirectionalParagraphInfo; Vector& bidirectionalLineInfo = mImpl->mLogicalModel->mBidirectionalLineInfo; @@ -1455,27 +1583,25 @@ bool Controller::DoRelayout( const Size& size, layoutParameters.lineBidirectionalInfoRunsBuffer = bidirectionalLineInfo.Begin(); layoutParameters.numberOfBidirectionalInfoRuns = bidirectionalLineInfo.Count(); - // TODO: update the conversion map instead creating it from scratch. - // Note this tables store indices to characters, so update the table means modify all the indices of the text after the last updated character. - // It's better to refactor this. Store this table per line and don't update the indices. - // For the cursor position probably is better to use the function instead creating a table. - // Set the bidirectional info into the model. - mImpl->mLogicalModel->SetVisualToLogicalMap( layoutParameters.lineBidirectionalInfoRunsBuffer, - layoutParameters.numberOfBidirectionalInfoRuns, - 0u, - mImpl->mLogicalModel->mText.Count() ); - // Re-layout the text. Reorder those lines with right to left characters. mImpl->mLayoutEngine.ReLayoutRightToLeftLines( layoutParameters, startIndex, requestedNumberOfCharacters, glyphPositions ); + if ( ( NO_OPERATION != ( UPDATE_DIRECTION & operations ) ) && ( numberOfLines > 0 ) ) + { + const LineRun* const firstline = mImpl->mVisualModel->mLines.Begin(); + if ( firstline ) + { + mImpl->mAutoScrollDirectionRTL = firstline->direction; + } + } } } // REORDER // Sets the actual size. - if( UPDATE_ACTUAL_SIZE & operations ) + if( NO_OPERATION != ( UPDATE_ACTUAL_SIZE & operations ) ) { mImpl->mVisualModel->SetLayoutSize( layoutSize ); } @@ -1489,7 +1615,7 @@ bool Controller::DoRelayout( const Size& size, layoutSize = mImpl->mVisualModel->GetLayoutSize(); } - if( ALIGN & operations ) + if( NO_OPERATION != ( ALIGN & operations ) ) { // The laid-out lines. Vector& lines = mImpl->mVisualModel->mLines; @@ -1501,7 +1627,11 @@ bool Controller::DoRelayout( const Size& size, viewUpdated = true; } - +#if defined(DEBUG_ENABLED) + std::string currentText; + GetText( currentText ); + DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::DoRelayout [%p] mImpl->mAutoScrollDirectionRTL[%s] [%s]\n", this, (mImpl->mAutoScrollDirectionRTL)?"true":"false", currentText.c_str() ); +#endif DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout, view updated %s\n", ( viewUpdated ? "true" : "false" ) ); return viewUpdated; } @@ -1890,10 +2020,11 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ // Retrieve the text's style for the given index. InputStyle style; + mImpl->RetrieveDefaultInputStyle( style ); mImpl->mLogicalModel->RetrieveStyle( styleIndex, style ); // Whether to add a new text color run. - const bool addColorRun = style.textColor != mImpl->mEventData->mInputStyle.textColor; + const bool addColorRun = ( style.textColor != mImpl->mEventData->mInputStyle.textColor ); // Whether to add a new font run. const bool addFontNameRun = style.familyName != mImpl->mEventData->mInputStyle.familyName; @@ -2043,10 +2174,10 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y ) // This is to avoid unnecessary relayouts when tapping an empty text-field bool relayoutNeeded( false ); - if( ( EventData::EDITING_WITH_PASTE_POPUP == mImpl->mEventData->mState ) || + if( ( EventData::EDITING_WITH_POPUP == mImpl->mEventData->mState ) || ( EventData::EDITING_WITH_PASTE_POPUP == mImpl->mEventData->mState ) ) { - mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE); // If Popup shown hide it here so can be shown again if required. + mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE ); // If Popup shown hide it here so can be shown again if required. } if( mImpl->IsShowingRealText() && ( EventData::INACTIVE != mImpl->mEventData->mState ) ) @@ -2273,8 +2404,13 @@ void Controller::PasteClipboardItemEvent() // Commit the current pre-edit text; the contents of the clipboard should be appended mImpl->ResetImfManager(); + // Temporary disable hiding clipboard + mImpl->SetClipboardHideEnable( false ); + // Paste PasteText( stringToPaste ); + + mImpl->SetClipboardHideEnable( true ); } void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button ) @@ -2582,13 +2718,16 @@ void Controller::ClearFontData() { mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID } - mImpl->mVisualModel->ClearCaches(); + // Set flags to update the model. mImpl->mTextUpdateInfo.mCharacterIndex = 0u; mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters; mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = mImpl->mLogicalModel->mText.Count(); mImpl->mTextUpdateInfo.mClearAll = true; + mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true; + mImpl->mRecalculateNaturalSize = true; + mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | VALIDATE_FONTS | SHAPE_TEXT |