diff options
Diffstat (limited to 'dbaccess/source/core/recovery/dbdocrecovery.cxx')
-rw-r--r-- | dbaccess/source/core/recovery/dbdocrecovery.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index 6f31f17682fd..42040e4b7ae2 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -48,6 +49,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <rtl/ustrbuf.hxx> #include <tools/diagnose_ex.h> +#include <sal/macros.h> #include <algorithm> @@ -108,7 +110,7 @@ namespace dbaccess const sal_Int32 nEqualSignPos = i_rIniLine.indexOf( sal_Unicode( '=' ) ); if ( nEqualSignPos < 1 ) { - OSL_ENSURE( false, "lcl_extractCompDesc: invalid map file entry - unexpected pos of '='" ); + OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of '='" ); return false; } o_rStorName = i_rIniLine.copy( 0, nEqualSignPos ); @@ -116,7 +118,7 @@ namespace dbaccess const sal_Int32 nCommaPos = i_rIniLine.lastIndexOf( sal_Unicode( ',' ) ); if ( nCommaPos != i_rIniLine.getLength() - 2 ) { - OSL_ENSURE( false, "lcl_extractCompDesc: invalid map file entry - unexpected pos of ','" ); + OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of ','" ); return false; } o_rCompDesc.sName = i_rIniLine.copy( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 ); @@ -197,7 +199,7 @@ namespace dbaccess ENSURE_OR_THROW( i_rStorage.is(), "invalid storage" ); if ( !i_rStorage->hasByName( lcl_getObjectMapStreamName() ) ) { // nothing to do, though suspicious - OSL_ENSURE( false, "lcl_readObjectMap_throw: if there's no map file, then there's expected to be no storage, too!" ); + OSL_FAIL( "lcl_readObjectMap_throw: if there's no map file, then there's expected to be no storage, too!" ); return; } @@ -230,7 +232,7 @@ namespace dbaccess continue; // the only section we support so far is "storages" - if ( !sCurrentSection.equalsAscii( "storages" ) ) + if ( !sCurrentSection.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "storages" ) ) ) { bCurrentSectionIsKnownToBeUnsupported = true; continue; @@ -250,7 +252,7 @@ namespace dbaccess const Reference< XModifiable > xModify( i_rSubComponent, UNO_QUERY ); if ( !xModify.is() ) { - OSL_ENSURE( false, "lcl_markModified: unhandled case!" ); + OSL_FAIL( "lcl_markModified: unhandled case!" ); return; } @@ -357,7 +359,7 @@ namespace dbaccess // read the map from sub storages to object names MapCompTypeToCompDescs aMapCompDescs; SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN }; - for ( size_t i = 0; i < sizeof( aKnownTypes ) / sizeof( aKnownTypes[0] ); ++i ) + for ( size_t i = 0; i < SAL_N_ELEMENTS( aKnownTypes ); ++i ) { if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ) ) ) continue; @@ -396,7 +398,7 @@ namespace dbaccess message.append( "' not found in '" ); message.append( ::rtl::OUStringToOString( SubComponentRecovery::getComponentsStorageName( eComponentType ), RTL_TEXTENCODING_ASCII_US ) ); message.append( "', but required per map file!" ); - OSL_ENSURE( false, message.makeStringAndClear() ); + OSL_FAIL( message.makeStringAndClear() ); #endif continue; } @@ -434,3 +436,5 @@ namespace dbaccess //........................................................................ } // namespace dbaccess //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |