bridges/source/jni_uno/jni_java2uno.cxx | 2 chart2/source/view/charttypes/GL3DBarChart.cxx | 8 - comphelper/source/misc/sequenceashashmap.cxx | 13 -- comphelper/source/property/opropertybag.cxx | 4 comphelper/source/property/opropertybag.hxx | 2 cppu/source/typelib/typelib.cxx | 6 - include/cppuhelper/propshlp.hxx | 1 sw/source/core/text/txtdrop.cxx | 11 -- tools/source/inet/inetmime.cxx | 1 vcl/source/gdi/pdfwriter_impl.cxx | 125 ++++++++++++------------- vcl/source/gdi/pdfwriter_impl.hxx | 4 11 files changed, 80 insertions(+), 97 deletions(-)
New commits: commit 9df8d2a922b85d76011c8ab67a1ded8f367e7aec Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 16:13:02 2014 +0100 coverity#704183 Resource leak in object Change-Id: I64b995c15a83d71aaa6745323141e71cc55cf000 diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index bbacab8..fcaa685 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1143,9 +1143,9 @@ void PDFWriterImpl::PDFPage::beginStream() aLine.append( ">>\nstream\n" ); if( ! m_pWriter->writeBuffer( aLine.getStr(), aLine.getLength() ) ) return; - if( osl_File_E_None != osl_getFilePos( m_pWriter->m_aFile, &m_nBeginStreamPos ) ) + if (osl::File::E_None != m_pWriter->m_aFile.getPos(m_nBeginStreamPos)) { - osl_closeFile( m_pWriter->m_aFile ); + m_pWriter->m_aFile.close(); m_pWriter->m_bOpen = false; } #if defined ( COMPRESS_PAGES ) && !defined ( DEBUG_DISABLE_PDFCOMPRESSION ) @@ -1160,9 +1160,9 @@ void PDFWriterImpl::PDFPage::endStream() m_pWriter->endCompression(); #endif sal_uInt64 nEndStreamPos; - if( osl_File_E_None != osl_getFilePos( m_pWriter->m_aFile, &nEndStreamPos ) ) + if (osl::File::E_None != m_pWriter->m_aFile.getPos(nEndStreamPos)) { - osl_closeFile( m_pWriter->m_aFile ); + m_pWriter->m_aFile.close(); m_pWriter->m_bOpen = false; return; } @@ -1720,7 +1720,8 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal m_nSignatureLastByteRangeNoOffset( 0 ), m_nResourceDict( -1 ), m_nFontDictObject( -1 ), - m_aFile(0), + m_aContext(rContext), + m_aFile(m_aContext.URL), m_bOpen(false), m_pCodec( NULL ), m_pMemStream(NULL), @@ -1744,7 +1745,6 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal doTestCode(); } #endif - m_aContext = rContext; m_aStructure.push_back( PDFStructureElement() ); m_aStructure[0].m_nOwnElement = 0; m_aStructure[0].m_nParentElement = 0; @@ -1758,17 +1758,17 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal aState.m_aFont = aFont; m_aGraphicsStack.push_front( aState ); - oslFileError aError = osl_openFile( m_aContext.URL.pData, &m_aFile, osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); - if( aError != osl_File_E_None ) + osl::File::RC aError = m_aFile.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Create); + if (aError != osl::File::E_None) { - if( aError == osl_File_E_EXIST ) + if (aError == osl::File::E_EXIST) { - aError = osl_openFile( m_aContext.URL.pData, &m_aFile, osl_File_OpenFlag_Write ); - if( aError == osl_File_E_None ) - aError = osl_setFileSize( m_aFile, 0 ); + aError = m_aFile.open(osl_File_OpenFlag_Write); + if (aError == osl::File::E_None) + aError = m_aFile.setSize(0); } } - if( aError != osl_File_E_None ) + if (aError != osl::File::E_None) return; m_bOpen = true; @@ -1820,7 +1820,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal aBuffer.append( "\n%\303\244\303\274\303\266\303\237\n" ); if( !writeBuffer( aBuffer.getStr(), aBuffer.getLength() ) ) { - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; return; } @@ -2166,14 +2166,12 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes ) if( m_aDocDigest ) rtl_digest_updateMD5( m_aDocDigest, pWriteBuffer, static_cast<sal_uInt32>(nBytes) ); - if( osl_writeFile( m_aFile, - pWriteBuffer, - nBytes, &nWritten ) != osl_File_E_None ) + if (m_aFile.write(pWriteBuffer, nBytes, nWritten) != osl::File::E_None) nWritten = 0; if( nWritten != nBytes ) { - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; } } @@ -2352,15 +2350,15 @@ bool PDFWriterImpl::updateObject( sal_Int32 n ) return false; sal_uInt64 nOffset = ~0U; - oslFileError aError = osl_getFilePos( m_aFile, &nOffset ); - DBG_ASSERT( aError == osl_File_E_None, "could not register object" ); - if( aError != osl_File_E_None ) + osl::File::RC aError = m_aFile.getPos(nOffset); + DBG_ASSERT( aError == osl::File::E_None, "could not register object" ); + if (aError != osl::File::E_None) { - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; } m_aObjects[ n-1 ] = nOffset; - return aError == osl_File_E_None; + return aError == osl::File::E_None; } #define CHECK_RETURN( x ) if( !(x) ) return 0 @@ -3310,7 +3308,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical throw FontException(); sal_uInt64 nBeginStreamPos = 0; - osl_getFilePos( m_aFile, &nBeginStreamPos ); + m_aFile.getPos(nBeginStreamPos); beginCompression(); checkAndEnableStreamEncryption( nStreamObject ); @@ -3435,7 +3433,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical disableStreamEncryption(); sal_uInt64 nEndStreamPos = 0; - osl_getFilePos( m_aFile, &nEndStreamPos ); + m_aFile.getPos(nEndStreamPos); // and finally close the stream aLine.setLength( 0 ); @@ -3920,7 +3918,7 @@ bool PDFWriterImpl::emitFonts() aLine.append( ">>\n" "stream\n" ); if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return false; - if ( osl_File_E_None != osl_getFilePos( m_aFile, &nStartPos ) ) return false; + if ( osl::File::E_None != m_aFile.getPos(nStartPos) ) return false; // copy font file beginCompression(); @@ -3962,7 +3960,7 @@ bool PDFWriterImpl::emitFonts() aLine.append( ">>\n" "stream\n" ); if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return false; - if ( osl_File_E_None != osl_getFilePos( m_aFile, &nStartPos ) ) return false; + if ( osl::File::E_None != m_aFile.getPos(nStartPos) ) return false; // emit PFB-sections without section headers beginCompression(); @@ -3983,7 +3981,7 @@ bool PDFWriterImpl::emitFonts() aFontFile.close(); sal_uInt64 nEndPos = 0; - if ( osl_File_E_None != osl_getFilePos( m_aFile, &nEndPos ) ) return false; + if ( osl::File::E_None != m_aFile.getPos(nEndPos) ) return false; // end the stream aLine.setLength( 0 ); aLine.append( "\nendstream\nendobj\n\n" ); @@ -5878,7 +5876,7 @@ bool PDFWriterImpl::emitSignature() aLine.append("<</Contents <" ); sal_uInt64 nOffset = ~0U; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nOffset ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nOffset) ) ); m_nSignatureContentOffset = nOffset + aLine.getLength(); @@ -5964,20 +5962,20 @@ bool PDFWriterImpl::finalizeSignature() // 1- calculate last ByteRange value sal_uInt64 nOffset = ~0U; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nOffset ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nOffset) ) ); sal_Int64 nLastByteRangeNo = nOffset - (m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1); // 2- overwrite the value to the m_nSignatureLastByteRangeNoOffset position sal_uInt64 nWritten = 0; - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureLastByteRangeNoOffset ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, m_nSignatureLastByteRangeNoOffset) ) ); OStringBuffer aByteRangeNo( 256 ); aByteRangeNo.append( nLastByteRangeNo, 10); aByteRangeNo.append( " ]" ); - if( osl_writeFile( m_aFile, aByteRangeNo.getStr(), aByteRangeNo.getLength(), &nWritten ) != osl_File_E_None ) + if (m_aFile.write(aByteRangeNo.getStr(), aByteRangeNo.getLength(), nWritten) != osl::File::E_None) { - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, nOffset ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, nOffset)) ); return false; } @@ -6003,7 +6001,7 @@ bool PDFWriterImpl::finalizeSignature() SAL_WARN("vcl.gdi", "PDF Signing: Certificate Subject: " << cert->subjectName << "\n\tCertificate Issuer: " << cert->issuerName); // Prepare buffer and calculate PDF file digest - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, 0) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, 0)) ); HashContextScope hc(HASH_Create(HASH_AlgSHA1)); if (!hc.get()) @@ -6018,16 +6016,15 @@ bool PDFWriterImpl::finalizeSignature() sal_uInt64 bytesRead; //FIXME: Check if SHA1 is calculated from the correct byterange - - CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer.get(), m_nSignatureContentOffset - 1 , &bytesRead ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.read(buffer.get(), m_nSignatureContentOffset - 1 , bytesRead)) ); if (bytesRead != (sal_uInt64)m_nSignatureContentOffset - 1) SAL_WARN("vcl.gdi", "PDF Signing: First buffer read failed!"); HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer.get()), bytesRead); - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1)) ); buffer.reset(new char[nLastByteRangeNo + 1]); - CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer.get(), nLastByteRangeNo, &bytesRead ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.read(buffer.get(), nLastByteRangeNo, bytesRead)) ); if (bytesRead != (sal_uInt64) nLastByteRangeNo) SAL_WARN("vcl.gdi", "PDF Signing: Second buffer read failed!"); @@ -6141,12 +6138,12 @@ bool PDFWriterImpl::finalizeSignature() // Set file pointer to the m_nSignatureContentOffset, we're ready to overwrite PKCS7 object nWritten = 0; - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureContentOffset) ) ); - osl_writeFile(m_aFile, cms_hexbuffer.getStr(), cms_hexbuffer.getLength(), &nWritten); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, m_nSignatureContentOffset)) ); + m_aFile.write(cms_hexbuffer.getStr(), cms_hexbuffer.getLength(), nWritten); NSS_CMSMessage_Destroy(cms_msg); - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, nOffset ) ) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, nOffset)) ); return true; } @@ -6337,7 +6334,7 @@ sal_Int32 PDFWriterImpl::emitOutputIntent() if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return 0; //get file position sal_uInt64 nBeginStreamPos = 0; - osl_getFilePos( m_aFile, &nBeginStreamPos ); + m_aFile.getPos(nBeginStreamPos); beginCompression(); checkAndEnableStreamEncryption( nICCObject ); cmsHPROFILE hProfile = cmsCreate_sRGBProfile(); @@ -6354,7 +6351,7 @@ sal_Int32 PDFWriterImpl::emitOutputIntent() disableStreamEncryption(); endCompression(); sal_uInt64 nEndStreamPos = 0; - osl_getFilePos( m_aFile, &nEndStreamPos ); + m_aFile.getPos(nEndStreamPos); if( !written ) return 0; @@ -6619,7 +6616,7 @@ bool PDFWriterImpl::emitTrailer() // emit xref table // remember start sal_uInt64 nXRefOffset = 0; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nXRefOffset )) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nXRefOffset )) ); CHECK_RETURN( writeBuffer( "xref\n", 5 ) ); sal_Int32 nObjects = m_aObjects.size(); @@ -6884,9 +6881,9 @@ bool PDFWriterImpl::emitAdditionalStreams() if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) return false; sal_uInt64 nBeginStreamPos = 0, nEndStreamPos = 0; - if( osl_File_E_None != osl_getFilePos( m_aFile, &nBeginStreamPos ) ) + if( osl::File::E_None != m_aFile.getPos(nBeginStreamPos) ) { - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; } if( rStream.m_bCompress ) @@ -6903,9 +6900,9 @@ bool PDFWriterImpl::emitAdditionalStreams() if( rStream.m_bCompress ) endCompression(); - if( osl_File_E_None != osl_getFilePos( m_aFile, &nEndStreamPos ) ) + if (osl::File::E_None != m_aFile.getPos(nEndStreamPos)) { - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; return false; } @@ -6962,7 +6959,7 @@ bool PDFWriterImpl::emit() CHECK_RETURN( finalizeSignature() ); #endif - osl_closeFile( m_aFile ); + m_aFile.close(); m_bOpen = false; return true; @@ -9533,7 +9530,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); sal_uInt64 nStartStreamPos = 0; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartStreamPos )) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nStartStreamPos)) ); checkAndEnableStreamEncryption( nFunctionObject ); beginCompression(); @@ -9575,7 +9572,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) disableStreamEncryption(); sal_uInt64 nEndStreamPos = 0; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nEndStreamPos )) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nEndStreamPos)) ); aLine.setLength( 0 ); aLine.append( "\nendstream\nendobj\n\n" ); @@ -9971,7 +9968,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) "stream\n" ); CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); sal_uInt64 nStartPos = 0; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nStartPos)) ); checkAndEnableStreamEncryption( rObject.m_nObject ); #ifndef DEBUG_DISABLE_PDFCOMPRESSION @@ -10013,7 +10010,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) disableStreamEncryption(); sal_uInt64 nEndPos = 0; - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nEndPos )) ); + CHECK_RETURN( (osl::File::E_None == m_aFile.getPos(nEndPos)) ); aLine.setLength( 0 ); aLine.append( "\nendstream\nendobj\n\n" ); CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 96e0961..461c31a 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -27,7 +27,7 @@ #include <boost/shared_array.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#include <osl/file.h> +#include <osl/file.hxx> #include <rtl/cipher.h> #include <rtl/digest.h> #include <rtl/strbuf.hxx> @@ -683,7 +683,7 @@ private: std::map< sal_Int32, sal_Int32 > m_aBuiltinFontToObjectMap; PDFWriter::PDFWriterContext m_aContext; - oslFileHandle m_aFile; + osl::File m_aFile; bool m_bOpen; /* output redirection; e.g. to accumulate content streams for commit 6707c7514db24d05ff76498f76fd48cf07a00fb6 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:50:04 2014 +0100 coverity#1066165 Resource leak no close on error paths Change-Id: Ie544bcd6ea7224bee2a092013a589c509d42c735 diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9613371..bbacab8 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -37,7 +37,7 @@ #include <comphelper/string.hxx> #include <cppuhelper/implbase1.hxx> #include <i18nlangtag/languagetag.hxx> -#include <osl/file.h> +#include <osl/file.hxx> #include <osl/thread.h> #include <rtl/crc.h> #include <rtl/digest.h> @@ -3887,13 +3887,13 @@ bool PDFWriterImpl::emitFonts() if( m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, it->first, aGlyphIds, pEncoding, pWidths, nGlyphs, aSubsetInfo ) ) { // create font stream - oslFileHandle aFontFile; - if ( osl_File_E_None != osl_openFile( aTmpName.pData, &aFontFile, osl_File_OpenFlag_Read ) ) return false; + osl::File aFontFile(aTmpName); + if (osl::File::E_None != aFontFile.open(osl_File_OpenFlag_Read)) return false; // get file size sal_uInt64 nLength1; - if ( osl_File_E_None != osl_setFilePos( aFontFile, osl_Pos_End, 0 ) ) return false; - if ( osl_File_E_None != osl_getFilePos( aFontFile, &nLength1 ) ) return false; - if ( osl_File_E_None != osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) return false; + if ( osl::File::E_None != aFontFile.setPos(osl_Pos_End, 0) ) return false; + if ( osl::File::E_None != aFontFile.getPos(nLength1) ) return false; + if ( osl::File::E_None != aFontFile.setPos(osl_Pos_Absolut, 0) ) return false; #if OSL_DEBUG_LEVEL > 1 emitComment( "PDFWriterImpl::emitFonts" ); @@ -3930,9 +3930,9 @@ bool PDFWriterImpl::emitFonts() { char buf[8192]; sal_uInt64 nRead; - if ( osl_File_E_None != osl_readFile( aFontFile, buf, sizeof( buf ), &nRead ) ) return false; + if ( osl::File::E_None != aFontFile.read(buf, sizeof(buf), nRead) ) return false; if ( !writeBuffer( buf, nRead ) ) return false; - if ( osl_File_E_None != osl_isEndOfFile( aFontFile, &bEOF ) ) return false; + if ( osl::File::E_None != aFontFile.isEndOfFile(&bEOF) ) return false; } while( ! bEOF ); } else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::CFF_FONT) != 0 ) @@ -3945,9 +3945,9 @@ bool PDFWriterImpl::emitFonts() boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] ); sal_uInt64 nBytesRead = 0; - if ( osl_File_E_None != osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) return false; + if ( osl::File::E_None != aFontFile.read(pBuffer.get(), nLength1, nBytesRead) ) return false; DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" ); - if ( osl_File_E_None != osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) return false; + if ( osl::File::E_None != aFontFile.setPos(osl_Pos_Absolut, 0) ) return false; // get the PFB-segment lengths ThreeInts aSegmentLengths = {0,0,0}; getPfbSegmentLengths( pBuffer.get(), (int)nBytesRead, aSegmentLengths ); @@ -3980,7 +3980,7 @@ bool PDFWriterImpl::emitFonts() endCompression(); disableStreamEncryption(); // close the file - osl_closeFile( aFontFile ); + aFontFile.close(); sal_uInt64 nEndPos = 0; if ( osl_File_E_None != osl_getFilePos( m_aFile, &nEndPos ) ) return false; commit d7606a6ab588d9abd9bf8a2f7d8bfc798c449507 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:35:20 2014 +0100 coverity#1242736 Unused value unused since commit 17714047583c7b55c9951846eadffdca98b1680f Date: Wed May 22 06:40:48 2002 +0000 #99282# CTL - Replaced GetGlyphBoundRect by GetTextBoundRect for drop caps Change-Id: Ic2a5fdbb0c2f66268c60f86d6596d66ad24b7712 diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index af6417b..7d1271f 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -796,15 +796,12 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf ) nIdx, pCurrPart->GetLen() ) && ! aRect.IsEmpty(); } - if ( bHaveGlyphRect ) + if (!bHaveGlyphRect) { - FontMetric aWinMet( pWin->GetFontMetric() ); - nAscent = (sal_uInt16) aWinMet.GetAscent(); - } - else - // We do not have a window or our window could not - // give us glyph boundaries. + // We do not have a window or our window could not + // give us glyph boundaries. aRect = Rectangle( Point( 0, 0 ), Size( 0, nAscent ) ); + } } // Now we (hopefully) have a bounding rectangle for the commit 8fa0cda00488b9726976d978dde14ea386508f93 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:28:04 2014 +0100 coverity#705326 deliberate fallthrough in switch I imagine its deliberate anyway, always has been this way since 2000 Change-Id: I45fd654aeec2a5c753c38d20febd2f820044bb32 diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 9f69e72..0b509c7 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -3101,6 +3101,7 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) } m_rSink << "?="; } + //fall-through case CODING_ENCODED_TERMINATED: if (m_rSink.getColumn() + nSize > m_rSink.getLineLengthLimit() - 1) commit b66a96d792e9ef8022547f835ed4633c8e7f4c10 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:40:07 2014 +0100 coverity#1224993 Uncaught exception Change-Id: If5dcb4bbd728f7396e19382f85bdf2a3d77a6db6 diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index 35f2d6b..b34d8c9 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -75,11 +75,9 @@ void SequenceAsHashMap::operator<<(const css::uno::Any& aSource) return; } - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw std::invalid_argument("Any contains wrong type."); } - void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lSource) { sal_Int32 c = lSource.getLength(); @@ -94,8 +92,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lP.Name.isEmpty()) || (!lP.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "PropertyValue struct contains no useful information." ); + throw std::invalid_argument("PropertyValue struct contains no useful information."); (*this)[lP.Name] = lP.Value; continue; } @@ -107,16 +104,14 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lN.Name.isEmpty()) || (!lN.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "NamedValue struct contains no useful information." ); + throw std::invalid_argument("NamedValue struct contains no useful information."); (*this)[lN.Name] = lN.Value; continue; } // ignore VOID Any ... but reject wrong filled ones! if (lSource[i].hasValue()) - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw std::invalid_argument("Any contains wrong type."); } } commit 4c4e2868f885a0a7403f8b48dc6f485e0a5f8ca5 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:09:41 2014 +0100 coverity#982158 Unchecked return value Change-Id: I15acdaaa810b5ee209764a277d0da5a4d7773466 diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index 042bf19..56f8c85 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -2238,7 +2238,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDesc } else { - osl_atomic_decrement( &pRef->pType->nRefCount ); + (void)osl_atomic_decrement( &pRef->pType->nRefCount ); // detruction of this type in progress (another thread!) // no acces through this weak reference pRef->pType = 0; commit 0fe035e366c9eeb72eaca9ca34ab876fc6154d01 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:09:15 2014 +0100 coverity#982157 Unchecked return value Change-Id: Ia6a1ee154254e7efc0d787ce92222e80fecfd04e diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index 7fb987b..042bf19 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -2281,7 +2281,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getByName( { // detruction of this type in progress (another thread!) // no acces through this weak reference - osl_atomic_decrement( &(*aIt).second->nRefCount ); + (void)osl_atomic_decrement( &(*aIt).second->nRefCount ); } } } commit 54d068185e034323479bcacd544bab222642ad8e Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 15:08:32 2014 +0100 coverity#982156 Unchecked return value Change-Id: I16180cae5fcf8dc59614f4ccf33f8745db05e138 diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index 09fa10f..7fb987b 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -1503,7 +1503,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register( else { // destruction of this type in progress (another thread!) - osl_atomic_decrement( &pTDR->pType->nRefCount ); + (void)osl_atomic_decrement( &pTDR->pType->nRefCount ); } } // take new descr commit b4895186c33d2b653600358e5d9424dda76b17e9 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 14:58:05 2014 +0100 coverity#706283 Uncaught exception Change-Id: I2c3f10894ffe514dbc71cd1dd672685aa8f09a0d diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 3ce5b48..b3f3b27 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -298,13 +298,11 @@ namespace comphelper m_aDynamicProperties.getFastPropertyValue( _nHandle, _rValue ); } - - sal_Bool SAL_CALL OPropertyBag::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue ) throw (IllegalArgumentException) + sal_Bool SAL_CALL OPropertyBag::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue ) throw (IllegalArgumentException, UnknownPropertyException) { return m_aDynamicProperties.convertFastPropertyValue( _nHandle, _rValue, _rConvertedValue, _rOldValue ); } - void SAL_CALL OPropertyBag::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception, std::exception) { m_aDynamicProperties.setFastPropertyValue( nHandle, rValue ); diff --git a/comphelper/source/property/opropertybag.hxx b/comphelper/source/property/opropertybag.hxx index 7211748..2e63497 100644 --- a/comphelper/source/property/opropertybag.hxx +++ b/comphelper/source/property/opropertybag.hxx @@ -174,7 +174,7 @@ namespace comphelper // OPropertySetHelper virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const SAL_OVERRIDE; - virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE; + virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (css::lang::IllegalArgumentException, css::beans::UnknownPropertyException) SAL_OVERRIDE; virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception, std::exception) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; diff --git a/include/cppuhelper/propshlp.hxx b/include/cppuhelper/propshlp.hxx index 89a88bd..8bb916c 100644 --- a/include/cppuhelper/propshlp.hxx +++ b/include/cppuhelper/propshlp.hxx @@ -576,6 +576,7 @@ protected: sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (css::lang::IllegalArgumentException, + css::beans::UnknownPropertyException, css::uno::RuntimeException, std::exception) = 0; /** The same as setFastProperyValue; nHandle is always valid. commit 0ac722ccdf75c1d1e8f8cc6c031238a44a5edb0b Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 14:52:48 2014 +0100 coverity#1237352 Dereference after null check Change-Id: Ia9cb84bb0924915d4611c5f18d2a0d19b4198d94 diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index ec5855d..cd27384 100755 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -570,11 +570,7 @@ GL3DBarChart::GL3DBarChart( osl_getSystemTime(&maDataUpdateStartTime); osl_getSystemTime(&maDataUpdateEndTime); } - Size aSize; - if (mpWindow) - { - aSize = mpWindow->GetSizePixel(); - } + Size aSize = mpWindow->GetSizePixel(); mpRenderer->SetSize(aSize); mpWindow->setRenderer(this); mpWindow->getContext().makeCurrent(); @@ -602,7 +598,7 @@ GL3DBarChart::~GL3DBarChart() joinRenderThread(); - if(mbValidContext && mpWindow) + if(mbValidContext) mpWindow->setRenderer(NULL); } commit c53945940369c6480c1f3115fdb3d8f96e974676 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 8 14:45:43 2014 +0100 coverity#706248 Uncaught exception because get_stack_trace uses rtl_mem::allocate and that throws on a (unlikely) memory allocation failure Change-Id: Ic2d0e6ec76eab5cf73025fa4d3199c29eb5b2982 diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx index fb3068f..4fe437a 100644 --- a/bridges/source/jni_uno/jni_java2uno.cxx +++ b/bridges/source/jni_uno/jni_java2uno.cxx @@ -369,7 +369,6 @@ SAL_JNI_EXPORT jobject JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call( JNIEnv * jni_env, jobject jo_proxy, jlong bridge_handle, jstring jo_method, jobjectArray jo_args /* may be 0 */ ) - SAL_THROW_EXTERN_C() { Bridge const * bridge = reinterpret_cast< Bridge const * >( bridge_handle ); JNI_info const * jni_info = bridge->m_jni_info; @@ -617,7 +616,6 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call( SAL_JNI_EXPORT void JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J( JNIEnv * jni_env, jobject jo_proxy, jlong bridge_handle ) - SAL_THROW_EXTERN_C() { Bridge const * bridge = reinterpret_cast< Bridge const * >( bridge_handle ); JNI_info const * jni_info = bridge->m_jni_info;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits