Make content of OSL_ASSERT, DBG_ASSERT, etc. visiblie in non-debug builds

...to avoid lots of loplugin:staticmethods warnings.  Also enables DBG_ASSERT
etc. also for --enable-debug builds in addition to --enable-dbgutil builds.

Change-Id: Ib89ecd9ab8ce7abb2c64790ace248b31f9d2b64d
This commit is contained in:
Stephan Bergmann 2015-07-09 08:50:37 +02:00
parent 429280541f
commit cbce40e965
86 changed files with 119 additions and 423 deletions

View File

@ -869,7 +869,6 @@ IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, b
}
// debug methods
#ifdef DBG_UTIL
// addText, updateText
bool ProgressMonitor::impl_debug_checkParameter (
@ -898,8 +897,6 @@ bool ProgressMonitor::impl_debug_checkParameter ( const OUString& rTopic, bool /
return true;
}
#endif // #ifdef DBG_UTIL
} // namespace unocontrols
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -401,13 +401,9 @@ private:
/**_______________________________________________________________________________________________________
*/
#ifdef DBG_UTIL
static bool impl_debug_checkParameter( const OUString& sTopic, const OUString& sText, bool bbeforeProgress ); // addText, updateText
static bool impl_debug_checkParameter( const OUString& rTopic, bool bbeforeProgress ); // removeText
#endif
// private variables
private:

View File

@ -540,9 +540,6 @@ namespace basic
SolarMutexGuard g;
Reference< XInterface > xNormalizedSource( _rSource.Source, UNO_QUERY );
#if OSL_DEBUG_LEVEL > 0
bool bFound = false;
#endif
for ( BasicManagerStore::iterator loop = m_aStore.begin();
loop != m_aStore.end();
@ -552,14 +549,11 @@ namespace basic
if ( loop->first.get() == xNormalizedSource.get() )
{
impl_removeFromRepository( loop );
#if OSL_DEBUG_LEVEL > 0
bFound = true;
#endif
break;
return;
}
}
OSL_ENSURE( bFound, "ImplRepository::_disposing: where does this come from?" );
OSL_FAIL( "ImplRepository::_disposing: where does this come from?" );
}

View File

@ -184,9 +184,7 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< scrip
if( !pMgr->GetLib( aLibName ) )
{
BasicManager* pBasMgr = static_cast< BasicManager* >( pMgr );
#ifdef DBG_UTIL
StarBASIC* pLib =
#endif
pBasMgr->CreateLibForLibContainer( aLibName, xScriptCont );
DBG_ASSERT( pLib, "XML Import: Basic library could not be created");
}
@ -308,10 +306,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const container::Con
Event.Accessor >>= aName;
// Replace not possible for library container
#ifdef DBG_UTIL
bool bLibContainer = maLibName.isEmpty();
#endif
DBG_ASSERT( !bLibContainer, "library container fired elementReplaced()");
DBG_ASSERT( !maLibName.isEmpty(), "library container fired elementReplaced()");
StarBASIC* pLib = mpMgr->GetLib( maLibName );
if( pLib )
@ -2287,10 +2282,7 @@ void SAL_CALL StarBasicAccess_Impl::createLibrary
throw(container::ElementExistException, uno::RuntimeException, std::exception)
{
(void)ExternalSourceURL;
#ifdef DBG_UTIL
StarBASIC* pLib =
#endif
mpMgr->CreateLib( LibName, Password, LinkTargetURL );
StarBASIC* pLib = mpMgr->CreateLib( LibName, Password, LinkTargetURL );
DBG_ASSERT( pLib, "XML Import: Basic library could not be created");
}

View File

@ -54,8 +54,10 @@ Cli_environment::~Cli_environment() ///< IDisposable Cli_environment::Dispose()
Cli_environment::!Cli_environment() ///< Cli_environment::Finalize()
{
#if OSL_DEBUG_LEVEL >= 2
OSL_ENSURE(_numRegisteredObjects == 0,
"cli uno bridge: CLI environment contains unrevoked objects");
#endif
}
System::Object^ Cli_environment::registerInterface(

View File

@ -212,10 +212,7 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W
{
// obtain the preference list
Any aPreferences = xDriverManagerNode->getByName(sDriverPreferenceLocation);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
aPreferences >>= _rPrecedence;
bool bSuccess = aPreferences >>= _rPrecedence;
OSL_ENSURE(bSuccess || !aPreferences.hasValue(), "lcl_getDriverPrecedence: invalid value for the preferences node (no string sequence but not NULL)!");
}
}

View File

@ -408,9 +408,7 @@ static void SAL_CALL s_stub_defenv_revokeInterface(va_list * pParam)
{
// proxy ptr not registered for another interface:
// remove from ptr map
#if OSL_DEBUG_LEVEL > 0
::std::size_t erased =
#endif
that->aPtr2ObjectMap.erase( pInterface );
OSL_ASSERT( erased == 1 );
}

View File

@ -528,10 +528,7 @@ void FmSearchDialog::InitContext(sal_Int16 nContext)
FmSearchContext fmscContext;
fmscContext.nContext = nContext;
#ifdef DBG_UTIL
sal_uInt32 nResult =
#endif
m_lnkContextSupplier.Call(&fmscContext);
sal_uInt32 nResult = m_lnkContextSupplier.Call(&fmscContext);
DBG_ASSERT(nResult > 0, "FmSearchDialog::InitContext : ContextSupplier didn't give me any controls !");
// put the field names into the respective listbox

View File

@ -2904,9 +2904,7 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl)
IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField )
{
#ifdef DBG_UTIL
bool bHigh = m_pHighPosBtn->IsChecked();
#endif
bool bLow = m_pLowPosBtn->IsChecked();
DBG_ASSERT( bHigh || bLow, "normal position is not valid" );

View File

@ -242,9 +242,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
ORowSetValueVector* pTemp = k->get();
OSL_ENSURE( pTemp != reinterpret_cast<void*>(0xfeeefeee),"HALT!" );
}
#endif
OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!");
#if OSL_DEBUG_LEVEL > 0
ORowSetRow rRow = (*m_aCurrentRow);
OSL_ENSURE(rRow.is() && static_cast<sal_uInt16>(columnIndex) < (rRow->get()).size(),"Invalid size of vector!");
#endif

View File

@ -72,7 +72,9 @@ ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< :
ODsnTypeCollection::~ODsnTypeCollection()
{
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still living iterator objects!");
#endif
}
OUString ODsnTypeCollection::getTypeDisplayName(const OUString& _sURL) const

View File

