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 @@ ...@@ -38,7 +38,6 @@
#if defined _MSC_VER #if defined _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include "internal/dbgmacros.hxx"
extern long g_DllRefCnt; extern long g_DllRefCnt;
......
...@@ -88,11 +88,11 @@ void CBaseReader::Initialize( const std::string& ContentName) ...@@ -88,11 +88,11 @@ void CBaseReader::Initialize( const std::string& ContentName)
#endif #endif
) )
{ {
ENSURE( false, ex.what() ); OSL_ENSURE( false, ex.what() );
} }
catch(...) catch(...)
{ {
ENSURE(false, "Unknown error"); OSL_ENSURE(false, "Unknown error");
} }
} }
......
...@@ -51,11 +51,11 @@ CBaseReader( DocumentName ) ...@@ -51,11 +51,11 @@ CBaseReader( DocumentName )
#endif #endif
) )
{ {
ENSURE(false, ex.what()); OSL_ENSURE(false, ex.what());
} }
catch(...) catch(...)
{ {
ENSURE(false, "Unknown error"); OSL_ENSURE(false, "Unknown error");
} }
} }
...@@ -73,11 +73,11 @@ try ...@@ -73,11 +73,11 @@ try
#endif #endif
) )
{ {
ENSURE(false, ex.what()); OSL_ENSURE(false, ex.what());
} }
catch(...) catch(...)
{ {
ENSURE(false, "Unknown error"); OSL_ENSURE(false, "Unknown error");
} }
} }
......
...@@ -70,11 +70,11 @@ CBaseReader( DocumentName ) ...@@ -70,11 +70,11 @@ CBaseReader( DocumentName )
#endif #endif
) )
{ {
ENSURE(false, ex.what()); OSL_ENSURE(false, ex.what());
} }
catch(...) catch(...)
{ {
ENSURE(false, "Unknown error"); OSL_ENSURE(false, "Unknown error");
} }
} }
...@@ -111,11 +111,11 @@ try ...@@ -111,11 +111,11 @@ try
#endif #endif
) )
{ {
ENSURE(false, ex.what()); OSL_ENSURE(false, ex.what());
} }
catch(...) catch(...)
{ {
ENSURE(false, "Unknown error"); OSL_ENSURE(false, "Unknown error");
} }
} }
......
...@@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( ...@@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance(
else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid) else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid)
pUnk = static_cast<IExtractImage*>(new CThumbviewer()); 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) if (0 == pUnk)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -385,7 +385,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( ...@@ -385,7 +385,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance(
if ( CLSID_PROPERTY_HANDLER == m_Clsid ) if ( CLSID_PROPERTY_HANDLER == m_Clsid )
pUnk = static_cast<IPropertyStore*>( new CPropertyHdl() ); 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) if (0 == pUnk)
return E_OUTOFMEMORY; 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 ...@@ -45,14 +45,12 @@ CDEFS_X64+=-D_WIN32_IE=0x501
# --- Files -------------------------------------------------------- # --- Files --------------------------------------------------------
SLOFILES=$(SLO)$/dbgmacros.obj\ SLOFILES=$(SLO)$/fileextensions.obj\
$(SLO)$/fileextensions.obj\
$(SLO)$/registry.obj\ $(SLO)$/registry.obj\
$(SLO)$/utilities.obj\ $(SLO)$/utilities.obj\
$(SLO)$/iso8601_converter.obj $(SLO)$/iso8601_converter.obj
SLOFILES_X64=$(SLO_X64)$/dbgmacros.obj\ SLOFILES_X64=$(SLO_X64)$/fileextensions.obj\
$(SLO_X64)$/fileextensions.obj\
$(SLO_X64)$/registry.obj\ $(SLO_X64)$/registry.obj\
$(SLO_X64)$/utilities.obj\ $(SLO_X64)$/utilities.obj\
$(SLO_X64)$/iso8601_converter.obj $(SLO_X64)$/iso8601_converter.obj
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include <malloc.h> #include <malloc.h>
#include "internal/dbgmacros.hxx"
#include "internal/registry.hxx" #include "internal/registry.hxx"
#if defined _MSC_VER #if defined _MSC_VER
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "internal/config.hxx" #include "internal/config.hxx"
#include "internal/dbgmacros.hxx"
#include "internal/utilities.hxx" #include "internal/utilities.hxx"
//----------------------------- //-----------------------------
...@@ -85,7 +84,7 @@ std::wstring GetResString(int ResId) ...@@ -85,7 +84,7 @@ std::wstring GetResString(int ResId)
int rc = LoadStringW( GetModuleHandleW(MODULE_NAME), ResId, szResStr, sizeof(szResStr) ); int rc = LoadStringW( GetModuleHandleW(MODULE_NAME), ResId, szResStr, sizeof(szResStr) );
OutputDebugStringFormat( "GetResString: read %d chars\n", rc ); OutputDebugStringFormat( "GetResString: read %d chars\n", rc );
ENSURE(rc, "String resource not found"); OSL_ENSURE(rc, "String resource not found");
return std::wstring(szResStr); 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