diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-08 13:18:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-08 14:05:57 +0100 |
commit | c811c0706f0ecf3400e8fcc510ca283dd593237f (patch) | |
tree | ea5d9f1fb369e80d88181ccdec340707130e7c90 /sc | |
parent | f4e2e662d1635390359c6e9bd8335517daf1cc20 (diff) |
make sure length is within bounds
Change-Id: I86819211de809a57c240778a747ddad175137a9b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 581aafc65a4e..96513bc91efe 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -404,7 +404,8 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) { // use selected text as name for urls OUString sReturn = pOutView->GetSelected(); - sReturn = sReturn.copy(0, 255); + sal_Int32 nLen = std::min<sal_Int32>(sReturn.getLength(), 255); + sReturn = sReturn.copy(0, nLen); aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' ')); } } |