@ -81,12 +81,11 @@ namespace dbmm
namespace
{
#if OSL_DEBUG_LEVEL > 0
bool lcl_isRunning( const ProgressMixer_Data& _rData )
{
return _rData.pCurrentPhase != _rData.aPhases.end();
}
#endif
void lcl_ensureInitialized( ProgressMixer_Data& _rData )
{
OSL_PRECOND( _rData.nWeightSum, "lcl_ensureInitialized: we have no phases, this will crash!" );

View File

@ -1006,10 +1006,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv
{
// if it's the slot for the document data source, remember the state
Sequence< PropertyValue > aDescriptor;
#if OSL_DEBUG_LEVEL > 0
bool bProperFormat =
#endif
_rEvent.State >>= aDescriptor;
bool bProperFormat = _rEvent.State >>= aDescriptor;
OSL_ENSURE(bProperFormat, "SbaTableQueryBrowser::statusChanged: need a data access descriptor here!");
m_aDocumentDataSource.initializeFrom(aDescriptor);
@ -1879,9 +1876,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
OUString sNewQueryCommand;
bool bNewQueryEP;
#if OSL_DEBUG_LEVEL > 0
bool bIsQuery =
#endif
implGetQuerySignature( sNewQueryCommand, bNewQueryEP );
OSL_ENSURE( bIsQuery, "SbaTableQueryBrowser::Execute: was a query before, but is not anymore?" );
@ -3318,14 +3313,11 @@ bool SbaTableQueryBrowser::getExistentConnectionFor( SvTreeListEntry* _pAnyEntry
return _rConnection.is();
}
#if OSL_DEBUG_LEVEL > 0
bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvTreeListEntry* _pEntry ) const
{
return m_pTreeModel->GetRootLevelParent( _pEntry ) == _pEntry;
}
#endif
bool SbaTableQueryBrowser::ensureConnection( SvTreeListEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection )
{
OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" );

View File

@ -883,7 +883,6 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< X
lcl_putProperty(_rxSet, _rName,aValue);
}
#if OSL_DEBUG_LEVEL > 0
OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId )
{
OUString aString;
@ -904,8 +903,6 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId )
return aReturn;
}
#endif
void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet, sal_Int32 _nId, const Any& _rValue )
{
switch ( _rValue.getValueType().getTypeClass() )

View File

@ -167,9 +167,7 @@ namespace dbaui
*/
static bool hasAuthentication(const SfxItemSet& _rSet);
#if OSL_DEBUG_LEVEL > 0
OString translatePropertyId( sal_Int32 _nId );
#endif
};
} // namespace dbaui

View File

@ -434,10 +434,8 @@ namespace dbaui
void* _pTreeListUserData // in reality a DBTreeListUserData*, but we do not know this class here...
);
#if OSL_DEBUG_LEVEL > 0
// checks whether the given tree entry denotes a data source
bool impl_isDataSourceEntry( SvTreeListEntry* _pEntry ) const;
#endif
/// retrieves the data source URL/name for the given entry representing a data source
OUString getDataSourceAcessor( SvTreeListEntry* _pDataSourceEntry ) const;

View File

@ -1013,7 +1013,9 @@ void OHTMLImportExport::FontOn()
inline void OHTMLImportExport::FontOff()
{
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(m_bCheckFont,"Kein FontOn() gerufen");
#endif
TAG_OFF( OOO_STRING_SVTOOLS_HTML_font );
#if OSL_DEBUG_LEVEL > 0
m_bCheckFont = false;

View File

@ -82,14 +82,12 @@ void OFieldDescGenWin::DisplayData( OFieldDescription* pFieldDescr )
m_pFieldControl->DisplayData(pFieldDescr);
}
#if OSL_DEBUG_LEVEL > 0
OTableEditorCtrl* OFieldDescGenWin::GetEditorCtrl()
{
OTableDesignView* pDesignWin = static_cast<OTableDesignView*>(GetParent()->GetParent()->GetParent());
return pDesignWin->GetEditorCtrl();
}
#endif
void OFieldDescGenWin::SaveData( OFieldDescription* pFieldDescr )
{
m_pFieldControl->SaveData(pFieldDescr);

View File

@ -50,9 +50,8 @@ namespace dbaui
void SetControlText( sal_uInt16 nControlId, const OUString& rText );
OUString GetControlText( sal_uInt16 nControlId );
void SetReadOnly( bool bReadOnly );
#if OSL_DEBUG_LEVEL > 0
OTableEditorCtrl* GetEditorCtrl();
#endif
// short GetFormatCategory(OFieldDescription* pFieldDescr);
// gives you one of the CAT_xxx-values (CAT_NUMBER, CAT_DATE ...) belonging to the format specified by the field

View File

@ -709,10 +709,7 @@ void CMtaOleClipboard::createMtaOleReqWnd( )
unsigned int CMtaOleClipboard::run( )
{
#if OSL_DEBUG_LEVEL > 0
HRESULT hr =
#endif
OleInitialize( NULL );
HRESULT hr = OleInitialize( NULL );
OSL_ASSERT( SUCCEEDED( hr ) );
createMtaOleReqWnd( );

View File

@ -77,9 +77,7 @@ CAPNDataObject::CAPNDataObject( IDataObjectPtr rIDataObject ) :
{
OSL_FAIL("marshalling failed");
#if OSL_DEBUG_LEVEL > 0
HGLOBAL hGlobal =
#endif
GlobalFree(m_hGlobal);
OSL_ENSURE(NULL == hGlobal, "GlobalFree failed");
m_hGlobal = NULL;

View File

@ -396,8 +396,10 @@ void TextConvWrapper::ReplaceUnit(
if (pNewUnitLanguage)
{
#ifdef DBG_UTIL
DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
"similar language should not be changed!");
#endif
SetLanguageAndFont( aNewSel, *pNewUnitLanguage, EE_CHAR_LANGUAGE_CJK,
GetTargetFont(), EE_CHAR_FONTINFO_CJK );
}

View File

@ -679,10 +679,7 @@ namespace editeng
}
else
{
#ifdef DBG_UTIL
const bool bCompletelyDone =
#endif
ContinueConversion( false );
const bool bCompletelyDone = ContinueConversion( false );
DBG_ASSERT( bCompletelyDone, "HangulHanjaConversion_Impl::DoDocumentConversion: ContinueConversion should have returned true here!" );
}
}

View File

@ -91,9 +91,7 @@ namespace abp
Reference< XPropertySet > xDialogProps( xDialog, UNO_QUERY );
Sequence< AliasProgrammaticPair > aMapping;
#ifdef DBG_UTIL
bool bSuccess =
#endif
xDialogProps->getPropertyValue("FieldMapping") >>= aMapping;
DBG_ASSERT( bSuccess, "fieldmapping::invokeDialog: invalid property type for FieldMapping!" );
@ -235,10 +233,10 @@ namespace abp
#ifdef DBG_UTIL
OUString sRedundantProgrammaticName;
aFields.openNode( *pExistentFields ).getNodeValue( sProgrammaticNodeName ) >>= sRedundantProgrammaticName;
#endif
DBG_ASSERT( sRedundantProgrammaticName == *pExistentFields,
"fieldmapping::writeTemplateAddressFieldMapping: inconsistent config data!" );
// there should be a redundancy in the config data .... if this asserts, there isn't anymore!
#endif
// do we have a new alias for the programmatic?
MapString2String::iterator aPos = aFieldAssignment.find( *pExistentFields );

View File

@ -209,9 +209,7 @@ namespace logging
sal_uInt64 nBytesToWrite( _rEntry.getLength() );
sal_uInt64 nBytesWritten( 0 );
#if OSL_DEBUG_LEVEL > 0
::osl::FileBase::RC res =
#endif
m_pFile->write( _rEntry.getStr(), nBytesToWrite, nBytesWritten );
OSL_ENSURE( ( res == ::osl::FileBase::E_None ) && ( nBytesWritten == nBytesToWrite ),
"FileHandler::impl_writeString_nothrow: could not write the log entry!" );
@ -310,10 +308,7 @@ namespace logging
OSL_PRECOND(false, "FileHandler::flush: no file!");
return;
}
#if OSL_DEBUG_LEVEL > 0
::osl::FileBase::RC res =
#endif
m_pFile->sync();
::osl::FileBase::RC res = m_pFile->sync();
OSL_ENSURE(res == ::osl::FileBase::E_None, "FileHandler::flush: Could not sync logfile to filesystem.");
}

