[Libreoffice] About "Same expression on both sides of '||'" in LockEntrySequence.cxx

Caolán McNamara caolanm at redhat.com
Mon Jan 16 08:15:18 PST 2012


On Sun, 2012-01-15 at 09:04 -0800, julien2412 wrote:
> First, I thought about just replacing the above line by this one : 
> if ( !pCtx->hasType || !pCtx->hasScope )

I have no idea, but http://rfc-ref.org/RFC-TEXTS/2518/chapter23.html
has...

<!ELEMENT lockentry (lockscope, locktype) >
<!ELEMENT lockscope (exclusive | shared) >
<!ELEMENT locktype (write) >

and this is LockEntrySequence_endelement_callback presumably to be
called on processing the close tag, so I would expect that at the end of
a lockentry tag we should have both a locktype and a lockscope

 case STATE_LOCKENTRY:
-   if ( !pCtx->hasType || !pCtx->hasType )
+   if ( !pCtx->hasType || !pCtx->hasScope )
      return 1; // abort

on the basis that presumably if either the type or scope of the lock is
missing then its busted assuming (a big ask) I read the dtd correctly.

C.



More information about the LibreOffice mailing list