src/tracks/ui/TextEditHelper.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 TextEditHelper::PasteSelectedText(AudacityProject& project)
{
    auto delegate = mDelegate.lock();
    if (!delegate)
        return false;
    wxString text, left, right;
    if (wxTheClipboard->IsSupported(wxDF_UNICODETEXT))
    {
        if (wxTheClipboard->Open()) {
            wxTextDataObject data;
            wxTheClipboard->GetData(data);
            wxTheClipboard->Close();
            text = data.GetText();
        }
        for (int i = 0; i < (int)text.length(); i++) {
            if (wxIscntrl(text[i])) {
                text[i] = wxT(' ');
            }
        }
    }
    int cur = mCurrentCursorPos, init = mInitialCursorPos;
    if (init > cur)
        std::swap(init, cur);
    left = mText.Left(init);
    if (cur < (int)mText.length())
        right = mText.Mid(cur);
    mText = left + text + right;
    delegate->OnTextModified(&project, mText);
    mInitialCursorPos = mCurrentCursorPos = left.length() + text.length();
    return true;
}
bool TextEditHelper :: PasteSelectedText ( AudacityProject & project ) { auto delegate = mDelegate . lock ( ) ; if ( ! delegate ) return false ; wxString text , left , right ; if ( wxTheClipboard -> IsSupported ( wxDF_UNICODETEXT ) ) { if ( wxTheClipboard -> Open ( ) ) { wxTextDataObject data ; wxTheClipboard -> GetData ( data ) ; wxTheClipboard -> Close ( ) ; text = data . GetText ( ) ; } for ( int i = 0 ; i < ( int ) text . length ( ) ; i ++ ) { if ( wxIscntrl ( text [ i ] ) ) { text [ i ] = wxT ( ' ' ) ; } } } int cur = mCurrentCursorPos , init = mInitialCursorPos ; if ( init > cur ) std :: swap ( init , cur ) ; left = mText . Left ( init ) ; if ( cur < ( int ) mText . length ( ) ) right = mText . Mid ( cur ) ; mText = left + text + right ; delegate -> OnTextModified ( & project , mText ) ; mInitialCursorPos = mCurrentCursorPos = left . length ( ) + text . length ( ) ; 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