[Libreoffice-commits] .: 2 commits - framework/source idl/source

Tor Lillqvist tml at kemper.freedesktop.org
Fri Feb 18 01:47:21 PST 2011


 framework/source/services/desktop.cxx            |   17 +++++++-
 framework/source/services/substitutepathvars.cxx |   15 ++++---
 idl/source/prj/idldll.cxx                        |   44 -----------------------
 3 files changed, 23 insertions(+), 53 deletions(-)

New commits:
commit 5d685e1a9fb38ef004ab5c5cf88645eb2698311e
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Fri Feb 18 11:43:58 2011 +0200

    Drop 16-bit Windows code

diff --git a/idl/source/prj/idldll.cxx b/idl/source/prj/idldll.cxx
index 790c001..9b5bcb4 100644
--- a/idl/source/prj/idldll.cxx
+++ b/idl/source/prj/idldll.cxx
@@ -29,48 +29,4 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_idl.hxx"
 
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// static  DLL handle
-static HINSTANCE hDLLInst = 0;      // HANDLE of the DLL
-
-
-/***************************************************************************
-|*
-|*    LibMain()
-|*
-|*    description       initializing function of the DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
-    if ( nHeap )
-        UnlockData( 0 );
-#endif
-
-    hDLLInst = hDLL;
-
-    return TRUE;
-}
-
-/***************************************************************************
-|*
-|*    WEP()
-|*
-|*    description      DLL de-initializing
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
-    return 1;
-}
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ed5fd264ee85f474dd79973f8b276189b8ae1bcc
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Wed Feb 16 09:18:28 2011 +0200

    Drop some pointless assertions

diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 9547123..dedeada 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -283,7 +283,14 @@ Desktop::Desktop( const css::uno::Reference< css::lang::XMultiServiceFactory >&
 *//*-*************************************************************************************************************/
 Desktop::~Desktop()
 {
-    LOG_ASSERT2( m_bIsTerminated                       ==sal_False, "Desktop::~Desktop()", "Who forgot to terminate the desktop service?" )
+#ifdef ENABLE_ASSERTIONS
+    // Perhaps we should here do use a real assertion, but make the
+    // condition more specific? We don't want it to fire in unit tests
+    // in sc/qa/unit for instance, that don't even have any GUI.
+    if( !m_bIsTerminated )
+        fprintf( stderr, "This used to be an assertion failure: Desktop not terminated before being destructed,\n"
+                 "but it is probably not a real problem.\n" );
+#endif
     LOG_ASSERT2( m_aTransactionManager.getWorkingMode()!=E_CLOSE  , "Desktop::~Desktop()", "Who forgot to dispose this service?"          )
 }
 
@@ -1178,8 +1185,14 @@ void SAL_CALL Desktop::dispose()
 {
     // Safe impossible cases
     // It's an programming error if dispose is called before terminate!
-    LOG_ASSERT2( m_bIsTerminated==sal_False, "Desktop::dispose()", "It's not allowed to dispose the desktop before terminate() is called!" )
 
+    // But if you just ignore the assertion (which happens in unit
+    // tests for instance in sc/qa/unit) nothing bad happens.
+#ifdef ENABLE_ASSERTIONS
+    if( !m_bIsTerminated )
+        fprintf( stderr, "This used to be an assertion failure: Desktop disposed before terminating it,\n"
+                 "but nothing bad seems to happen anyway?\n" );
+#endif
     SYNCHRONIZED_START
         WriteGuard aWriteLock( m_aLock );
     
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 9eb4112..ace5ffc 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -1188,9 +1188,9 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
     if( aState == ::utl::Bootstrap::PATH_EXISTS ) {
         aPreDefPathVariables.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal );
     }
-    else {
-        LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Bootstrap code has no value for userpath");
-    }
+    // We use to have a LOG_ERROR here in an else branch, but that
+    // always fired in some unit tests, and if you then just ignored
+    // it, nothing bad happened, so it seems fairly pointless.
 
     // Set $(inst), $(instpath), $(insturl)
     aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTURL ]	= aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ];
@@ -1222,10 +1222,11 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
     rtl::OUString aLocaleStr;
     if ( utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( utl::ConfigManager::LOCALE ) >>= aLocaleStr )
         aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
-    else
-    {
-        LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Wrong Any type for language!" );
-    }
+    // We used to have an else branch here with a LOG_ERROR, but that
+    // always fired in some unit tests when this code was built with
+    // debug=t, so it seems fairly pointless, especially as
+    // aPreDefPathVariables.m_eLanguageType has been initialized to a
+    // default value above anyway.
 
     // Set $(lang)
     aPreDefPathVariables.m_FixedVar[ PREDEFVAR_LANG ] = ConvertOSLtoUCBURL(


More information about the Libreoffice-commits mailing list