ooo-build r13359 - in trunk: . patches/dev300 patches/vba
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13359 - in trunk: . patches/dev300 patches/vba
- Date: Wed, 23 Jul 2008 02:44:06 +0000 (UTC)
Author: pflin
Date: Wed Jul 23 02:44:06 2008
New Revision: 13359
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13359&view=rev
Log:
2008-07-23 Fong Lin <pflin novell com>
* patches/vba/basic-replace-function-fix.diff:Fixed for n#411203.
* patches/dev300/apply: apply the new patch.
Added:
trunk/patches/vba/basic-replace-function-fix.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Wed Jul 23 02:44:06 2008
@@ -1711,6 +1711,7 @@
# Fixed for n#407805
basic-not-is-nothing.diff, n#407805, Fong
bytearray-string-fix.diff, i#91911, Fong
+basic-replace-function-fix.diff, n#411203, Fong
[ VBAUntested ]
SectionOwner => noelpwer
Added: trunk/patches/vba/basic-replace-function-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/basic-replace-function-fix.diff Wed Jul 23 02:44:06 2008
@@ -0,0 +1,50 @@
+--- basic/source/runtime/methods.cxx.orig 2008-07-22 22:11:52.000000000 +0800
++++ basic/source/runtime/methods.cxx 2008-07-23 10:27:43.000000000 +0800
+@@ -1401,26 +1401,33 @@ RTLFUNC(Replace)
+ if ( nArgCount == 6 )
+ bTextMode = rPar.Get(6)->GetInteger();
+
+- USHORT nStrLen = aExpStr.Len();
++ USHORT nExpStrLen = aExpStr.Len();
++ USHORT nFindStrLen = aFindStr.Len();
++ USHORT nReplaceStrLen = aReplaceStr.Len();
+
+- if( lStartPos <= nStrLen )
++ if( lStartPos <= nExpStrLen )
+ {
+- String aSrcStr( aExpStr );
+- if( bTextMode )
++ USHORT nPos = static_cast<USHORT>( lStartPos - 1 );
++ USHORT nCounts = 0;
++ while( lCount == -1 || lCount > nCounts )
+ {
++ String aSrcStr( aExpStr );
++ if( bTextMode )
++ {
+ aSrcStr.ToUpperAscii();
+ aFindStr.ToUpperAscii();
+- }
+-
+- USHORT nPos = aSrcStr.Search( aFindStr, static_cast<USHORT>( lStartPos - 1 ) );
+- USHORT nCounts = 0;
+- USHORT nReplaceLength = aReplaceStr.Len() ? aReplaceStr.Len():1;
+- while( nPos != STRING_NOTFOUND && (lCount == -1 || lCount > nCounts) )
+- {
+- aExpStr.Replace( nPos, aFindStr.Len(), aReplaceStr );
+- nPos = nPos + nReplaceLength;
++ }
+ nPos = aSrcStr.Search( aFindStr, nPos );
+- nCounts++;
++ if( nPos != STRING_NOTFOUND )
++ {
++ aExpStr.Replace( nPos, nFindStrLen, aReplaceStr );
++ nPos = nPos - nFindStrLen + nReplaceStrLen + 1;
++ nCounts++;
++ }
++ else
++ {
++ break;
++ }
+ }
+ }
+ rPar.Get(0)->PutString( aExpStr.Copy( static_cast<USHORT>(lStartPos - 1) ) );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]