Fix svace issue in TextField, TextEditor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-field-impl.cpp
index 5e6d740..32beca1 100644 (file)
@@ -1217,6 +1217,35 @@ Uint32Pair TextField::GetTextSelectionRange() const
   return range;
 }
 
+string TextField::CopyText()
+{
+  string copiedText = "";
+  if(mController && mController->IsShowingRealText())
+  {
+    copiedText = mController->CopyText();
+  }
+  return copiedText;
+}
+
+string TextField::CutText()
+{
+  string cutText = "";
+  if(mController && mController->IsShowingRealText())
+  {
+    cutText = mController->CutText();
+  }
+  return cutText;
+}
+
+void TextField::PasteText()
+{
+  if(mController)
+  {
+    SetKeyInputFocus(); //Giving focus to the field that was passed to the PasteText in case the passed field (current field) doesn't have focus.
+    mController->PasteText();
+  }
+}
+
 InputMethodContext TextField::GetInputMethodContext()
 {
   return mInputMethodContext;
@@ -1372,6 +1401,7 @@ void TextField::OnInitialize()
   // Forward input events to controller
   EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS));
   GetTapGestureDetector().SetMaximumTapsRequired(2);
+  GetTapGestureDetector().ReceiveAllTapEvents(true);
 
   self.TouchedSignal().Connect(this, &TextField::OnTouched);
 
@@ -2106,7 +2136,10 @@ TextField::TextField()
   mTextChanged(false),
   mCursorPositionChanged(false),
   mSelectionChanged(false),
-  mSelectionCleared(false)
+  mSelectionCleared(false),
+  mOldPosition(0u),
+  mOldSelectionStart(0u),
+  mOldSelectionEnd(0u)
 {
 }