From 6206ae797f2f0983ee119f6857a8f2f8c910585d Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 22 May 2007 17:25:29 +0000 Subject: [PATCH] INTEGRATION: CWS chart2mst3 (1.1.1.1.4); FILE MERGED 2005/10/07 11:47:23 bm 1.1.1.1.4.4: RESYNC: (1.1.1.1-1.2); FILE MERGED 2004/06/07 15:34:47 bm 1.1.1.1.4.3: show exception type in ASSERT_EXCEPTION 2004/04/27 13:32:42 iha 1.1.1.1.4.2: warnings removed 2004/03/04 08:55:36 bm 1.1.1.1.4.1: ASSERT_EXCEPTION: for pro-builds print the exception variable to avoid warning --- chart2/source/inc/macros.hxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/chart2/source/inc/macros.hxx b/chart2/source/inc/macros.hxx index 469cd34351d6..75cf4736e043 100644 --- a/chart2/source/inc/macros.hxx +++ b/chart2/source/inc/macros.hxx @@ -4,9 +4,9 @@ * * $RCSfile: macros.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2005-09-08 00:47:36 $ + * last change: $Author: vg $ $Date: 2007-05-22 18:25:29 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,14 +35,25 @@ #ifndef CHART_MACROS_HXX #define CHART_MACROS_HXX +#include + /// creates a unicode-string from an ASCII string #define C2U(constAsciiStr) (::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) )) -/// shows an error-box for an exception ex -#define ASSERT_EXCEPTION(ex) \ +/** shows an error-box for an exception ex + else-branch necessary to avoid warning +*/ +#if OSL_DEBUG_LEVEL > 0 +#define ASSERT_EXCEPTION(ex) \ OSL_ENSURE( false, ::rtl::OUStringToOString( \ - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught: " )) + \ - ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) +\ + ::rtl::OUString::createFromAscii( typeid( ex ).name()) +\ + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) +\ + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()) +#else +//avoid compilation warnings +#define ASSERT_EXCEPTION(ex) ex.Context.is(); +#endif #define U2C(ouString) (::rtl::OUStringToOString(ouString,RTL_TEXTENCODING_ASCII_US).getStr())