Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3409

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/09/3409/1

follow on fix for fdo#62090 ensure out of range startpos is handled

Change-Id: Ic1f57480a36415998748faeea3b606a47d277181
(cherry picked from commit 0054b438013ef412c2df3b7ebe93dd1935ec07af)
---
M basic/source/runtime/methods.cxx
1 file changed, 6 insertions(+), 2 deletions(-)



diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 7f724b1..666dbba 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1261,8 +1261,12 @@
                 else
                 {
                     aResultStr = aArgStr;
-                    aResultStr.remove( nStartPos, nLen );
-                    aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), 
std::min(nLen, rPar.Get(4)->GetOUString().getLength()));
+                    sal_Int32 nTmpStartPos = nStartPos;
+                    if ( nTmpStartPos > aArgStr.getLength() )
+                        nTmpStartPos =  aArgStr.getLength();
+                    else
+                        aResultStr.remove( nTmpStartPos, nLen );
+                    aResultStr.insert( nTmpStartPos, rPar.Get(4)->GetOUString().getStr(), 
std::min(nLen, rPar.Get(4)->GetOUString().getLength()));
                 }
 
                 rPar.Get(1)->PutString( aResultStr.makeStringAndClear() );

-- 
To view, visit https://gerrit.libreoffice.org/3409
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1f57480a36415998748faeea3b606a47d277181
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Noel Power <noel.power@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.