diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:59 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:59 +0100 |
commit | ad669b8d2356b1f53c11c33ccb51803fd3ea49fe (patch) | |
tree | 605a882022093cc2eb32e4af9c06cd75befea795 /sal/osl/w32/diagnose.c | |
parent | 5f3b360f26fb05b2c1b6666321359346f2ddb5a4 (diff) | |
parent | c8b417d97c982736e9678264673a20d328cabd1f (diff) |
Merge commit 'ooo/DEV300_m103'
Conflicts:
codemaker/source/bonobowrappermaker/corbaoptions.cxx
codemaker/source/cppumaker/cppuoptions.cxx
codemaker/source/cunomaker/cunooptions.cxx
codemaker/source/idlmaker/idloptions.cxx
codemaker/source/javamaker/javaoptions.cxx
cppu/source/typelib/typelib.cxx
idlc/source/options.cxx
offapi/com/sun/star/util/PathSubstitution.idl
offapi/drafts/com/sun/star/form/ListEntryEvent.idl
offapi/drafts/com/sun/star/form/XBindableValue.idl
offapi/drafts/com/sun/star/form/XListEntryListener.idl
offapi/drafts/com/sun/star/form/XListEntrySink.idl
offapi/drafts/com/sun/star/form/XListEntrySource.idl
offapi/drafts/com/sun/star/form/XValueBinding.idl
registry/tools/checksingleton.cxx
registry/tools/options.hxx
registry/tools/regcompare.cxx
registry/tools/regmerge.cxx
sal/cppunittester/cppunittester.cxx
sal/osl/unx/socket.c
sal/osl/w32/diagnose.c
sal/prj/d.lst
sal/rtl/source/alloc_fini.cxx
sal/rtl/source/alloc_global.c
sal/rtl/source/makefile.mk
Diffstat (limited to 'sal/osl/w32/diagnose.c')
-rwxr-xr-x | sal/osl/w32/diagnose.c | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c index 563c8a792..93240e084 100755 --- a/sal/osl/w32/diagnose.c +++ b/sal/osl/w32/diagnose.c @@ -93,6 +93,7 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL /* get app name or NULL if unknown (don't call assert) */ LPCSTR lpszAppName = "Error"; sal_Char szMessage[512]; + char const * env = getenv( "SAL_DIAGNOSE_ABORT" ); /* format message into buffer */ szMessage[sizeof(szMessage)-1] = '\0'; /* zero terminate always */ @@ -105,40 +106,45 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL _pPrintDetailedDebugMessage( pszFileName, nLine, pszMessage ); else if ( _pPrintDebugMessage ) _pPrintDebugMessage( szMessage ); - else if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) + else { - TCHAR szBoxMessage[1024]; - int nCode; - - /* active popup window for the current thread */ - hWndParent = GetActiveWindow(); - if (hWndParent != NULL) - hWndParent = GetLastActivePopup(hWndParent); - - /* set message box flags */ - nFlags = MB_TASKMODAL | MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND; - if (hWndParent == NULL) - nFlags |= MB_SERVICE_NOTIFICATION; - - /* display the assert */ - - szBoxMessage[sizeof(szBoxMessage)-1] = 0; - _snprintf(szBoxMessage, sizeof(szBoxMessage)-1, "%s\n( Yes=Abort / No=Ignore / Cancel=Debugger )", - szMessage); - - nCode = MessageBox(hWndParent, szBoxMessage, "Assertion Failed!", nFlags); - - if (nCode == IDYES) - FatalExit(-1); - - if (nCode == IDNO) - return sal_False; /* ignore */ - - if (nCode == IDCANCEL) - return sal_True; /* will cause oslDebugBreak */ + if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) + { + TCHAR szBoxMessage[1024]; + int nCode; + + /* active popup window for the current thread */ + hWndParent = GetActiveWindow(); + if (hWndParent != NULL) + hWndParent = GetLastActivePopup(hWndParent); + + /* set message box flags */ + nFlags = MB_TASKMODAL | MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND; + if (hWndParent == NULL) + nFlags |= MB_SERVICE_NOTIFICATION; + + /* display the assert */ + + szBoxMessage[sizeof(szBoxMessage)-1] = 0; + _snprintf(szBoxMessage, sizeof(szBoxMessage)-1, "%s\n( Yes=Abort / No=Ignore / Cancel=Debugger )", + szMessage); + + nCode = MessageBox(hWndParent, szBoxMessage, "Assertion Failed!", nFlags); + + if (nCode == IDYES) + FatalExit(-1); + + if (nCode == IDNO) + return sal_False; /* ignore */ + + if (nCode == IDCANCEL) + return sal_True; /* will cause oslDebugBreak */ + } + return ( ( env != NULL ) && ( *env != '\0' ) ); } + + return sal_False; #endif /* NO_DEBUG_CRT */ - return sal_False; /* not sure, don't care */ } sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage) |