summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/baside2b.cxx2
-rw-r--r--basic/source/comp/dim.cxx4
-rw-r--r--chart2/source/controller/itemsetwrapper/ItemConverter.cxx2
-rw-r--r--cppu/source/uno/data.cxx2
-rw-r--r--cppu/source/uno/lbenv.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--extensions/source/update/check/download.cxx4
-rw-r--r--filter/source/flash/swfwriter1.cxx2
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx7
-rw-r--r--jvmfwk/source/elements.cxx2
-rw-r--r--registry/source/regkey.cxx4
-rw-r--r--sal/osl/unx/module.cxx4
-rw-r--r--sal/osl/unx/thread.c4
-rw-r--r--sal/rtl/byteseq.cxx3
-rw-r--r--sc/source/core/data/bcaslot.cxx2
-rw-r--r--sc/source/ui/undo/undotab.cxx2
-rw-r--r--sc/source/ui/vba/vbarange.cxx3
-rw-r--r--sd/source/ui/func/fusnapln.cxx2
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sot/source/sdstor/stgavl.cxx3
-rw-r--r--svtools/source/contnr/svlbitm.cxx2
-rw-r--r--svtools/source/contnr/treelist.cxx2
-rw-r--r--svtools/source/svrtf/svparser.cxx3
-rw-r--r--svx/source/form/fmshimp.cxx2
-rw-r--r--svx/source/svdraw/svdopath.cxx2
-rw-r--r--sw/source/core/layout/flowfrm.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx2
-rw-r--r--sw/source/core/undo/undel.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx4
-rw-r--r--sw/source/filter/xml/xmltexte.cxx4
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx18
-rw-r--r--tools/source/stream/stream.cxx4
-rw-r--r--unotools/source/i18n/transliterationwrapper.cxx4
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx3
-rw-r--r--vcl/source/gdi/regband.cxx2
36 files changed, 56 insertions, 62 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 78f65e67968d..e97d1cc0d148 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1955,7 +1955,7 @@ void StackWindow::UpdateCalls()
for ( sal_uInt16 nParam = 1; nParam < pParams->Count(); nParam++ )
{
SbxVariable* pVar = pParams->Get( nParam );
- DBG_ASSERT( pVar, "Parameter?!" );
+ assert(pVar && "Parameter?!");
if ( !pVar->GetName().isEmpty() )
{
aEntry += pVar->GetName();
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index 2d6dfab2ae8e..58db8ffdcaf5 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -1175,7 +1175,7 @@ void SbiParser::SubFunc()
void SbiParser::DefProc( bool bStatic, bool bPrivate )
{
- sal_uInt16 l1 = nLine, l2 = nLine;
+ sal_uInt16 l1 = nLine;
bool bSub = ( eCurTok == SUB );
bool bProperty = ( eCurTok == PROPERTY );
PropertyMode ePropertyMode = PROPERTY_MODE_NONE;
@@ -1279,7 +1279,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
pProc->Define();
OpenBlock( eExit );
StmntBlock( bSub ? ENDSUB : (bProperty ? ENDPROPERTY : ENDFUNC) );
- l2 = nLine;
+ sal_uInt16 l2 = nLine;
pProc->SetLine1( l1 );
pProc->SetLine2( l2 );
pPool = &aPublics;
diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
index e8a31d56d2b3..923d5e65eb0f 100644
--- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
@@ -85,7 +85,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
tPropertyNameWithMemberId aProperty;
SfxItemPool & rPool = GetItemPool();
- OSL_ASSERT( pRanges != NULL );
+ assert(pRanges != NULL);
OSL_ASSERT( m_xPropertySetInfo.is());
OSL_ASSERT( m_xPropertySet.is());
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 3ef7acf9df59..7a7228737a75 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -60,7 +60,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
* typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE );
typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0;
TYPELIB_DANGER_GET( (typelib_TypeDescription **) &pTXInterfaceDescr, type_XInterface );
- OSL_ASSERT( pTXInterfaceDescr->ppAllMembers );
+ assert(pTXInterfaceDescr->ppAllMembers);
typelib_typedescriptionreference_getDescription(
&g_pQITD, pTXInterfaceDescr->ppAllMembers[ 0 ] );
TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) pTXInterfaceDescr );
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index f382c0dc80a0..b2828209d45d 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -864,7 +864,7 @@ extern "C"
static void SAL_CALL unoenv_computeObjectIdentifier(
uno_ExtEnvironment * pEnv, rtl_uString ** ppOId, void * pInterface )
{
- OSL_ENSURE( pEnv && ppOId && pInterface, "### null ptr!" );
+ assert(pEnv && ppOId && pInterface && "### null ptr!");
if (*ppOId)
{
::rtl_uString_release( *ppOId );
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index ca67085ec0b5..a2d1ea4f1999 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2172,7 +2172,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent)
OSL_ENSURE(pFirstParent,"SbaTableQueryBrowser::OnExpandEntry: No rootlevelparent!");
DBTreeListUserData* pData = static_cast< DBTreeListUserData* >(_pParent->GetUserData());
- OSL_ENSURE(pData,"SbaTableQueryBrowser::OnExpandEntry: No user data!");
+ assert(pData && "SbaTableQueryBrowser::OnExpandEntry: No user data!");
#if OSL_DEBUG_LEVEL > 0
SvLBoxString* pString = static_cast<SvLBoxString*>(pFirstParent->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING));
OSL_ENSURE(pString,"SbaTableQueryBrowser::OnExpandEntry: No string item!");
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index ee1ae9f13857..91c6d1d51eec 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1194,7 +1194,7 @@ EditPaM ImpEditEngine::CursorRight( const EditPaM& rPaM, sal_uInt16 nCharacterIt
EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView )
{
- OSL_ENSURE( pView, "No View - No Cursor Movement!" );
+ assert(pView && "No View - No Cursor Movement!");
const ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() );
OSL_ENSURE( pPPortion, "No matching portion found: CursorUp ");
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index 4df311a8b686..4111d1d1a319 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -152,9 +152,9 @@ progress_callback( void *clientp, double dltotal, double dlnow, double ultotal,
OutData *out = reinterpret_cast < OutData * > (clientp);
- OSL_ASSERT( out );
+ assert(out);
- if( ! out->StopCondition.check() )
+ if (out && !out->StopCondition.check())
{
double fPercent = 0;
if ( dltotal + out->Offset )
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index aedd9bfaa80d..a3377ee127f0 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -806,7 +806,7 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali
// Figure out lossless size
sal_uInt8 *pImageData, *pAlphaData;
- sal_uInt32 width, height;
+ sal_uInt32 width(0), height(0);
getBitmapData( bmpSource, pImageData, pAlphaData, width, height );
sal_uInt32 raw_size = width * height * 4;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index ef91401308d1..cffb0b3b1428 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -40,6 +40,7 @@
#include "rtl/ustrbuf.hxx"
#include "osl/module.hxx"
#include "osl/mutex.hxx"
+#include "osl/process.h"
#include "osl/thread.hxx"
#include "osl/file.hxx"
#include "rtl/instance.hxx"
@@ -634,13 +635,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
#if defined UNX && !defined MACOSX
//Setting the JAVA_HOME is needed for awt
- OUString javaHome("JAVA_HOME=");
+ OUString javaHome("JAVA_HOME");
OUString sPathLocation;
osl_getSystemPathFromFileURL(pInfo->sLocation, & sPathLocation.pData);
javaHome += sPathLocation;
- OString osJavaHome = OUStringToOString(
- javaHome, osl_getThreadTextEncoding());
- putenv(strdup(osJavaHome.getStr()));
+ osl_setEnvironment(javaHome.pData, javaHome.pData);
#endif
typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 0adc5931d1d6..55cdfa7213b0 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -1126,7 +1126,7 @@ void MergedSettings::getJRELocations(
rtl_uString *** parLocations, sal_Int32 * size) const
{
osl::MutexGuard guard(FwkMutex::get());
- OSL_ASSERT(parLocations != NULL && size != NULL);
+ assert(parLocations != NULL && size != NULL);
*parLocations = (rtl_uString **)
rtl_allocateMemory(sizeof(rtl_uString*) * m_JRELocations.size());
diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx
index f2c73756f35f..89bf17bda2d3 100644
--- a/registry/source/regkey.cxx
+++ b/registry/source/regkey.cxx
@@ -529,15 +529,13 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey,
return pKey->getStringListValue(valueName, pValueList, pLen);
}
-
// getUnicodeListValue
-
RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Unicode*** pValueList,
sal_uInt32* pLen)
{
- OSL_PRECOND((pValueList != 0) && (pLen != 0), "registry::getUnicodeListValue(): invalid parameter");
+ assert((pValueList != 0) && (pLen != 0) && "registry::getUnicodeListValue(): invalid parameter");
*pValueList = 0, *pLen = 0;
ORegKey* pKey = static_cast< ORegKey* >(hKey);
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx
index 1ebdfaced8c8..30fe2abb7603 100644
--- a/sal/osl/unx/module.cxx
+++ b/sal/osl/unx/module.cxx
@@ -25,7 +25,7 @@
#include <osl/thread.h>
#include <osl/process.h>
#include <osl/file.h>
-
+#include <assert.h>
#include "system.h"
#ifdef AIX
@@ -169,7 +169,7 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR
oslModule osl_loadModuleRelativeAscii(
oslGenericFunction baseModule, char const * relativePath, sal_Int32 mode)
{
- SAL_WARN_IF(relativePath == 0, "sal.osl", "illegal argument");
+ assert(relativePath && "illegal argument");
if (relativePath[0] == '/') {
return osl_loadModuleAscii(relativePath, mode);
} else {
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 5335dd6bf3b8..17b4d6cf7946 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
+#include <assert.h>
#include "system.h"
#include <string.h>
#if defined(OPENBSD)
@@ -202,7 +202,7 @@ static void* osl_thread_start_Impl (void* pData)
int terminate;
Thread_Impl* pImpl= (Thread_Impl*)pData;
- OSL_ASSERT(pImpl);
+ assert(pImpl);
pthread_mutex_lock (&(pImpl->m_Lock));
diff --git a/sal/rtl/byteseq.cxx b/sal/rtl/byteseq.cxx
index fe241797475f..5fd6022cfa75 100644
--- a/sal/rtl/byteseq.cxx
+++ b/sal/rtl/byteseq.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <assert.h>
#include <string.h>
#include <osl/diagnose.h>
@@ -78,7 +79,7 @@ void SAL_CALL rtl_byte_sequence_realloc(
sal_Sequence * pSequence, * pNew;
sal_Int32 nElements;
- OSL_ENSURE( ppSequence, "### null ptr!" );
+ assert(ppSequence && "### null ptr!");
pSequence = *ppSequence;
nElements = pSequence->nElements;
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 6d6eee24bde9..701e53050700 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -226,7 +226,7 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange,
}
else
{
- if ( !rpArea->GetBroadcaster().HasListeners() )
+ if (rpArea && !rpArea->GetBroadcaster().HasListeners())
{
ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange));
if (aIter == aBroadcastAreaTbl.end() || isMarkedErased( aIter))
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index b5091d5954f0..713305cac85c 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1485,7 +1485,7 @@ SdrObject* ScUndoRenameObject::GetObject()
for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
{
SdrPage* pPage = pDrawLayer->GetPage(nTab);
- OSL_ENSURE(pPage,"Page ?");
+ assert(pPage && "Page ?");
SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
SdrObject* pObject = aIter.Next();
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index a14bb3129903..ef0839abed89 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -3155,7 +3155,6 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem();
SvxSearchItem newOptions( globalSearchOptions );
- sal_Int16 nLookAt = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole;
sal_Int16 nSearchOrder = globalSearchOptions.GetRowDirection() ? excel::XlSearchOrder::xlByRows : excel::XlSearchOrder::xlByColumns;
uno::Reference< util::XSearchable > xSearch( mxRange, uno::UNO_QUERY );
@@ -3207,7 +3206,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
// LookAt
if ( LookAt.hasValue() )
{
- nLookAt = ::comphelper::getINT16( LookAt );
+ sal_Int16 nLookAt = ::comphelper::getINT16( LookAt );
bool bSearchWords = false;
if ( nLookAt == excel::XlLookAt::xlPart )
bSearchWords = false;
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 7a0570342e2b..3fc967dd69d0 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -101,7 +101,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
}
else
{
- OSL_ASSERT(pPV!=NULL);
+ assert(pPV!=NULL);
aLinePos = (pPV->GetHelpLines())[nHelpLine].GetPos();
pPV->LogicToPagePos(aLinePos);
bLineExist = true;
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 26c6b5fe539d..283c2119cedb 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -416,7 +416,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
// Here only the fixed properties identified "other adjustable, the
// retrieved by GetViewData (saves time).
- DBG_ASSERT( pDoc, "NULL-Document inserted ?!" );
+ assert(pDoc && "NULL-Document inserted ?!");
GetParentFrame();
const SfxMedium *pMed = pDoc->GetMedium();
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index 722fb2549118..3cb48c2a1da9 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -19,6 +19,7 @@
#include <osl/diagnose.h>
#include "stgavl.hxx"
+#include <assert.h>
StgAvlNode::StgAvlNode()
{
@@ -142,7 +143,7 @@ StgAvlNode* StgAvlNode::RotLL()
StgAvlNode* StgAvlNode::RotLR()
{
- OSL_ENSURE( pLeft && pLeft->pRight, "The pointer is not allowed to be NULL!" );
+ assert(pLeft && pLeft->pRight && "The pointer is not allowed to be NULL!");
StgAvlNode* pHeavy = pLeft;
StgAvlNode* pNewRoot = pHeavy->pRight;
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 62a34a90328d..b11ec76af6f3 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -137,7 +137,7 @@ SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) co
SvTreeListEntry* SvLBoxButtonData::GetActEntry() const
{
- DBG_ASSERT( pImpl, "-SvLBoxButtonData::GetActEntry(): don't use me that way!" );
+ assert(pImpl && "-SvLBoxButtonData::GetActEntry(): don't use me that way!");
return pImpl->pEntry;
}
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index f60b1c9247e2..362f93b4f42a 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -1051,7 +1051,7 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
void SvTreeList::SelectAll( SvListView* pView, bool bSelect )
{
- DBG_ASSERT(pView,"SelectAll:NoView");
+ assert(pView && "SelectAll:NoView");
SvTreeListEntry* pEntry = First();
while ( pEntry )
{
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 114e37772a72..51783a654f26 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -241,8 +241,7 @@ sal_Unicode SvParser::GetNextChar()
}
else
{
- DBG_ASSERT( pImplData && pImplData->hConv,
- "no text converter!" );
+ assert(pImplData && pImplData->hConv && "no text converter!");
sal_Unicode cUC;
sal_uInt32 nInfo = 0;
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 967628e42b6f..ba76540339e8 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2386,7 +2386,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
// current Page/Controller
FmFormPage* pCurrentPage = m_pShell->GetCurPage();
- DBG_ASSERT(pCurrentPage!=NULL, "FmXFormShell::OnSearchContextRequest : no page !");
+ assert(pCurrentPage && "FmXFormShell::OnSearchContextRequest : no page !");
// Search all SdrControls of this page...
OUString sControlSource, aName;
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 8c96c9fcb56d..9a2e18fc1e2a 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -795,7 +795,7 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
// now check symmetric plus handles
if (bControl) { // cases 5,6,7,8
- sal_uInt16 nSt=nPnt; // the associated support point
+ sal_uInt16 nSt; // the associated support point
sal_uInt16 nFix=nPnt; // the opposing control point
if (bIsNextControl) { // if the next one is a control point, the on before has to be a support point
nSt=nPrevPnt;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 233f0e6dc3c8..a13ddbcaf84e 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -230,7 +230,7 @@ bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
if ( ! pSet )
pSet = pNxt->GetAttrSet();
- OSL_ENSURE( pSet, "No AttrSet to check keep attribute" );
+ assert(pSet && "No AttrSet to check keep attribute");
if ( pSet->GetPageDesc().GetPageDesc() )
bKeep = false;
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 3c8f77bc3ba0..dd5066a0af7e 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -601,7 +601,7 @@ SwScriptInfo::~SwScriptInfo()
// Sw Script Types (SW_LATIN, SW_CJK, SW_CTL), used to identify the font
sal_uInt8 SwScriptInfo::WhichFont( sal_Int32 nIdx, const OUString* pTxt, const SwScriptInfo* pSI )
{
- SAL_WARN_IF( !pTxt && !pSI, "sw.core", "How should I determine the script type?" );
+ assert((pSI || pTxt) && "How should I determine the script type?");
sal_uInt16 nScript;
// First we try to use our SwScriptInfo
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index cb3180292e10..470dbf468e6a 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -359,8 +359,6 @@ bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
if( pSttTxtNd )
{
bool bOneNode = nSttNode == nEndNode;
- sal_Int32 nLen = bOneNode ? nEndCntnt - nSttCntnt
- : pSttTxtNd->GetTxt().getLength() - nSttCntnt;
SwRegHistory aRHst( *pSttTxtNd, pHistory );
// always save all text atttibutes because of possibly overlapping
// areas of on/off
@@ -370,7 +368,7 @@ bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
pHistory->CopyFmtAttr( *pSttTxtNd->GetpSwAttrSet(), nNdIdx );
// the length might have changed (!!Fields!!)
- nLen = ((bOneNode)
+ sal_Int32 nLen = ((bOneNode)
? pEnd->nContent.GetIndex()
: pSttTxtNd->GetTxt().getLength())
- pStt->nContent.GetIndex();
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index c2d7ff4b3d5d..a8bd5feabfb8 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1845,7 +1845,7 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rPLCF.advance();
- if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // No beginning?
+ if (!pData || (((sal_uInt8*)pData)[0] & 0x1f) != 0x13) // No beginning?
goto Err;
rF.nId = ((sal_uInt8*)pData)[1];
@@ -1932,7 +1932,7 @@ sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr,
WW8_CP nNextPieceCp = nBehindTextCp; // Initialization, important for Ver6
do
{
- bool bIsUnicode, bPosOk;
+ bool bIsUnicode(false), bPosOk(false);
WW8_FC fcAct = WW8Cp2Fc(nAktStartCp,&bIsUnicode,&nNextPieceCp,&bPosOk);
// Probably aimed beyond file end, doesn't matter!
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index d2e26177a6ac..09cb3f01f93b 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -68,10 +68,10 @@ SwNoTxtNode *SwXMLTextParagraphExport::GetNoTxtNode(
const Reference < XPropertySet >& rPropSet ) const
{
Reference<XUnoTunnel> xCrsrTunnel( rPropSet, UNO_QUERY );
- OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for embedded" );
+ assert(xCrsrTunnel.is() && "missing XUnoTunnel for embedded");
SwXFrame *pFrame = reinterpret_cast< SwXFrame * >(
sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( SwXFrame::getUnoTunnelId() )));
- OSL_ENSURE( pFrame, "SwXFrame missing" );
+ assert(pFrame && "SwXFrame missing");
SwFrmFmt *pFrmFmt = pFrame->GetFrmFmt();
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx();
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index ed6744193ee8..bb6bfc3cf58d 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -322,10 +322,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ assert(pFact && "SwAbstractDialogFactory fail!");
boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR_DRAW));
- OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ assert(pDlg && "Dialogdiet fail!");
if (nSlot == SID_CHAR_DLG_EFFECT)
{
pDlg->SetCurPageId("fonteffects");
@@ -346,10 +346,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ assert(pFact && "SwAbstractDialogFactory fail!");
boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetView().GetWindow(), rView.GetWrtShell()));
- OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ assert(pDlg && "Dialogdiet fail!");
pDlg->Execute();
break;
}
@@ -357,10 +357,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "Dialogdiet fail!");
+ assert(pFact && "Dialogdiet fail!");
boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, GetView().GetWrtShell()));
- OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ assert(pDlg && "Dialogdiet fail!");
pDlg->Execute();
pDlg.reset();
rReq.Done();
@@ -419,10 +419,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ assert(pFact && "SwAbstractDialogFactory fail!");
boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, 0, true ));
- OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ assert(pDlg && "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet)
{
@@ -580,7 +580,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
break;
default:
- OSL_ENSURE(!this, "wrong dispatcher");
+ assert(!this && "wrong dispatcher");
return;
}
if(nEEWhich && pNewAttrs)
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index b787e4f0ec3b..ecd02cc7c763 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -295,7 +295,7 @@ ErrCode SvAsyncLockBytes::WriteAt(sal_uInt64 const nPos, const void * pBuffer,
ErrCode SvAsyncLockBytes::FillAppend(const void * pBuffer, sal_Size nCount,
sal_Size * pWritten)
{
- sal_Size nTheWritten;
+ sal_Size nTheWritten(0);
ErrCode nError = SvOpenLockBytes::WriteAt(m_nSize, pBuffer, nCount,
&nTheWritten);
if (!nError)
@@ -1822,7 +1822,7 @@ sal_Size SvMemoryStream::PutData( const void* pData, sal_Size nCount )
}
}
}
- DBG_ASSERT(pBuf,"Possibly Reallocate failed");
+ assert(pBuf && "Possibly Reallocate failed");
memcpy( pBuf+nPos, pData, (size_t)nCount);
nPos += nCount;
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index ecaaf0c8196b..40eb5721bb71 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -214,7 +214,7 @@ sal_Int32 TransliterationWrapper::compareString( const OUString& rStr1, const OU
bool TransliterationWrapper::isEqual( const OUString& rStr1, const OUString& rStr2 ) const
{
- sal_Int32 nMatch1, nMatch2;
+ sal_Int32 nMatch1(0), nMatch2(0);
bool bMatch = equals(
rStr1, 0, rStr1.getLength(), nMatch1,
rStr2, 0, rStr2.getLength(), nMatch2 );
@@ -223,7 +223,7 @@ bool TransliterationWrapper::isEqual( const OUString& rStr1, const OUString& rSt
bool TransliterationWrapper::isMatch( const OUString& rStr1, const OUString& rStr2 ) const
{
- sal_Int32 nMatch1, nMatch2;
+ sal_Int32 nMatch1(0), nMatch2(0);
equals(
rStr1, 0, rStr1.getLength(), nMatch1,
rStr2, 0, rStr2.getLength(), nMatch2 );
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index cbdbae5116dc..b7333f6fb222 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -105,8 +105,7 @@ bool isInternalContext(librdf_node *i_pNode) throw ()
OSL_ENSURE(pURI, "isInternalContext: URI null");
if (pURI) {
unsigned char *pContextURI(librdf_uri_as_string(pURI));
- OSL_ENSURE(pContextURI,
- "isInternalContext: URI string null");
+ assert(pContextURI && "isInternalContext: URI string null");
// if prefix matches reserved uri, it is RDFa context
if (!strncmp(reinterpret_cast<char *>(pContextURI),
s_nsOOo, sizeof(s_nsOOo)-1)) {
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index 2cbcb57c1f29..87261cfc312c 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -818,7 +818,7 @@ bool ImplRegionBand::IsInside( long nX )
long ImplRegionBand::GetXLeftBoundary() const
{
- DBG_ASSERT( mpFirstSep != NULL, "ImplRegionBand::XLeftBoundary -> no separation in band!" );
+ assert(mpFirstSep && "ImplRegionBand::XLeftBoundary -> no separation in band!");
return mpFirstSep->mnXLeft;
}