extensions/source/propctrlr/usercontrol.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
New commits: commit 816994a1759e1760e4b55f327a2c957fba3860e0 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Feb 11 15:52:07 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Feb 11 20:40:48 2021 +0100 tdf#140239 leave current cursor valid if the contents won't change Change-Id: I854e8e94c7415d9046088e364f966390c4fb762f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110770 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index 74390e1fcde2..fbf829b62938 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -241,18 +241,16 @@ namespace pcr { } - void SAL_CALL OFileUrlControl::setValue( const Any& _rValue ) + void SAL_CALL OFileUrlControl::setValue(const Any& rValue) { OUString sURL; - if ( _rValue >>= sURL ) - { - if (GraphicObject::isGraphicObjectUniqueIdURL(sURL)) - getTypedControlWindow()->set_entry_text(getTypedControlWindow()->GetPlaceHolder()); - else - getTypedControlWindow()->set_entry_text(sURL); - } - else - getTypedControlWindow()->set_entry_text( "" ); + SvtURLBox* pControlWindow = getTypedControlWindow(); + bool bSuccess = rValue >>= sURL; + if (bSuccess && GraphicObject::isGraphicObjectUniqueIdURL(sURL)) + sURL = pControlWindow->GetPlaceHolder(); + // tdf#140239 leave current cursor valid if the contents won't change + if (sURL != pControlWindow->GetURL()) + pControlWindow->set_entry_text(sURL); } Any SAL_CALL OFileUrlControl::getValue() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits