[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Maxim Monastirsky momonasmon at gmail.com
Tue Jan 28 07:30:14 PST 2014


 sc/source/ui/view/editsh.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7bd346b63be249e3ab2695a8f1e767baf0ba8861
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon Jan 27 19:58:51 2014 +0200

    fdo#74042 Don't attempt to copy more than a string has to offer
    
    Change-Id: I5898efeaecce2cf2ee7d4ac581a21761533138bd
    Reviewed-on: https://gerrit.libreoffice.org/7715
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 17ae3bb..a7fe53c 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);


More information about the Libreoffice-commits mailing list