--- dbaccess/source/ui/dlg/dbwizsetup.cxx	2006-12-01 17:52:43.000000000 +0000
+++ dbaccess/source/ui/dlg/dbwizsetup.cxx	2007-05-28 10:10:03.370250000 +0000
@@ -1228,6 +1228,7 @@
             // wants us to load could be a non-database document. Instead, we asynchronously
             // open the selected document. Thus, the wizard's return value is RET_CANCEL,
             // which means to not continue loading the database document
+			putenv("UGLY_HACK_TO_FIX_N269146=HAHA");
             if ( !OWizardMachine::onFinish( RET_CANCEL ) )
                 return sal_False;
 
--- desktop/source/app/dispatchwatcher.cxx	2006-12-01 17:53:04.000000000 +0000
+++ desktop/source/app/dispatchwatcher.cxx	2007-05-28 10:25:35.526500000 +0000
@@ -489,13 +489,16 @@
 
         Reference< XElementAccess > xList( xTasksSupplier->getFrames(), UNO_QUERY );
 
-        if ( !xList->hasElements() )
+		char *hack = getenv("UGLY_HACK_TO_FIX_N269146");
+        if ( (hack == NULL || *hack == '\0') && !xList->hasElements() )
 		{
 			// We don't have any task open so we have to shutdown ourself!!
 			Reference< XDesktop > xDesktop2( xTasksSupplier, UNO_QUERY );
 			if ( xDesktop2.is() )
 				return xDesktop2->terminate();
 		}
+		if (hack != NULL)
+			putenv("UGLY_HACK_TO_FIX_N269146=");
 	}
 
 	return sal_False;
