diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-11 15:52:07 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-02-13 11:43:32 +0100 |
commit | 691bb5a48ec3281eb241bc3fef1d8874d10a4edb (patch) | |
tree | 905f977ed9d2e9fb1815e9878b70c48bfe5e10b1 /extensions | |
parent | 27a4aea50a9efa5c839b0ae2de1f9f14a7782f11 (diff) |
tdf#140239 leave current cursor valid if the contents won't change
Change-Id: I854e8e94c7415d9046088e364f966390c4fb762f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110772
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/usercontrol.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index b2abc87e8723..f26287029f86 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -231,18 +231,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() |