Kaydet (Commit) e198be59 authored tarafından Christina Rossmanith's avatar Christina Rossmanith

Removed dbgmacros.{ch}xx / use OSL_{ENSURE,POSTCOND} instead

üst b0b3e5fd
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef DBGMACROS_HXX_INCLUDED
#define DBGMACROS_HXX_INCLUDED
void DbgAssert(bool condition, const char* message);
#if OSL_DEBUG_LEVEL > 0
#define PRE_CONDITION(x, msg) DbgAssert(x, msg)
#define POST_CONDITION(x, msg) DbgAssert(x, msg)
#define ENSURE(x ,msg) DbgAssert(x, msg)
#else // OSL_DEBUG_LEVEL == 0
#define PRE_CONDITION(x, msg) ((void)0)
#define POST_CONDITION(x, msg) ((void)0)
#define ENSURE(x, msg) ((void)0)
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -38,7 +38,6 @@
#if defined _MSC_VER
#pragma warning(pop)
#endif
#include "internal/dbgmacros.hxx"
extern long g_DllRefCnt;
......
......@@ -88,11 +88,11 @@ void CBaseReader::Initialize( const std::string& ContentName)
#endif
)
{
ENSURE( false, ex.what() );
OSL_ENSURE( false, ex.what() );
}
catch(...)
{
ENSURE(false, "Unknown error");
OSL_ENSURE(false, "Unknown error");
}
}
......
......@@ -51,11 +51,11 @@ CBaseReader( DocumentName )
#endif
)
{
ENSURE(false, ex.what());
OSL_ENSURE(false, ex.what());
}
catch(...)
{
ENSURE(false, "Unknown error");
OSL_ENSURE(false, "Unknown error");
}
}
......@@ -73,11 +73,11 @@ try
#endif
)
{
ENSURE(false, ex.what());
OSL_ENSURE(false, ex.what());
}
catch(...)
{
ENSURE(false, "Unknown error");
OSL_ENSURE(false, "Unknown error");
}
}
......
......@@ -70,11 +70,11 @@ CBaseReader( DocumentName )
#endif
)
{
ENSURE(false, ex.what());
OSL_ENSURE(false, ex.what());
}
catch(...)
{
ENSURE(false, "Unknown error");
OSL_ENSURE(false, "Unknown error");
}
}
......@@ -111,11 +111,11 @@ try
#endif
)
{
ENSURE(false, ex.what());
OSL_ENSURE(false, ex.what());
}
catch(...)
{
ENSURE(false, "Unknown error");
OSL_ENSURE(false, "Unknown error");
}
}
......
......@@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance(
else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid)
pUnk = static_cast<IExtractImage*>(new CThumbviewer());
POST_CONDITION(pUnk != 0, "Could not create COM object");
OSL_POSTCOND(pUnk != 0, "Could not create COM object");
if (0 == pUnk)
return E_OUTOFMEMORY;
......
......@@ -385,7 +385,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance(
if ( CLSID_PROPERTY_HANDLER == m_Clsid )
pUnk = static_cast<IPropertyStore*>( new CPropertyHdl() );
POST_CONDITION(pUnk != 0, "Could not create COM object");
OSL_POSTCOND(pUnk != 0, "Could not create COM object");
if (0 == pUnk)
return E_OUTOFMEMORY;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
#endif
#include <stdio.h>
#include "internal/dbgmacros.hxx"
void DbgAssert(bool /*condition*/, const char* /*message*/)
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -45,14 +45,12 @@ CDEFS_X64+=-D_WIN32_IE=0x501
# --- Files --------------------------------------------------------
SLOFILES=$(SLO)$/dbgmacros.obj\
$(SLO)$/fileextensions.obj\
SLOFILES=$(SLO)$/fileextensions.obj\
$(SLO)$/registry.obj\
$(SLO)$/utilities.obj\
$(SLO)$/iso8601_converter.obj
SLOFILES_X64=$(SLO_X64)$/dbgmacros.obj\
$(SLO_X64)$/fileextensions.obj\
SLOFILES_X64=$(SLO_X64)$/fileextensions.obj\
$(SLO_X64)$/registry.obj\
$(SLO_X64)$/utilities.obj\
$(SLO_X64)$/iso8601_converter.obj
......
......@@ -37,7 +37,6 @@
#pragma warning(pop)
#endif
#include <malloc.h>
#include "internal/dbgmacros.hxx"
#include "internal/registry.hxx"
#if defined _MSC_VER
......
......@@ -31,7 +31,6 @@
#include "internal/config.hxx"
#include "internal/dbgmacros.hxx"
#include "internal/utilities.hxx"
//-----------------------------
......@@ -85,7 +84,7 @@ std::wstring GetResString(int ResId)
int rc = LoadStringW( GetModuleHandleW(MODULE_NAME), ResId, szResStr, sizeof(szResStr) );
OutputDebugStringFormat( "GetResString: read %d chars\n", rc );
ENSURE(rc, "String resource not found");
OSL_ENSURE(rc, "String resource not found");
return std::wstring(szResStr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment