sw/source/filter/ww8/ww8par5.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
New commits: commit ddbf7961ef0c33672ad27af6416a69c1180e62e8 Author: Oliver-Rainer Wittmann <[email protected]> Date: Tue Aug 21 12:28:29 2012 +0000 i#119446# correct condition for fields containing '.' or '/' See also: i#61075, i#89667, i#111684 Found by: Yan Ji Patch by: zjchen Review by: Oliver (cherry picked from commit 2eeb8010f1afbe47b56387a5ba96db41ece13fcc) Conflicts: sw/source/filter/ww8/ww8par5.cxx Change-Id: Ia53b599c01d1a4b46bd52eac8a933ac6c0605586 diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 37229cc..e746d6e 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -1060,13 +1060,16 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) pStrm->Seek( nOldPos ); // field codes which contain '/' or '.' are not displayed in WinWord + // skip if it is formula field or found space before. see #i119446, #i119585. + const xub_StrLen nDotPos = aStr.Search('.'); + const xub_StrLen nSlashPos = aStr.Search('/'); xub_StrLen nSpacePos = aStr.Search( ' ', 1 ); - if ( STRING_NOTFOUND == nSpacePos ) - nSpacePos = aStr.Len( ); - xub_StrLen nSearchPos = STRING_NOTFOUND; - if ( !( aStr.EqualsAscii( "=", 1, 1 ) ) && ( - ( ( nSearchPos = aStr.Search('.') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) || - ( ( nSearchPos = aStr.Search('/') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ) ) + if ( nSpacePos == STRING_NOTFOUND ) + nSpacePos = aStr.Len(); + + if ( !( aStr.EqualsAscii( "=", 1, 1 ) ) && + ((( nDotPos != STRING_NOTFOUND ) && ( nDotPos < nSpacePos )) || + (( nSlashPos != STRING_NOTFOUND ) && ( nSlashPos < nSpacePos )))) return aF.nLen; else { _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
