summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-01-27 19:58:51 +0200
committerEike Rathke <erack@redhat.com>2014-01-28 15:29:11 +0000
commit05f87e422b2f51ccf87bd0e7cba86e12a404199e (patch)
treeccb6057840413d6355e1359fbc1cb815ee924218 /sc
parent3e99ab21d389e12b5fca3ef6828a8cded49489ec (diff)
fdo#74042 Don't attempt to copy more than a string has to offer
Change-Id: I5898efeaecce2cf2ee7d4ac581a21761533138bd Reviewed-on: https://gerrit.libreoffice.org/7698 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/editsh.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index fccc0ea964a7..5dceae777aee 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -698,7 +698,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
{
// use selected text as name for urls
OUString sReturn = pActiveView->GetSelected();
- sReturn = sReturn.copy(0, 255);
+ sReturn = sReturn.copy(0, std::min(sReturn.getLength(), 255));
aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
}
rSet.Put(aHLinkItem);