Anonymous avatar Anonymous committed 9fd88fc

#i10000# #i102806# remove assertion

Comments (0)

Files changed (2)

xmlhelp/source/cxxhelp/provider/db.cxx

 #include "com/sun/star/io/XSeekable.hpp"
 
 #ifdef TEST_DBHELP
-#include <osl/time.h>
-#endif
+#include <osl/time.h>
+#endif
 
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
 void DBData::copyToBuffer( const char* pSrcData, int nSize )
 {
 	m_nSize = nSize;
-	delete m_pBuffer;
+	delete [] m_pBuffer;
 	m_pBuffer = new char[m_nSize+1];
 	memcpy( m_pBuffer, pSrcData, m_nSize );
 	m_pBuffer[m_nSize] = 0;
 	int nValueLen = aValueStr.getLength();
 	fprintf( pFile, "%x ", nKeyLen );
 	if( nKeyLen > 0 )
-		fwrite( aKeyStr.getStr(), 1, nKeyLen, pFile );
+		fwrite( aKeyStr.getStr(), 1, nKeyLen, pFile );
 	fprintf( pFile, " %x ", nValueLen );
 	if( nValueLen > 0 )
-		fwrite( aValueStr.getStr(), 1, nValueLen, pFile );
+		fwrite( aValueStr.getStr(), 1, nValueLen, pFile );
 	fprintf( pFile, "%c", cLF );
 }
 
 	const char* pTestReadData = NULL;
 	int nTestReadDataSize = 0;
 
-	sal_uInt32 starttime = osl_getGlobalTimer();
-	sal_uInt32 afterfirsttime = starttime;
-
+	sal_uInt32 starttime = osl_getGlobalTimer();
+	sal_uInt32 afterfirsttime = starttime;
+
 	if( pFile != NULL )
 	{
 		if( bOldDbAccess )
 		}
 		if( bFirst )
 		{
-			afterfirsttime = osl_getGlobalTimer();
+			afterfirsttime = osl_getGlobalTimer();
 			bFirst = false;
 		}
 		int nError = 0;
 		if( bTestSuccess && pTestReadData != NULL )
 		{
-			int nCmp = memcmp( ptr, pTestReadData, nValueLen );
-			if( nCmp == 0 )
-				++nOkCount;
-			else
-				nError = 1;
-
+			int nCmp = memcmp( ptr, pTestReadData, nValueLen );
+			if( nCmp == 0 )
+				++nOkCount;
+			else
+				nError = 1;
+
 			if( nValueLen != nTestReadDataSize )
-				nError = 2;
+				nError = 2;
 		}
 		else
 			nError = 3;
 				fprintf( pFile, "ERROR, not found:\n" );
 				testWriteKeyValue( pFile, rKeyValPair );
 				fprintf( pFile, "\nError Code: %d\n", nError );
-			}
+			}
 		}
 	}
 	tableTest.close( 0 );
 
-	sal_uInt32 endtime = osl_getGlobalTimer();
-	double dDiffTime = (endtime-starttime) / 1000.0;
-	double dDiffFirstTime = (afterfirsttime-starttime) / 1000.0;
+	sal_uInt32 endtime = osl_getGlobalTimer();
+	double dDiffTime = (endtime-starttime) / 1000.0;
+	double dDiffFirstTime = (afterfirsttime-starttime) / 1000.0;
 	if( pFile != NULL )
 	{
 		int nCount = avKeyValPair.size();
 				Reference< XSeekable > xXSeekable( xIn, UNO_QUERY );
 				if( xXSeekable.is() )
 				{
-					xXSeekable->seek( iValuePos );
-
+					xXSeekable->seek( iValuePos );
+
 					Sequence< sal_Int8 > aData;
 					sal_Int32 nRead = xIn->readBytes( aData, nValueLen );
 					if( nRead == nValueLen )

xmlhelp/source/cxxhelp/provider/db.hxx

 			, m_pBuffer( NULL )
 		{}
 		~DBData()
-			{ delete m_pBuffer; }
+			{ delete [] m_pBuffer; }
 
   	    int getSize() const
 			{ return m_nSize; }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.