View File

@ -407,10 +407,7 @@ namespace pcr
case PROPERTY_ID_BOUND_CELL:
{
Reference< XValueBinding > xBinding;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
_rPropertyValue >>= xBinding;
bool bSuccess = _rPropertyValue >>= xBinding;
OSL_ENSURE( bSuccess, "CellBindingPropertyHandler::convertToControlValue: invalid value (1)!" );
// the only value binding we support so far is linking to spreadsheet cells
@ -421,10 +418,7 @@ namespace pcr
case PROPERTY_ID_LIST_CELL_RANGE:
{
Reference< XListEntrySource > xSource;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
_rPropertyValue >>= xSource;
bool bSuccess = _rPropertyValue >>= xSource;
OSL_ENSURE( bSuccess, "CellBindingPropertyHandler::convertToControlValue: invalid value (2)!" );
// the only value binding we support so far is linking to spreadsheet cells

View File

@ -1253,7 +1253,9 @@ void FilterCache::impl_validateAndOptimize()
"filter configuration: " + sLogOut,
css::uno::Reference< css::uno::XInterface >(),
sLogOut);
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(!nWarnings, OUStringToOString(sLogOut,RTL_TEXTENCODING_UTF8).getStr());
#endif
// <- SAFE
}

View File

@ -168,11 +168,7 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star::be
return false;
}
}
#if OSL_DEBUG_LEVEL > 0
catch( const Exception& e )
#else
catch( const Exception& )
#endif
{
if (xStatusIndicator.is())
xStatusIndicator->end();
@ -290,11 +286,7 @@ bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< ::com::sun::star::be
return false;
}
}
#if OSL_DEBUG_LEVEL > 0
catch( const Exception& exE )
#else
catch( const Exception& )
#endif
{
OSL_FAIL( OUStringToOString( exE.Message, RTL_TEXTENCODING_ASCII_US).getStr());
if (xStatusIndicator.is())

View File

@ -402,11 +402,7 @@ namespace XSLT
m_tcontrol->terminate();
return !m_bError;
}
#if OSL_DEBUG_LEVEL > 0
catch( const Exception& exc)
#else
catch (const Exception&)
#endif
{
// something went wrong
OSL_FAIL(OUStringToOString(exc.Message, RTL_TEXTENCODING_ASCII_US).getStr());

View File

@ -97,9 +97,9 @@ sal_Int32 getColumnTypeByModelName(const OUString& aModelName)
sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
#ifdef DBG_UTIL
sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
#endif
DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1),
"::getColumnTypeByModelName() : wrong servivce !");
#endif
OUString aColumnType = (nPrefixPos != -1)
? aModelName.copy(aModelPrefix.getLength())

View File

