Apache OpenOffice (AOO) Bugzilla – Issue 96089
vcl: ambiguous && || sequence
Last modified: 2008-12-12 11:49:41 UTC
X && Y || Z binds operator precedence-wise as (X && Y) || Z not X && (Y || Z) so I am a little suspicious about... vcl/source/window/menu.cxx if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )) which means if ( (ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE )) || ( pData->eType == MENUITEM_STRINGIMAGE )) is that what we really mean, or do we mean if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))) seeing as both MENUITEMs refer to "image"s of one type of another ? similarly in unx/gtk/gdi/salnativewidgets-gtk.cxx there is a confusing sequence of && || where one of them (the menu) section is slightly different to the other ones, which makes me suspicious that it might be intended to be the same as the others. If they're currently correct, then lets just stick some brackets around it to confirm it, but if not then the following patch might be what was intended. Just a guess though
Created attachment 57869 [details] dodgy code
committed in CWS vcl96 thanks for noticing.
please verify in CWS vcl96
verified
seen in DEV300_m37