Kaydet (Commit) 05f87e42 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky Kaydeden (comit) Eike Rathke

fdo#74042 Don't attempt to copy more than a string has to offer

Change-Id: I5898efeaecce2cf2ee7d4ac581a21761533138bd
Reviewed-on: https://gerrit.libreoffice.org/7698Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 3e99ab21
...@@ -698,7 +698,7 @@ void ScEditShell::GetState( SfxItemSet& rSet ) ...@@ -698,7 +698,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
{ {
// use selected text as name for urls // use selected text as name for urls
OUString sReturn = pActiveView->GetSelected(); OUString sReturn = pActiveView->GetSelected();
sReturn = sReturn.copy(0, 255); sReturn = sReturn.copy(0, std::min(sReturn.getLength(), 255));
aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' ')); aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
} }
rSet.Put(aHLinkItem); rSet.Put(aHLinkItem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment