You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by tr...@apache.org on 2018/01/30 20:10:07 UTC

svn commit: r1822695 - /openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx

Author: truckman
Date: Tue Jan 30 20:10:07 2018
New Revision: 1822695

URL: http://svn.apache.org/viewvc?rev=1822695&view=rev
Log:
Be slightly less tricky and change
	do {
	} while (!this);
to 
	do {
	} while (0);

Computing !this must be done at runtime, whereas the intent is for
the loop to exit after the first iteration, which can be handled at
compile time when using a constant zero.  Also, "this" should always
be non-NULL in valid c++ code, but if ever happened to be NULL, then
this code could loop forever.
 
While here, translate nearby comments.


Modified:
    openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx

Modified: openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx?rev=1822695&r1=1822694&r2=1822695&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx (original)
+++ openoffice/trunk/main/sw/source/filter/ww8/ww8scan.cxx Tue Jan 30 20:10:07 2018
@@ -6197,12 +6197,12 @@ WW8Style::WW8Style(SvStream& rStream, WW
         if ( 20 > nRead ) break;
         rSt >> ftcBi;
 
-        // ggfs. den Rest ueberlesen
+        // ggfs. Check the rest
         if( 20 < nRead )
             rSt.SeekRel( nRead-20 );
     }
-    while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
-                    //   und kann vorzeitig per "break" verlassen werden.
+    while( 0 ); // Trick: The above block is run through exactly once
+                // and can be prematurely left by "break".
 
     if( 0 != rSt.GetError() )
     {
@@ -6255,19 +6255,19 @@ WW8_STD* WW8Style::Read1STDFixed( short&
             if( 8 > nRead ) break;
             rSt >> pStd->bchUpe;
 
-            // ab Ver8 sollten diese beiden Felder dazukommen:
+            // from Ver8 these two fields should be added
             if(10 > nRead ) break;
             rSt >> a16Bit;
             pStd->fAutoRedef =   a16Bit & 0x0001       ;
             pStd->fHidden    = ( a16Bit & 0x0002 ) >> 1;
 
-            // man kann nie wissen: vorsichtshalber ueberlesen
-            // wir eventuelle Fuellsel, die noch zum BASE-Part gehoeren...
+            // you never know: as a precaution, we read over any
+            // filler that still belongs to the BASE part...
             if( 10 < nRead )
                 rSt.SeekRel( nRead-10 );
         }
-        while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
-                        //   und kann vorzeitig per "break" verlassen werden.
+        while( 0 ); // Trick: above block is run through exactly once and
+                    // can be prematurely left by "break".
 
         if( (0 != rSt.GetError()) || !nRead )
             DELETEZ( pStd );        // per NULL den Error melden