summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-11 15:52:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-16 12:45:16 +0100
commitc810c0aacb38d038bd058651f0b56138dedfe9c8 (patch)
tree5c4c1a9d94f1740cb4f3f4a60370cb4be965e7ea
parentcfb5013b0b8bd85536a053df4b17b6abd419718d (diff)
tdf#140239 leave current cursor valid if the contents won't change
Change-Id: I854e8e94c7415d9046088e364f966390c4fb762f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110691 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 7a1433eac51169791aabb020c4004e842dc22e24) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110868 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--extensions/source/propctrlr/usercontrol.cxx18
1 files changed, 8 insertions, 10 deletions
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()