merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0118-sw-ww8-field-fix.diff
blobfd190746252573249850dad9f3ae89232ecc7ae1
1 --- sw/source/filter/ww8/ww8par5.cxx 2009-08-04 15:54:05.000000000 +0200
2 +++ sw/source/filter/ww8/ww8par5.cxx 2009-08-14 10:56:23.000000000 +0200
3 @@ -994,9 +994,12 @@
4 pStrm->Seek( nOldPos );
6 //#124725# field codes which contain '/' or '.' are not displayed in WinWord
7 - if (!aStr.EqualsAscii(" ADDIN", 0, 6) &&
8 - (aStr.Search('.') != STRING_NOTFOUND ||
9 - aStr.Search('/') != STRING_NOTFOUND))
10 + xub_StrLen nSpacePos = aStr.Search( ' ', 1 );
11 + if ( STRING_NOTFOUND == nSpacePos )
12 + nSpacePos = aStr.Len( );
13 + xub_StrLen nSearchPos = STRING_NOTFOUND;
14 + if ( ( ( nSearchPos = aStr.Search('.') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ||
15 + ( ( nSearchPos = aStr.Search('/') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) )
16 return aF.nLen;
17 else
18 return aF.nLen - aF.nLRes - 1; // so viele ueberlesen, das Resultfeld