Apache OpenOffice (AOO) Bugzilla – Issue 127044
Defects in the code
Last modified: 2017-11-09 05:55:32 UTC
We checked AOO by static analyzer AppChecker (https://cnpo.ru/en/solutions/appchecker.php) and it found some possible defects: 1) The left and the right parts of the binary expression are indetical main/binaryurp/source/lessoperators.cxx, line 43 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/binaryurp/source/lessoperators.cxx#L43 if( rA.eTypeClass != rA.eTypeClass) 2) The left and the right parts of the binary expression are indetical main/editeng/source/accessibility/AccessibleStaticTextBase.cxx line 362 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/editeng/source/accessibility/AccessibleStaticTextBase.cxx#L362 if( aTextSegment.SegmentStart != -1 && aTextSegment.SegmentStart != -1 ) 3) The left and the right parts of the binary expression are indetical main/editeng/source/uno/unotext.cxx, line 1943 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/editeng/source/uno/unotext.cxx#L1943 aRange.nStartPara = aRange.nStartPara; 4) The left and the right parts of the binary expression are indetical main/sc/source/ui/unoobj/chart2uno.cxx line 640 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/sc/source/ui/unoobj/chart2uno.cxx#L640 if (nRow > 0 && nRow > 0) 5) The left and the right parts of the binary expression are indetical main/svtools/source/dialogs/addresstemplate.cxx line 187 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/svtools/source/dialogs/addresstemplate.cxx#L187 for (;pFields != pFields; ++pFields) 6) The left and the right parts of the binary expression are indetical main/tools/source/fsys/dirent.cxx, line 2670 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/tools/source/fsys/dirent.cxx#L2670 if ( pNewDir->eFlag == FSYS_FLAG_ABSROOT || pNewDir->eFlag == FSYS_FLAG_ABSROOT ... ) 7) The left and the right parts of the binary expression are indetical main/sc/source/core/tool/viewopti.cxx, line 107 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/sc/source/core/tool/viewopti.cxx#L107 return ( nFldDrawX == rCpy.nFldDrawX && nFldDrawX == rCpy.nFldDrawX ...) 8) Using bitwise operation to the boolean expression main/framework/source/uielement/newmenucontroller.cxx, line 255 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/framework/source/uielement/newmenucontroller.cxx#L255 if ( nId & ( pPopupMenu->GetItemType( nId ) != MENUITEM_SEPARATOR ))
You can submit a patch with these corrections.
9) The left and the right parts of the binary expression are indetical main/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java, line 94 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java#L94 descriptor = descriptor; I think it should be: this.descriptor = descriptor; 10) The left and the right parts of the binary expression are indetical main/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java, line 161 https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java#L161 if (EndianConverter.readShort(dwHeight) != EndianConverter.readShort(dwHeight)) I guess it should be: if (EndianConverter.readShort(dwHeight) != EndianConverter.readShort(rhs.dwHeight))
"damjan" committed SVN revision 1814705 into trunk: #127044# - Defects in the code
1, 2, 5, 9 and 10 are simple and obvious and have been committed in revision 1814705. The others need more research and testing. Thank you for your bug report!