diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-28 15:51:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-28 21:11:38 +0200 |
commit | d3313148d9ceb6427ddfef32b26b9d87cbdb3e14 (patch) | |
tree | f8491d523664e35bda4f2e1cd03e3a29e86dc5af /extensions/source/bibliography/framectr.cxx | |
parent | e508b33fcc3619063cf00daa6c0dc191d4046174 (diff) |
should check if edit is editable for allowing paste
Change-Id: I70d490467f288043089aa5f8e6e79764be6e419a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101554
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions/source/bibliography/framectr.cxx')
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index aa1b91e85a1f..6e70479e20d2 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -650,23 +650,22 @@ void BibFrameController_Impl::addStatusListener( { vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); Edit* pEdit = dynamic_cast<Edit*>( pChild ); - if( pEdit ) - aEvent.IsEnabled = !pEdit->IsReadOnly() && pEdit->GetSelection().Len(); + aEvent.IsEnabled = pEdit && !pEdit->IsReadOnly() && pEdit->GetSelection().Len(); } if(aURL.Path == "Copy") { vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); Edit* pEdit = dynamic_cast<Edit*>( pChild ); - if( pEdit ) - aEvent.IsEnabled = pEdit->GetSelection().Len() > 0; + aEvent.IsEnabled = pEdit && pEdit->GetSelection().Len(); } else if(aURL.Path == "Paste" ) { - aEvent.IsEnabled = false; + aEvent.IsEnabled = false; vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); - if(pChild) + Edit* pEdit = dynamic_cast<Edit*>( pChild ); + if (pEdit && !pEdit->IsReadOnly()) { - uno::Reference< datatransfer::clipboard::XClipboard > xClip = pChild->GetClipboard(); + uno::Reference< datatransfer::clipboard::XClipboard > xClip = pEdit->GetClipboard(); if(xClip.is()) { uno::Reference< datatransfer::XTransferable > xDataObj; |