incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1375536 - /incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx
Date Tue, 21 Aug 2012 13:28:29 GMT
Author: orw
Date: Tue Aug 21 13:28:29 2012
New Revision: 1375536

URL: http://svn.apache.org/viewvc?rev=1375536&view=rev
Log:
#119446# - method <SwWW8ImplReader::Read_Field(..)> - correct condition for fields containing
'.' or '/'

         Found by: Yan Ji
         Patch by: zjchen
         Review by: Oliver

Modified:
    incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx

Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx?rev=1375536&r1=1375535&r2=1375536&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx Tue Aug 21 13:28:29 2012
@@ -987,9 +987,16 @@ long SwWW8ImplReader::Read_Field(WW8PLCF
         pStrm->Seek( nOldPos );
 
         //#124725# field codes which contain '/' or '.' are not displayed in WinWord
-        if (!aStr.EqualsAscii(" ADDIN", 0, 6) &&
-            (aStr.Search('.') != STRING_NOTFOUND ||
-             aStr.Search('/') != STRING_NOTFOUND))
+        // 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 ( 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
             return aF.nLen - aF.nLRes - 1;  // so viele ueberlesen, das Resultfeld



Mime
View raw message