@ -878,7 +878,9 @@ namespace frm
bool FormOperations::impl_commitCurrentRecord_throw( sal_Bool* _pRecordInserted ) const
{
#ifdef DBG_UTIL
DBG_ASSERT( m_nMethodNestingLevel, "FormOperations::impl_commitCurrentRecord_throw: to be called within a MethodGuard'ed section only!" );
#endif
if ( !impl_hasCursor_nothrow() )
return false;
@ -911,7 +913,9 @@ namespace frm
bool FormOperations::impl_commitCurrentControl_throw() const
{
#ifdef DBG_UTIL
DBG_ASSERT( m_nMethodNestingLevel, "FormOperations::impl_commitCurrentControl_throw: to be called within a MethodGuard'ed section only!" );
#endif
OSL_PRECOND( m_xController.is(), "FormOperations::commitCurrentControl: no controller!" );
if ( !m_xController.is() )
return false;

View File

@ -123,9 +123,7 @@ void PropertySetBase::initializePropertyValueCache( sal_Int32 nHandle )
Any aCurrentValue;
getFastPropertyValue( aCurrentValue, nHandle );
#if OSL_DEBUG_LEVEL > 0
::std::pair< PropertyValueCache::iterator, bool > aInsertResult =
#endif
m_aCache.insert( PropertyValueCache::value_type( nHandle, aCurrentValue ) );
OSL_ENSURE( aInsertResult.second, "PropertySetBase::initializePropertyValueCache: already cached a value for this property!" );
}

View File

@ -459,9 +459,7 @@ namespace svt
continue;
}
#ifdef DBG_UTIL
bool bKnownSetting =
#endif
implHandleInitializationArgument( sSettingName, aSettingValue );
DBG_ASSERT( bKnownSetting,
( OString( "OCommonPicker::initialize: unknown argument \"" )

View File

@ -266,9 +266,6 @@ void SvtExpFileDlg_Impl::SetStandardDir( const OUString& _rDir )
_aStdDir = "file:///";
}
#if defined DBG_UTIL
namespace {
OUString lcl_DecoratedFilter( const OUString& _rOriginalFilter )
{
@ -279,8 +276,6 @@ namespace {
return aDecoratedFilter.makeStringAndClear();
}
}
#endif
void SvtExpFileDlg_Impl::ClearFilterList( )
{

View File

@ -236,11 +236,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
int nX = abs(nWidth - cxDib) / 2;
int nY = abs(nHeight - cyDib) / 2;
#if OSL_DEBUG_LEVEL > 0
int GDIError = GDI_ERROR;
GDIError =
#endif
StretchDIBits(
int GDIError = StretchDIBits(
hDC, nX, nY, cxDib, cyDib,
0, 0, cxDib, cyDib, pBits, pbmi,
DIB_RGB_COLORS, SRCCOPY);

View File

@ -96,16 +96,10 @@
#define OSL_TRACE(...) \
SAL_DETAIL_INFO_IF_FORMAT(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__)
#if OSL_DEBUG_LEVEL > 0
#define OSL_ASSERT(c) \
SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "OSL_ASSERT: %s", #c)
#define OSL_ENSURE(c, m) SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "%s", m)
#define OSL_FAIL(m) SAL_DETAIL_WARN_IF_FORMAT(sal_True, "legacy.osl", "%s", m)
#else
#define OSL_ASSERT(c) ((void) 0)
#define OSL_ENSURE(c, m) ((void) 0)
#define OSL_FAIL(m) ((void) 0)
#endif
#define OSL_VERIFY(c) do { if (!(c)) OSL_ASSERT(0); } while (0)
#define OSL_PRECOND(c, m) OSL_ENSURE(c, m)

View File

@ -101,15 +101,6 @@ inline void DbgSetTestSolarMutex( DbgTestSolarMutexProc pProc )
DbgFunc( DBG_FUNC_SETTESTSOLARMUTEX, reinterpret_cast<void*>(reinterpret_cast<sal_uIntPtr>(pProc)) );
}
#define DBG_ASSERTWARNING( sCon, aWarning ) \
SAL_DETAIL_INFO_IF_FORMAT(!(sCon), "legacy.tools", "%s", aWarning)
#define DBG_ASSERT( sCon, aError ) \
SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.tools", "%s", aError)
#define DBG_WARNING( aWarning ) \
SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", "%s", aWarning)
#define DBG_TESTSOLARMUTEX() \
do \
{ \
@ -119,14 +110,19 @@ do \
#else
// NO DBG_UITL
#define DBG_ASSERTWARNING( sCon, aWarning ) ((void)0)
#define DBG_ASSERT( sCon, aError ) ((void)0)
#define DBG_WARNING( aWarning ) ((void)0)
#define DBG_TESTSOLARMUTEX() ((void)0)
#endif
#define DBG_ASSERTWARNING( sCon, aWarning ) \
SAL_DETAIL_INFO_IF_FORMAT(!(sCon), "legacy.tools", "%s", aWarning)
#define DBG_ASSERT( sCon, aError ) \
SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.tools", "%s", aError)
#define DBG_WARNING( aWarning ) \
SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", "%s", aWarning)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -198,9 +198,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe
case TypeClass_BOOLEAN: // sal_Bool
{
bool bValue(false);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertBool(bValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("OXMLControlProperty::convertString: could not convert \"").
@ -213,9 +211,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe
case TypeClass_LONG: // sal_Int32
{ // it's a real int32/16 property
sal_Int32 nValue(0);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertNumber(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("OXMLControlProperty::convertString: could not convert \"").
@ -235,9 +231,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe
case TypeClass_DOUBLE:
{
double nValue = 0.0;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertDouble(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("OXMLControlProperty::convertString: could not convert \"").
@ -266,9 +260,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe
{
// first extract the double
double nValue = 0;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertDouble(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("OPropertyImport::convertString: could not convert \"").

View File

@ -72,19 +72,14 @@ OReportExchange::TSectionElements OReportExchange::extractCopies(const Transfera
{
// extract the any from the transferable
datatransfer::DataFlavor aFlavor;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
OSL_ENSURE(bSuccess, "OReportExchange::extractCopies: invalid data format (no flavor)!");
uno::Any aDescriptor = _rData.GetAny(aFlavor, OUString());
TSectionElements aCopies;
#if OSL_DEBUG_LEVEL > 0
bSuccess =
#endif
aDescriptor >>= aCopies;
bSuccess = aDescriptor >>= aCopies;
OSL_ENSURE(bSuccess, "OReportExchange::extractCopies: invalid clipboard format!");
// build the real descriptor

View File

@ -100,10 +100,7 @@ oslSecurityError SAL_CALL osl_loginUser( rtl_uString *strUserName, rtl_uString *
sal_Unicode* strUser;
sal_Unicode* strDomain = _wcsdup(rtl_uString_getStr(strUserName));
HANDLE hUserToken;
#if OSL_DEBUG_LEVEL > 0
LUID luid;
#endif
if (NULL != (strUser = wcschr(strDomain, L'/')))
*strUser++ = L'\0';
@ -115,6 +112,7 @@ oslSecurityError SAL_CALL osl_loginUser( rtl_uString *strUserName, rtl_uString *
// this process must have the right: 'act as a part of operatingsystem'
OSL_ASSERT(LookupPrivilegeValue(NULL, SE_TCB_NAME, &luid));
(void) luid;
if (LogonUserW(strUser, strDomain ? strDomain : L"", rtl_uString_getStr(strPasswd),
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,

View File

@ -1956,10 +1956,7 @@ void Converter::encodeBase64(OUStringBuffer& aStrBuffer, const uno::Sequence<sal
void Converter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const OUString& sBuffer)
{
#if OSL_DEBUG_LEVEL > 0
sal_Int32 nCharsDecoded =
#endif
decodeBase64SomeChars( aBuffer, sBuffer );
sal_Int32 nCharsDecoded = decodeBase64SomeChars( aBuffer, sBuffer );
OSL_ENSURE( nCharsDecoded == sBuffer.getLength(), "some bytes left in base64 decoding!" );
}

View File

@ -1951,9 +1951,7 @@ double ScInterpreter::GetHypGeomDist( double x, double n, double M, double N )
fCDenomVarLower = N - n - 2.0*(M - x) + 1.0;
}
#if OSL_DEBUG_LEVEL > 0
double fCNumLower = N - n - fCNumVarUpper;
#endif
double fCDenomUpper = N - n - M + x + 1.0 - fCDenomVarLower;
double fDNumVarLower = n - M;

View File

@ -1565,10 +1565,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pMySheet)
{
// A stylesheet of the same name already exists -> overwrite contents
#ifdef DBG_UTIL
bool bTest =
#endif
pMySheet->SetName(pHisSheet->GetName());
bool bTest = pMySheet->SetName(pHisSheet->GetName());
DBG_ASSERT(bTest, "Renaming StyleSheet failed.");
pMySheet->GetItemSet().ClearItem(0); // Delete all

View File

@ -917,9 +917,7 @@ void SlotManager::RenameSlide()
aNameDlg->GetName( aNewName );
if (aNewName != aPageName)
{
#ifdef DBG_UTIL
bool bResult =
#endif
RenameSlideFromDrawViewShell(
pSelectedPage->GetPageNum()/2, aNewName );
DBG_ASSERT( bResult, "Couldn't rename slide" );

View File

@ -442,10 +442,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
aNameDlg->GetName( aNewName );
if (aNewName != aPageName)
{
#ifdef DBG_UTIL
bool bResult =
#endif
RenameSlide( nPageId, aNewName );
bool bResult = RenameSlide( nPageId, aNewName );
DBG_ASSERT( bResult, "Couldn't rename slide" );
}
}

View File

@ -425,10 +425,7 @@ void View::DragFinished( sal_Int8 nDropAction )
if( pObj && pObj->GetPage() )
{
const size_t nOrdNum = pObj->GetOrdNumDirect();
#ifdef DBG_UTIL
SdrObject* pChkObj =
#endif
pObj->GetPage()->RemoveObject(nOrdNum);
SdrObject* pChkObj = pObj->GetPage()->RemoveObject(nOrdNum);
DBG_ASSERT(pChkObj==pObj,"pChkObj!=pObj in RemoveObject()");
}
}

View File

@ -3223,10 +3223,8 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt
bool bSendNotification = false;
uno::Reference< embed::XStorage > xOldStorageHolder;
#ifdef DBG_UTIL
// check for wrong creation of object container
bool bHasContainer = ( pImp->mpObjectContainer != 0 );
#endif
if ( !xStorage.is() || xStorage == GetStorage() )
{
@ -3273,7 +3271,6 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt
return bResult;
}
#if OSL_DEBUG_LEVEL > 0
bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XStorage >& xSource,
const uno::Reference< embed::XStorage >& xTarget )
{
@ -3365,15 +3362,12 @@ bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XSto
return true;
}
#endif
bool SfxObjectShell::SwitchPersistance( const uno::Reference< embed::XStorage >& xStorage )
{
bool bResult = false;
#ifdef DBG_UTIL
// check for wrong creation of object container
bool bHasContainer = ( pImp->mpObjectContainer != 0 );
#endif
if ( xStorage.is() )
{
if ( pImp->mpObjectContainer )

View File

@ -79,11 +79,7 @@ void CBaseReader::Initialize( const std::string& ContentName)
parser.parse(&m_ZipContent[0], m_ZipContent.size());
}
}
catch(std::exception&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch(std::exception& ex)
{
OSL_ENSURE( false, ex.what() );
}

View File

@ -39,11 +39,7 @@ CBaseReader( DocumentName )
m_DefaultLocale = DocumentLocale;
Initialize( DOC_CONTENT_NAME );
}
catch(xml_parser_exception&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch(xml_parser_exception& ex)
{
OSL_ENSURE(false, ex.what());
}
@ -61,11 +57,7 @@ try
m_DefaultLocale = DocumentLocale;
Initialize( DOC_CONTENT_NAME );
}
catch(xml_parser_exception&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch(xml_parser_exception& ex)
{
OSL_ENSURE(false, ex.what());
}

View File

@ -58,11 +58,7 @@ CBaseReader( DocumentName )
Initialize( META_CONTENT_NAME );
}
catch(xml_parser_exception&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch(xml_parser_exception& ex)
{
OSL_ENSURE(false, ex.what());
}
@ -99,11 +95,7 @@ try
Initialize( META_CONTENT_NAME );
}
catch(xml_parser_exception&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch(xml_parser_exception& ex)
{
OSL_ENSURE(false, ex.what());
}

View File

@ -293,11 +293,7 @@ int main(int argc, char* argv[])
ulRet = SUCCESS_SUCCESS;
}
catch (const std::runtime_error&
#if OSL_DEBUG_LEVEL > 0
ex
#endif
)
catch (const std::runtime_error& ex)
{
OSL_FAIL(ex.what());
}

View File

@ -615,11 +615,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
// Open a stream
BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, bool,
const OString*
#ifdef DBG_UTIL
pB
#endif
)
const OString* pB )
{
DBG_ASSERT(!pB, "Encryption not supported");

View File

@ -218,11 +218,7 @@ SfxVoidItem::SfxVoidItem( const SfxVoidItem& rCopy):
}
bool SfxVoidItem::operator==( const SfxPoolItem&
#ifdef DBG_UTIL
rCmp
#endif
) const
bool SfxVoidItem::operator==( const SfxPoolItem& rCmp ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
return true;

View File

@ -140,9 +140,7 @@ Result normalizePrefix( css::uno::Reference< css::ucb::XUniversalContentBroker >
return GeneralFailure;
}
try {
#if OSL_DEBUG_LEVEL > 0
bool ok =
#endif
(css::uno::Reference< css::ucb::XCommandProcessor >(
content, css::uno::UNO_QUERY_THROW)->execute(
css::ucb::Command("getCasePreservingURL",

View File

@ -91,11 +91,7 @@ void EditBrowseBox::implCreateActiveAccessible( )
}
Reference< XAccessible > EditBrowseBox::CreateAccessibleControl( sal_Int32
#ifdef DBG_UTIL
_nIndex
#endif
)
Reference< XAccessible > EditBrowseBox::CreateAccessibleControl( sal_Int32 _nIndex )
{
DBG_ASSERT( 0 == _nIndex, "EditBrowseBox::CreateAccessibleControl: invalid index!" );

View File

@ -985,10 +985,7 @@ void SvImpLBox::MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop )
{
if( !pView->IsExpanded( pParent ) )
{
#ifdef DBG_UTIL
bool bRet =
#endif
pView->Expand( pParent );
bool bRet = pView->Expand( pParent );
DBG_ASSERT(bRet,"Not expanded!");
}
pParent = pView->GetParent( pParent );

View File

@ -1338,9 +1338,7 @@ void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry )
DBG_ASSERT(pEntry,"Insert:No Entry");
SvViewDataEntry* pData = m_rThis.CreateViewData( pEntry );
m_rThis.InitViewData( pData, pEntry );
#ifdef DBG_UTIL
std::pair<SvDataTable::iterator, bool> aSuccess =
#endif
m_DataTable.insert( pEntry, pData );
DBG_ASSERT(aSuccess.second,"Entry already in View");
if (m_nVisibleCount && m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry))

View File

@ -580,21 +580,12 @@ bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 nActi
3. target is a collapsed parent
- entry is inserted at the end of the target childlist
*/
#ifdef DBG_UTIL
TriState SvTreeListBox::NotifyMoving(
SvTreeListEntry* pTarget, // D&D dropping position in this->GetModel()
SvTreeListEntry* pEntry, // entry that we want to move, from
// GetSourceListBox()->GetModel()
SvTreeListEntry*& rpNewParent, // new target parent
sal_uLong& rNewChildPos) // position in childlist of target parent
#else
TriState SvTreeListBox::NotifyMoving(
SvTreeListEntry* pTarget, // D&D dropping position in this->GetModel()
SvTreeListEntry*, // entry that we want to move, from
// GetSourceListBox()->GetModel()
SvTreeListEntry*& rpNewParent, // new target parent
sal_uLong& rNewChildPos) // position in childlist of target parent
#endif
{
DBG_ASSERT(pEntry,"NotifyMoving:SoureEntry?");
if( !pTarget )

View File

@ -33,11 +33,7 @@ void AsynchronLink::CreateMutex()
if( !_pMutex ) _pMutex = new osl::Mutex;
}
void AsynchronLink::Call( void* pObj, bool
#ifdef DBG_UTIL
bAllowDoubles
#endif
, bool bUseTimer )
void AsynchronLink::Call( void* pObj, bool bAllowDoubles, bool bUseTimer )
{
#ifdef DBG_UTIL
if ( bUseTimer || !_bInCall )

View File

@ -400,9 +400,7 @@ void AssignmentPersistentData::ImplCommit()
aNewFieldDescription[1].Value <<= _rAssignment;
// just set the new value
#ifdef DBG_UTIL
bool bSuccess =
#endif
SetSetProperties(sDescriptionNodePath, aNewFieldDescription);
DBG_ASSERT(bSuccess, "AssignmentPersistentData::setFieldAssignment: could not commit the changes a field!");
}

View File

@ -406,10 +406,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak )
OUString sSave( aToken );
nNextCh = '\\';
#ifdef DBG_UTIL
int nToken =
#endif
_GetNextToken();
int nToken = _GetNextToken();
DBG_ASSERT( RTF_U == nToken, "doch kein UNI-Code Zeichen" );
// dont convert symbol chars
aStrBuffer.append(static_cast< sal_Unicode >(nTokenValue));

View File

@ -179,30 +179,21 @@ namespace {
{
if (aVal.Name == "DataSource")
{
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
aVal.Value >>= m_xDataSource;
bool bSuccess = aVal.Value >>= m_xDataSource;
OSL_ENSURE( bSuccess, "OAddressBookSourceDialogUno::implInitialize: invalid type for DataSource!" );
return;
}
if (aVal.Name == "DataSourceName")
{
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
aVal.Value >>= m_sDataSourceName;
bool bSuccess = aVal.Value >>= m_sDataSourceName;
OSL_ENSURE( bSuccess, "OAddressBookSourceDialogUno::implInitialize: invalid type for DataSourceName!" );
return;
}
if (aVal.Name == "Command")
{
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
aVal.Value >>= m_sTable;
bool bSuccess = aVal.Value >>= m_sTable;
OSL_ENSURE( bSuccess, "OAddressBookSourceDialogUno::implInitialize: invalid type for Command!" );
return;
}

View File

@ -267,9 +267,7 @@ namespace svx
// extract the any from the transferable
DataFlavor aFlavor;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
@ -277,10 +275,7 @@ namespace svx
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
#if OSL_DEBUG_LEVEL > 0
bSuccess =
#endif
aDescriptor >>= aDescriptorProps;
bSuccess = aDescriptor >>= aDescriptorProps;
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid clipboard format!");
// build the real descriptor
@ -511,9 +506,7 @@ namespace svx
{
// extract the any from the transferable
DataFlavor aFlavor;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
@ -521,10 +514,7 @@ namespace svx
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
#if OSL_DEBUG_LEVEL > 0
bSuccess =
#endif
aDescriptor >>= aDescriptorProps;
bSuccess = aDescriptor >>= aDescriptorProps;
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid clipboard format!");
// build the real descriptor
@ -669,9 +659,7 @@ namespace svx
{
// extract the any from the transferable
DataFlavor aFlavor;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");

View File

@ -121,9 +121,7 @@ namespace svx
// extract the any from the transferable
DataFlavor aFlavor;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(bForm), aFlavor);
OSL_ENSURE(bSuccess, "OComponentTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
@ -131,10 +129,7 @@ namespace svx
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
#if OSL_DEBUG_LEVEL > 0
bSuccess =
#endif
aDescriptor >>= aDescriptorProps;
bSuccess = aDescriptor >>= aDescriptorProps;
OSL_ENSURE(bSuccess, "OComponentTransferable::extractColumnDescriptor: invalid clipboard format!");
// build the real descriptor

View File

@ -3550,9 +3550,7 @@ void DbGridControl::DisconnectFromFields()
ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners);
while (!pListeners->empty())
{
#ifdef DBG_UTIL
sal_Int32 nOldSize = pListeners->size();
#endif
pListeners->begin()->second->dispose();
DBG_ASSERT(nOldSize > (sal_Int32)pListeners->size(), "DbGridControl::DisconnectFromFields : dispose on a listener should result in a removal from my list !");
}

View File

@ -264,17 +264,11 @@ namespace
return;
}
#if OSL_DEBUG_LEVEL > 0
Any aOldAssignment =
#endif
_map->remove( makeAny( xControlModel ) );
#if OSL_DEBUG_LEVEL > 0
(void)aOldAssignment;
#endif
OSL_ENSURE( !i_ignoreNonExistence ||
( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ),
"lcl_removeFormObject: map was inconsistent!" );
(void)i_ignoreNonExistence;
}
}

View File

@ -103,9 +103,7 @@ namespace svxform
Reference< XInterface > xNormalizedModel( pFormObject->GetUnoControlModel(), UNO_QUERY );
// note that this is normalized (i.e. queried for XInterface explicitly)
#ifdef DBG_UTIL
::std::pair< MapModelToShape::iterator, bool > aPos =
#endif
_rMapping.insert( ModelShapePair( xNormalizedModel, pSdrObject ) );
DBG_ASSERT( aPos.second, "collectShapeModelMapping: model was already existent!" );
// if this asserts, this would mean we have 2 shapes pointing to the same model
@ -947,13 +945,17 @@ namespace svxform
if ( DND_ACTION_COPY == _nAction )
{ // bHasHiddenControlsFormat means that only hidden controls are part of the data
#ifdef DBG_UTIL
DBG_ASSERT( bHasHiddenControlsFormat, "NavigatorTree::implExecuteDataTransfer: copy allowed for hidden controls only!" );
#endif
DBG_ASSERT( _pTargetEntry && ( _pTargetEntry != m_pRootEntry ) && IsFormEntry( _pTargetEntry ),
"NavigatorTree::implExecuteDataTransfer: should not be here!" );
// implAcceptDataTransfer should have caught both cases
#ifdef DBG_UTIL
DBG_ASSERT(bHasHiddenControlsFormat, "NavigatorTree::implExecuteDataTransfer: only copying of hidden controls is supported !");
// should be catched by AcceptDrop
#endif
// because i want to select all targets (and only them)
SelectAll(false);

View File

@ -785,10 +785,7 @@ void SdrUndoInsertObj::Undo()
{
ImplUnmarkObject( pObj );
#ifdef DBG_UTIL
SdrObject* pChkObj=
#endif
pObjList->RemoveObject(nOrdNum);
SdrObject* pChkObj= pObjList->RemoveObject(nOrdNum);
DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj");
}
}
@ -1327,10 +1324,7 @@ void SdrUndoNewLayer::Undo()
{
DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer already belongs to UndoAction.");
bItsMine=true;
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
pLayerAdmin->RemoveLayer(nNum);
SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum);
DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoNewLayer::Undo(): Removed layer is != pLayer.");
}
@ -1359,10 +1353,7 @@ void SdrUndoDelLayer::Redo()
{
DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer already belongs to UndoAction.");
bItsMine=true;
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
pLayerAdmin->RemoveLayer(nNum);
SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum);
DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoDelLayer::Redo(): Removed layer is != pLayer.");
}
@ -1375,20 +1366,14 @@ OUString SdrUndoDelLayer::GetComment() const
void SdrUndoMoveLayer::Undo()
{
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
pLayerAdmin->RemoveLayer(nNeuPos);
SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNeuPos);
DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Undo(): Removed layer is != pLayer.");
pLayerAdmin->InsertLayer(pLayer,nNum);
}
void SdrUndoMoveLayer::Redo()
{
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
pLayerAdmin->RemoveLayer(nNum);
SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum);
DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Redo(): Removed layer is != pLayer.");
pLayerAdmin->InsertLayer(pLayer,nNeuPos);
}

View File

@ -2182,9 +2182,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
SdrObjList* pObjList = mpObj->GetObjList();
if( pObjList )
{
#ifdef DBG_UTIL
SdrObject* pCheck =
#endif
pObjList->SetObjectOrdNum( mpObj->GetOrdNum(), static_cast<size_t>(nNewOrdNum) );
DBG_ASSERT( pCheck == mpObj.get(), "GetOrdNum() failed!" );
}

View File

@ -141,10 +141,7 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
// SwXTextRange -> PaM
SwUnoInternalPaM aPaM(*pDoc);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sw::XTextRangeToSwPaM(aPaM, rRange);
bool bSuccess = ::sw::XTextRangeToSwPaM(aPaM, rRange);
OSL_ENSURE(bSuccess, "illegal range");
// PaM -> Index
@ -160,10 +157,7 @@ XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc)
if (NULL == pIndex)
{
SwUnoInternalPaM aUnoPaM(rDoc);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sw::XTextRangeToSwPaM(aUnoPaM, xRange);
bool bSuccess = ::sw::XTextRangeToSwPaM(aUnoPaM, xRange);
OSL_ENSURE(bSuccess, "illegal range");
rPos = *aUnoPaM.GetPoint();

View File

@ -188,11 +188,7 @@ namespace toolkit
}
void SAL_CALL OAccessibleControlContext::disposing( const EventObject&
#if OSL_DEBUG_LEVEL > 0
_rSource
#endif
) throw ( RuntimeException, std::exception )
void SAL_CALL OAccessibleControlContext::disposing( const EventObject& _rSource ) throw ( RuntimeException, std::exception )
{
OSL_ENSURE( Reference< XPropertySet >( _rSource.Source, UNO_QUERY ).get() == m_xControlModel.get(),
"OAccessibleControlContext::disposing: where did this come from?" );

View File

@ -281,9 +281,11 @@ sal_uInt32 SvPersistStream::WriteDummyLen()
sal_uInt32 n0 = 0;
WriteUInt32( n0 ); // Because of Sun sp
// Don't assert on stream error
#ifdef DBG_UTIL
DBG_ASSERT( GetError() != SVSTREAM_OK
|| (sizeof( sal_uInt32 ) == Tell() -nPos),
"No 4 byte as length parameter" );
#endif
return Tell();
}

View File

@ -1623,7 +1623,9 @@ bool SvStream::SetStreamSize(sal_uInt64 const nSize)
SetBufferSize( 0 );
SetSize( nSize );
SetBufferSize( nBuf );
#ifdef DBG_UTIL
DBG_ASSERT(Tell()==nFPos,"SetStreamSize failed");
#endif
return (nError == 0);
}

View File

@ -253,7 +253,6 @@ bool implMakeAbsoluteURL(OUString & _rsPathOrURL)
return bURL && implEnsureAbsolute(_rsPathOrURL);
}
#if OSL_DEBUG_LEVEL > 0
static
PathStatus dbgCheckStatusOfURL(OUString const& _sURL)
{
@ -264,8 +263,6 @@ PathStatus dbgCheckStatusOfURL(OUString const& _sURL)
return implCheckStatusOfURL(_sURL,aDirItem);
}
#endif
static
PathStatus checkStatusAndNormalizeURL(OUString & _sURL)
{

View File

@ -158,11 +158,7 @@ namespace utl
}
}
void SAL_CALL CloseableComponentImpl::queryClosing( const EventObject&
#ifdef DBG_UTIL
Source
#endif
, sal_Bool /*GetsOwnership*/ ) throw (CloseVetoException, RuntimeException, std::exception)
void SAL_CALL CloseableComponentImpl::queryClosing( const EventObject& Source, sal_Bool /*GetsOwnership*/ ) throw (CloseVetoException, RuntimeException, std::exception)
{
// as long as we live, somebody wants to keep the object alive. So, veto the
// closing
@ -170,11 +166,7 @@ namespace utl
throw CloseVetoException();
}
void SAL_CALL CloseableComponentImpl::notifyClosing( const EventObject&
#ifdef DBG_UTIL
Source
#endif
) throw (RuntimeException, std::exception)
void SAL_CALL CloseableComponentImpl::notifyClosing( const EventObject& Source ) throw (RuntimeException, std::exception)
{
DBG_ASSERT( Source.Source == m_xCloseable, "CloseableComponentImpl::notifyClosing: where did this come from?" );
@ -184,11 +176,7 @@ namespace utl
OSL_FAIL( "CloseableComponentImpl::notifyClosing: unreachable!" );
}
void SAL_CALL CloseableComponentImpl::disposing( const EventObject&
#ifdef DBG_UTIL
Source
#endif
) throw (RuntimeException, std::exception)
void SAL_CALL CloseableComponentImpl::disposing( const EventObject& Source ) throw (RuntimeException, std::exception)
{
DBG_ASSERT( Source.Source == m_xCloseable, "CloseableComponentImpl::disposing: where did this come from?" );
OSL_FAIL( "CloseableComponentImpl::disposing: unreachable!" );

View File

@ -106,11 +106,7 @@ bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency )
return bRet;
}
bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong
#ifdef DBG_UTIL
nTol
#endif
)
bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol )
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
bool bRet = false;

View File

@ -1360,8 +1360,10 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
OSL_ENSURE(mpScanline, "No Scanline allocated (!)");
OSL_ENSURE(mpScanlineAlpha, "No ScanlineAlpha allocated (!)");
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(mnAllocSizeScanline >= maOrigSize.Width() * 3, "Allocated Scanline too small (!)");
OSL_ENSURE(mnAllocSizeScanlineAlpha >= maOrigSize.Width(), "Allocated ScanlineAlpha too small (!)");
#endif
sal_uInt8* pScanline(mpScanline);
sal_uInt8* pScanlineAlpha(mpScanlineAlpha);
@ -1495,7 +1497,9 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
if(bDoDirectScanline)
{
OSL_ENSURE(mpScanline, "No Scanline allocated (!)");
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(mnAllocSizeScanline >= maOrigSize.Width() * 3, "Allocated Scanline too small (!)");
#endif
sal_uInt8* pScanline(mpScanline);
for (long nX(0); nX < maOrigSize.Width(); nX++, pTmp += 3)

View File

@ -1472,10 +1472,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs
HPEN hPen = NULL;
HBRUSH hBrush = NULL;
#if OSL_DEBUG_LEVEL > 0
int oldCount = pSalData->mnCacheDCInUse;
(void)oldCount;
#endif
// Release Cache DC
if ( pThis->mpGraphics2 &&

View File

@ -1097,11 +1097,7 @@ void XMLShapeImportHelper::startPage( com::sun::star::uno::Reference< com::sun::
}
/** this method must be calling after the last shape is imported for the given page */
void XMLShapeImportHelper::endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >&
#ifdef DBG_UTIL
rShapes
#endif
)
void XMLShapeImportHelper::endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes )
{
DBG_ASSERT( mpPageContext && (mpPageContext->mxShapes == rShapes), "wrong call to endPage(), no startPage called or wrong page" );
if( NULL == mpPageContext )

View File

@ -950,10 +950,12 @@ namespace xmloff
#endif
}
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( 0 == nIncludeBinding,
"OControlExport::exportBindingAtributes: forgot some flags!");
// in the debug version, we should have removed every bit we handled from the mask, so it should
// be 0 now ...
#endif
}
void OControlExport::exportSpecialAttributes()
@ -1609,9 +1611,7 @@ namespace xmloff
// for a list box, if the ListSourceType is VALUE_LIST, no ListSource is stored, but instead
// a sequence of pairs which is build from the StringItemList and the ValueList
ListSourceType eListSourceType = ListSourceType_VALUELIST;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
m_xProps->getPropertyValue(PROPERTY_LISTSOURCETYPE) >>= eListSourceType;
OSL_ENSURE(bSuccess, "OControlExport::examineControl: could not retrieve the ListSourceType!");
if (ListSourceType_VALUELIST != eListSourceType)

View File

@ -936,10 +936,7 @@ namespace xmloff
Property aProp = _rxPropInfo->getPropertyByName(_rPropValue.Name);
// the untranslated string value as read in handleAttribute
OUString sValue;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
_rPropValue.Value >>= sValue;
bool bSuccess = _rPropValue.Value >>= sValue;
OSL_ENSURE(bSuccess, "OControlImport::implTranslateValueProperty: supposed to be called with non-translated string values!");
if (TypeClass_ANY == aProp.Type.getTypeClass())

View File

@ -275,10 +275,7 @@ namespace xmloff
return;
}
#if OSL_DEBUG_LEVEL > 0
bool bPageIsKnown =
#endif
implMoveIterators(_rxDrawPage, false);
bool bPageIsKnown = implMoveIterators(_rxDrawPage, false);
OSL_ENSURE(bPageIsKnown, "OFormLayerXMLExport_Impl::exportForms: exporting a page which has not been examined!");
// export forms collection
@ -414,10 +411,7 @@ namespace xmloff
}
// move the iterator which specify the currently handled page
#if OSL_DEBUG_LEVEL > 0
bool bPageIsKnown =
#endif
implMoveIterators(_rxDrawPage, true);
bool bPageIsKnown = implMoveIterators(_rxDrawPage, true);
OSL_ENSURE(!bPageIsKnown, "OFormLayerXMLExport_Impl::examineForms: examining a page twice!");
::std::stack< Reference< XIndexAccess > > aContainerHistory;
@ -752,9 +746,7 @@ namespace xmloff
{
Reference< XPropertySet > xProps( _rxControl, UNO_QUERY );
OSL_ENSURE( xProps.is(), "OFormLayerXMLExport_Impl::excludeFromExport: invalid control model!" );
#if OSL_DEBUG_LEVEL > 0
::std::pair< PropertySetBag::iterator, bool > aPos =
#endif
m_aIgnoreList.insert( xProps );
OSL_ENSURE( aPos.second, "OFormLayerXMLExport_Impl::excludeFromExport: element already exists in the ignore list!" );
}

View File

@ -93,9 +93,7 @@ Any PropertyConversion::convertString( const ::com::sun::star::uno::Type& _rExpe
case TypeClass_BOOLEAN: // sal_Bool
{
bool bValue;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertBool(bValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("PropertyConversion::convertString: could not convert \"").
@ -109,9 +107,7 @@ Any PropertyConversion::convertString( const ::com::sun::star::uno::Type& _rExpe
if (!_pEnumMap)
{ // it's a real int32/16 property
sal_Int32 nValue(0);
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertNumber(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("PropertyConversion::convertString: could not convert \"").
@ -149,9 +145,7 @@ Any PropertyConversion::convertString( const ::com::sun::star::uno::Type& _rExpe
case TypeClass_DOUBLE:
{
double nValue;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertDouble(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("PropertyConversion::convertString: could not convert \"").
@ -177,9 +171,7 @@ Any PropertyConversion::convertString( const ::com::sun::star::uno::Type& _rExpe
{
// first extract the double
double nValue = 0;
#if OSL_DEBUG_LEVEL > 0
bool bSuccess =
#endif
::sax::Converter::convertDouble(nValue, _rReadCharacters);
OSL_ENSURE(bSuccess,
OStringBuffer("PropertyConversion::convertString: could not convert \"").
@ -315,11 +307,7 @@ bool OPropertyImport::encounteredAttribute(const OUString& _rAttributeName) cons
return m_aEncounteredAttributes.end() != m_aEncounteredAttributes.find(_rAttributeName);
}
void OPropertyImport::Characters(const OUString&
#if OSL_DEBUG_LEVEL > 0
_rChars
#endif
)
void OPropertyImport::Characters(const OUString& _rChars )
{
// ignore them (should be whitespaces only)
OSL_ENSURE(_rChars.trim().isEmpty(), "OPropertyImport::Characters: non-whitespace characters!");

View File

@ -899,11 +899,7 @@ void XMLSectionExport::ExportBaseIndexSource(
void XMLSectionExport::ExportBaseIndexBody(
SectionTypeEnum
#if OSL_DEBUG_LEVEL > 0
eType
#endif
,
SectionTypeEnum eType,
const Reference<XPropertySet> &)
{
// type not used; checked anyway.

View File

@ -47,11 +47,7 @@ void XMLSectionFootnoteConfigExport::exportXML(
SvXMLExport& rExport,
bool bEndnote,
const vector<XMLPropertyState> *pProperties,
sal_uInt32
#ifdef DBG_UTIL
nIdx
#endif
,
sal_uInt32 nIdx,
const rtl::Reference<XMLPropertySetMapper> & rMapper)
{
// store and initialize the values

View File

@ -191,11 +191,7 @@ static const SvXMLTokenMapEntry aTypes[] =
};
sal_uInt16 xforms_getTypeClass(
const Reference<XDataTypeRepository>&
#ifdef DBG_UTIL
xRepository
#endif
,
const Reference<XDataTypeRepository>& xRepository,
const SvXMLNamespaceMap& rNamespaceMap,
const OUString& rXMLName )
{