Fixed clipboard disappearing issue on selection
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index 9180ec9..3a211e1 100644 (file)
@@ -1430,7 +1430,7 @@ 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 ) )
   {
     // Some vectors with data needed to layout and reorder may be void
     // after the first time the text has been laid out.
@@ -1449,7 +1449,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 );
       }
@@ -1503,7 +1503,7 @@ bool Controller::DoRelayout( const Size& size,
     if( viewUpdated )
     {
       // Reorder the lines
-      if( REORDER & operations )
+      if( NO_OPERATION != ( REORDER & operations ) )
       {
         Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo = mImpl->mLogicalModel->mBidirectionalParagraphInfo;
         Vector<BidirectionalLineInfoRun>& bidirectionalLineInfo = mImpl->mLogicalModel->mBidirectionalLineInfo;
@@ -1536,7 +1536,7 @@ bool Controller::DoRelayout( const Size& size,
       } // REORDER
 
       // Sets the actual size.
-      if( UPDATE_ACTUAL_SIZE & operations )
+      if( NO_OPERATION != ( UPDATE_ACTUAL_SIZE & operations ) )
       {
         mImpl->mVisualModel->SetLayoutSize( layoutSize );
       }
@@ -1550,7 +1550,7 @@ bool Controller::DoRelayout( const Size& size,
     layoutSize = mImpl->mVisualModel->GetLayoutSize();
   }
 
-  if( ALIGN & operations )
+  if( NO_OPERATION != ( ALIGN & operations ) )
   {
     // The laid-out lines.
     Vector<LineRun>& lines = mImpl->mVisualModel->mLines;
@@ -2105,10 +2105,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 ) )
@@ -2335,8 +2335,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 )