src/tracks/labeltrack/ui/LabelTrackView.cpp
// PRL:  should this set other fields of the label selection?
/// Paste the text on the clipboard to text box
///  @return true if mouse is clicked in text box, false otherwise
should this set other fields of the label selection.
Paste the text on the clipboard to text box
@return true if mouse is clicked in text box, false otherwise
should this set other fields of the label selection . Paste the text on the clipboard to text box @return true if mouse is clicked in text box false otherwise
bool LabelTrackView::PasteSelectedText(
   AudacityProject &project, double sel0, double sel1 )
{
   const auto pTrack = FindLabelTrack();
   if (!IsValidIndex(mTextEditIndex, project))
      SetTextSelection(AddLabel(SelectedRegion(sel0, sel1)));
   wxString text, left, right;
   if (IsTextClipSupported()) {
      if (wxTheClipboard->Open()) {
         wxTextDataObject data;
         wxTheClipboard->GetData(data);
         wxTheClipboard->Close();
         text = data.GetText();
      }
      if (!mTextEditIndex.IsModified()) {
         mUndoLabel = text;
      }
      for (int i = 0; i < (int)text.length(); i++) {
         if (wxIscntrl(text[i])) {
            text[i] = wxT(' ');
         }
      }
   }
   const auto &mLabels = pTrack->GetLabels();
   auto labelStruct = mLabels[mTextEditIndex];
   auto &title = labelStruct.title;
   int cur = mCurrentCursorPos, init = mInitialCursorPos;
   if (init > cur)
      std::swap(init, cur);
   left = title.Left(init);
   if (cur < (int)title.length())
      right = title.Mid(cur);
   title = left + text + right;
   pTrack->SetLabel(mTextEditIndex, labelStruct );
   mInitialCursorPos =  mCurrentCursorPos = left.length() + text.length();
   mTextEditIndex.SetModified(true);
   return true;
}
bool LabelTrackView :: PasteSelectedText ( AudacityProject & project , double sel0 , double sel1 ) { const auto pTrack = FindLabelTrack ( ) ; if ( ! IsValidIndex ( mTextEditIndex , project ) ) SetTextSelection ( AddLabel ( SelectedRegion ( sel0 , sel1 ) ) ) ; wxString text , left , right ; if ( IsTextClipSupported ( ) ) { if ( wxTheClipboard -> Open ( ) ) { wxTextDataObject data ; wxTheClipboard -> GetData ( data ) ; wxTheClipboard -> Close ( ) ; text = data . GetText ( ) ; } if ( ! mTextEditIndex . IsModified ( ) ) { mUndoLabel = text ; } for ( int i = 0 ; i < ( int ) text . length ( ) ; i ++ ) { if ( wxIscntrl ( text [ i ] ) ) { text [ i ] = wxT ( ' ' ) ; } } } const auto & mLabels = pTrack -> GetLabels ( ) ; auto labelStruct = mLabels [ mTextEditIndex ] ; auto & title = labelStruct . title ; int cur = mCurrentCursorPos , init = mInitialCursorPos ; if ( init > cur ) std :: swap ( init , cur ) ; left = title . Left ( init ) ; if ( cur < ( int ) title . length ( ) ) right = title . Mid ( cur ) ; title = left + text + right ; pTrack -> SetLabel ( mTextEditIndex , labelStruct ) ; mInitialCursorPos = mCurrentCursorPos = left . length ( ) + text . length ( ) ; mTextEditIndex . SetModified ( true ) ; return true ; }
PRL:  should this set other fields of the label selection?
PRL : should this set other fields of the label selection?
// if text data is available // Convert control characters to blanks