[Libreoffice-commits] core.git: 6 commits - framework/inc framework/source include/sal
Tor Lillqvist
tml at collabora.com
Sun Sep 8 13:57:43 PDT 2013
framework/inc/classes/checkediterator.hxx | 10
framework/inc/classes/filtercache.hxx | 83 ----
framework/inc/classes/wildcard.hxx | 46 --
framework/inc/helper/ocomponentaccess.hxx | 4
framework/inc/helper/ocomponentenumeration.hxx | 4
framework/inc/helper/oframes.hxx | 4
framework/inc/macros/debug.hxx | 50 ---
framework/inc/macros/debug/assertion.hxx | 216 -------------
framework/inc/macros/debug/event.hxx | 116 ------
framework/inc/macros/debug/logmechanism.hxx | 85 -----
framework/inc/services/contenthandlerfactory.hxx | 38 --
framework/inc/services/desktop.hxx | 3
framework/inc/services/frame.hxx | 4
framework/inc/services/logindialog.hxx | 28 -
framework/source/accelerators/acceleratorconfiguration.cxx | 26 -
framework/source/accelerators/storageholder.cxx | 6
framework/source/classes/framecontainer.cxx | 4
framework/source/dispatch/dispatchprovider.cxx | 2
framework/source/dispatch/menudispatcher.cxx | 50 ---
framework/source/dispatch/popupmenudispatcher.cxx | 2
framework/source/fwe/classes/addonmenu.cxx | 1
framework/source/fwe/classes/bmkmenu.cxx | 1
framework/source/fwe/classes/framelistanalyzer.cxx | 4
framework/source/fwi/classes/protocolhandlercache.cxx | 2
framework/source/fwi/jobs/configaccess.cxx | 2
framework/source/fwi/threadhelp/transactionmanager.cxx | 8
framework/source/helper/ocomponentaccess.cxx | 6
framework/source/helper/ocomponentenumeration.cxx | 8
framework/source/helper/oframes.cxx | 23 -
framework/source/jobs/job.cxx | 12
framework/source/jobs/joburl.cxx | 12
framework/source/loadenv/loadenv.cxx | 4
framework/source/services/autorecovery.cxx | 63 +--
framework/source/services/desktop.cxx | 50 ---
framework/source/services/frame.cxx | 69 ++--
framework/source/services/pathsettings.cxx | 14
framework/source/services/substitutepathvars.cxx | 2
framework/source/services/tabwindowservice.cxx | 2
framework/source/services/urltransformer.cxx | 2
framework/source/uiconfiguration/uicategorydescription.cxx | 15
framework/source/xml/acceleratorconfigurationreader.cxx | 18 -
include/sal/log-areas.dox | 3
42 files changed, 140 insertions(+), 962 deletions(-)
New commits:
commit 5bb0c9d790966fccd8d54336119714e678c87b0e
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Sep 8 23:41:20 2013 +0300
Use SAL_INFO instead of framework's own "event logging"
That "event logging" consisted of two macros, both used in a single place.
Change-Id: I8faffd9756399f1902e52aa41968b71a964a4324
diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx
index ca47bb6..2c2dd85 100644
--- a/framework/inc/macros/debug.hxx
+++ b/framework/inc/macros/debug.hxx
@@ -39,18 +39,12 @@
// => "product" (OSL_DEBUG_LEVEL == 0)
#else
- #undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG
#undef ENABLE_FILTERDBG
#endif
//*****************************************************************************************************************
-// special macros for event handling
-//*****************************************************************************************************************
-#include <macros/debug/event.hxx>
-
-//*****************************************************************************************************************
// special macros to debug service registration
//*****************************************************************************************************************
#include <macros/debug/registration.hxx>
diff --git a/framework/inc/macros/debug/event.hxx b/framework/inc/macros/debug/event.hxx
deleted file mode 100644
index 31adff5..0000000
--- a/framework/inc/macros/debug/event.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_
-
-//*************************************************************************************************************
-// special macros for event handling
-//*************************************************************************************************************
-
-#ifdef ENABLE_EVENTDEBUG
-
- #include <rtl/strbuf.hxx>
-
- /*_____________________________________________________________________________________________________________
- LOGFILE_EVENTDEBUG
-
- For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
- _____________________________________________________________________________________________________________*/
-
- #ifndef LOGFILE_EVENTDEBUG
- #define LOGFILE_EVENTDEBUG \
- "events.log"
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION )
-
- Use this macro to print debug information about sending of events to listener for controlling right order.
- ( Use new scope in macro to declare sBuffer more then on time in same "parentscope"! )
- _____________________________________________________________________________________________________________*/
-
- #define LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION ) \
- { \
- OStringBuffer sBuffer(1024); \
- sBuffer.append( "[ " ); \
- sBuffer.append( SFRAMETYPE ); \
- sBuffer.append( " ] \"" ); \
- sBuffer.append( U2B( SFRAMENAME ) ); \
- sBuffer.append( "\" send event \"" ); \
- switch( AFRAMEACTION ) \
- { \
- case ::com::sun::star::frame::FrameAction_COMPONENT_ATTACHED : sBuffer.append("COMPONENT ATTACHED" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_COMPONENT_DETACHING : sBuffer.append("COMPONENT DETACHING" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_COMPONENT_REATTACHED : sBuffer.append("COMPONENT REATTACHED" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_FRAME_ACTIVATED : sBuffer.append("FRAME ACTIVATED" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_FRAME_DEACTIVATING : sBuffer.append("FRAME DEACTIVATING" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_CONTEXT_CHANGED : sBuffer.append("CONTEXT CHANGED" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_FRAME_UI_ACTIVATED : sBuffer.append("FRAME UI ACTIVATED" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_FRAME_UI_DEACTIVATING : sBuffer.append("FRAME UI DEACTIVATING" ); \
- break; \
- case ::com::sun::star::frame::FrameAction_MAKE_FIXED_SIZE : sBuffer.append("MAKE_FIXED_SIZE" ); \
- break; \
- default: sBuffer.append("... ERROR: invalid FrameAction detected!" ); \
- break; \
- } \
- sBuffer.append( " ... event to listener.\n\n" ); \
- WRITE_LOGFILE( LOGFILE_EVENTDEBUG, sBuffer.makeStringAndClear() ) \
- }
-
- /*_____________________________________________________________________________________________________________
- LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME )
-
- These macro log information about sending of dispose events to listener.
- ( Use new scope in macro to declare sBuffer more then on time in same "parentscope"! )
- _____________________________________________________________________________________________________________*/
-
- #define LOG_DISPOSEEVENT( SFRAMETYPE, SFRAMENAME ) \
- { \
- OStringBuffer sBuffer(1024); \
- sBuffer.append( "[ " ); \
- sBuffer.append( SFRAMETYPE ); \
- sBuffer.append( " ] \"" ); \
- sBuffer.append( U2B( SFRAMENAME ) ); \
- sBuffer.append( "\" send dispose event to listener.\n\n"); \
- WRITE_LOGFILE( LOGFILE_EVENTDEBUG, sBuffer.makeStringAndClear() ) \
- }
-
-#else // #ifdef ENABLE_EVENTDEBUG
-
- /*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macros empty!
- _____________________________________________________________________________________________________________*/
-
- #undef LOGFILE_EVENTDEBUG
- #define LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION )
- #define LOG_DISPOSEEVENT( SFRAMETYPE, SFRAMENAME )
-
-#endif // #ifdef ENABLE_EVENTDEBUG
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 9cfde04..9af43fc 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1833,7 +1833,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
// May be we will die before we could finish this method ...
css::uno::Reference< css::frame::XFrame > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
- LOG_DISPOSEEVENT( "Frame", sName )
+ SAL_INFO("fwk.frame", "[Frame] " << m_sName << " send dispose event to listener");
// First operation should be ... "stopp all listening for window events on our container window".
// These events are superflous but can make trouble!
@@ -2734,7 +2734,18 @@ void Frame::implts_sendFrameActionEvent( const css::frame::FrameAction& aAction
// Log information about order of events to file!
// (only activated in debug version!)
- LOG_FRAMEACTIONEVENT( "Frame", m_sName, aAction )
+ SAL_INFO( "fwk.frame",
+ "[Frame] " << m_sName << " send event " <<
+ (aAction == css::frame::FrameAction_COMPONENT_ATTACHED ? OUString("COMPONENT ATTACHED") :
+ (aAction == css::frame::FrameAction_COMPONENT_DETACHING ? OUString("COMPONENT DETACHING") :
+ (aAction == css::frame::FrameAction_COMPONENT_REATTACHED ? OUString("COMPONENT REATTACHED") :
+ (aAction == css::frame::FrameAction_FRAME_ACTIVATED ? OUString("FRAME ACTIVATED") :
+ (aAction == css::frame::FrameAction_FRAME_DEACTIVATING ? OUString("FRAME DEACTIVATING") :
+ (aAction == css::frame::FrameAction_CONTEXT_CHANGED ? OUString("CONTEXT CHANGED") :
+ (aAction == css::frame::FrameAction_FRAME_UI_ACTIVATED ? OUString("FRAME UI ACTIVATED") :
+ (aAction == css::frame::FrameAction_FRAME_UI_DEACTIVATING ? OUString("FRAME UI DEACTIVATING") :
+ (aAction == css::frame::FrameAction_MAKE_FIXED_SIZE ? OUString("MAKE_FIXED_SIZE") :
+ OUString("*invalid*")))))))))));
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
// Send css::frame::FrameAction event to all listener.
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 36c1fbf..6589382 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -158,6 +158,7 @@ certain functionality.
@li @c fwk.autorecovery
@li @c fwk.desktop
@li @c fwk.dispatch
+ at li @c fwk.frame
@li @c fwk.joburl
@li @c fwk.loadenv
@li @c fwk.session
commit 04c3f9d18501562cb0536dee0fe89334ed7736d1
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Sep 8 23:32:57 2013 +0300
Use SAL_INFO instead of framework's own WRITE_LOGFILE
Change-Id: Ieb1a45ca75c7a475d02535cd176396a0aeb68510
diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx
index e598b51..ca47bb6 100644
--- a/framework/inc/macros/debug.hxx
+++ b/framework/inc/macros/debug.hxx
@@ -30,28 +30,15 @@
// => "personal debug code"
#if OSL_DEBUG_LEVEL > 1
- // Enable log mechanism for normal assertion and error handling.
- // Look for user decisions before!
- #ifndef ENABLE_LOGMECHANISM
- #define ENABLE_LOGMECHANISM
- #endif
-
//-----------------------------------------------------------------------------------------------------------------
// => "non product"
// NOTE
#elif OSL_DEBUG_LEVEL > 0
- // Enable log mechanism for normal assertion and error handling.
- // Look for user decisions before!
- #ifndef ENABLE_LOGMECHANISM
- #define ENABLE_LOGMECHANISM
- #endif
-
//-----------------------------------------------------------------------------------------------------------------
// => "product" (OSL_DEBUG_LEVEL == 0)
#else
- #undef ENABLE_LOGMECHANISM
#undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG
#undef ENABLE_FILTERDBG
@@ -59,12 +46,6 @@
#endif
//*****************************************************************************************************************
-// generic macros for logging
-//*****************************************************************************************************************
-
-#include <macros/debug/logmechanism.hxx>
-
-//*****************************************************************************************************************
// special macros for event handling
//*****************************************************************************************************************
#include <macros/debug/event.hxx>
diff --git a/framework/inc/macros/debug/logmechanism.hxx b/framework/inc/macros/debug/logmechanism.hxx
deleted file mode 100644
index b6ad279..0000000
--- a/framework/inc/macros/debug/logmechanism.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-
-//*****************************************************************************************************************
-// generic macros for logging
-//*****************************************************************************************************************
-
-#ifdef ENABLE_LOGMECHANISM
-
- #include <rtl/string.hxx>
- #include <stdio.h>
-
- /*_____________________________________________________________________________________________________________
- WRITE_LOGFILE( SFILENAME, STEXT )
-
- Log any information in file. We append any information at file and don't clear it anymore.
- ( Use new scope in macro to declare pFile more then on time in same "parentscope"!
- Don't control pFile before access! What will you doing if its not valid? Log an error ...
- An error and an error is an error ... )
-
- Attention: You must use "%s" and STEXT as parameter ... because otherwise encoded strings (they include e.g. %...)
- are handled wrong.
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT ) \
- { \
- OString _swriteLogfileFileName ( SFILENAME ); \
- OString _swriteLogfileText ( STEXT ); \
- FILE* pFile = fopen( _swriteLogfileFileName.getStr(), "a" ); \
- fprintf( pFile, "%s", _swriteLogfileText.getStr() ); \
- fclose ( pFile ); \
- }
-
- /*_____________________________________________________________________________________________________________
- LOGTYPE
-
- For other debug macros we need information about the output mode. If user forget to set this information we
- do it for him. Valid values are: LOGTYPE_FILECONTINUE
- LOGTYPE_FILEEXIT
- LOGTYPE_MESSAGEBOX
- The normal case is LOGTYPE_MESSAGEBOX to show assertions in normal manner!
- _____________________________________________________________________________________________________________*/
-
- #define LOGTYPE_MESSAGEBOX 1
- #define LOGTYPE_FILECONTINUE 2
- #define LOGTYPE_FILEEXIT 3
-
- #ifndef LOGTYPE
- #define LOGTYPE \
- LOGTYPE_MESSAGEBOX
- #endif
-
-#else // #ifdef ENABLE_LOGMECHANISM
-
- /*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macro empty!
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT )
- #undef LOGTYPE
-
-#endif // #ifdef ENABLE_LOGMECHANISM
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx
index 2987461..8e48e7b 100644
--- a/framework/source/jobs/joburl.cxx
+++ b/framework/source/jobs/joburl.cxx
@@ -490,8 +490,7 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL ,
OUStringBuffer sMsg(256);
- sMsg.appendAscii("\"" );
- sMsg.append (sURL );
+ sMsg.append(sURL);
sMsg.appendAscii("\" ");
if (bOK)
@@ -500,8 +499,8 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL ,
}
else
{
- sMsg.appendAscii("... failed\n");
- sMsg.appendAscii("expected was: ");
+ sMsg.appendAscii("... failed. ");
+ sMsg.appendAscii("Expected: ");
if (eExpectedPart==E_UNKNOWN)
sMsg.appendAscii("E_UNKNOWN");
if ((eExpectedPart & E_EVENT) == E_EVENT)
@@ -522,12 +521,11 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL ,
sMsg.appendAscii(pExpectedService );
sMsg.appendAscii("\"" );
}
- sMsg.appendAscii("\tbut it was : " );
+ sMsg.appendAscii(", Actual: " );
sMsg.append (aURL.impldbg_toString());
- sMsg.appendAscii("\n" );
}
- WRITE_LOGFILE(LOGFILE_JOBURL, U2B(sMsg.makeStringAndClear()))
+ SAL_INFO("fwk.joburl", OUString(sMsg));
}
//________________________________
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 3d3c2dc..237c0db 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -218,22 +218,6 @@ static const sal_Int32 GIVE_UP_RETRY = 1; // in
// #define SIMULATE_FULL_DISC
//-----------------------------------------------
-// #define ENABLE_RECOVERY_LOGGING
-#undef ENABLE_RECOVERY_LOGGING
-#ifdef ENABLE_RECOVERY_LOGGING
- #define LOGFILE_RECOVERY "recovery.log"
-
- #define LOG_RECOVERY(MSG) \
- { \
- WRITE_LOGFILE(LOGFILE_RECOVERY, MSG) \
- WRITE_LOGFILE(LOGFILE_RECOVERY, "\n") \
- }
-#else
- #undef LOGFILE_RECOVERY
- #define LOG_RECOVERY(MSG)
-#endif
-
-//-----------------------------------------------
class CacheLockGuard
{
private:
@@ -470,8 +454,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
throw(css::uno::RuntimeException)
{
- LOG_RECOVERY("AutoRecovery::dispatch() starts ...")
- LOG_RECOVERY(U2B(aURL.Complete).getStr())
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::dispatch() starts ..." << OUString(aURL.Complete));
// valid request ?
sal_Int32 eNewJob = AutoRecovery::implst_classifyJob(aURL);
@@ -488,7 +471,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
((m_eJob & AutoRecovery::E_AUTO_SAVE ) != AutoRecovery::E_AUTO_SAVE)
)
{
- SAL_INFO("fwk", "AutoRecovery::dispatch(): There is already an asynchronous dispatch() running. New request will be ignored!");
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::dispatch(): There is already an asynchronous dispatch() running. New request will be ignored!");
return;
}
@@ -599,7 +582,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY ) != AutoRecovery::E_DISABLE_AUTORECOVERY )
)
{
- LOG_RECOVERY("... prepare emergency save ...")
+ SAL_INFO("fwk.autorecovery", "... prepare emergency save ...");
bAllowAutoSaveReactivation = sal_False;
implts_prepareEmergencySave();
}
@@ -609,7 +592,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY)
)
{
- LOG_RECOVERY("... do emergency save ...")
+ SAL_INFO("fwk.autorecovery", "... do emergency save ...");
bAllowAutoSaveReactivation = sal_False;
implts_doEmergencySave(aParams);
}
@@ -619,7 +602,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY)
)
{
- LOG_RECOVERY("... do recovery ...")
+ SAL_INFO("fwk.autorecovery", "... do recovery ...");
implts_doRecovery(aParams);
}
else
@@ -628,7 +611,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY)
)
{
- LOG_RECOVERY("... do session save ...")
+ SAL_INFO("fwk.autorecovery", "... do session save ...");
bAllowAutoSaveReactivation = sal_False;
implts_doSessionSave(aParams);
}
@@ -638,7 +621,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY)
)
{
- LOG_RECOVERY("... do session quiet quit ...")
+ SAL_INFO("fwk.autorecovery", "... do session quiet quit ...");
bAllowAutoSaveReactivation = sal_False;
implts_doSessionQuietQuit(aParams);
}
@@ -648,7 +631,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY)
)
{
- LOG_RECOVERY("... do session restore ...")
+ SAL_INFO("fwk.autorecovery", "... do session restore ...");
implts_doSessionRestore(aParams);
}
else
@@ -2037,7 +2020,7 @@ void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo)
//-----------------------------------------------
void AutoRecovery::implts_prepareSessionShutdown()
{
- LOG_RECOVERY("AutoRecovery::implts_prepareSessionShutdown() starts ...")
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::implts_prepareSessionShutdown() starts ...");
// a) reset modified documents (of course the must be saved before this method is called!)
// b) close it without showing any UI!
@@ -3040,7 +3023,7 @@ void AutoRecovery::implts_doRecovery(const DispatchParams& aParams)
//-----------------------------------------------
void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams)
{
- LOG_RECOVERY("AutoRecovery::implts_doSessionSave()")
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::implts_doSessionSave()");
// Be sure to know all open documents realy .-)
implts_verifyCacheAgainstDesktopDocumentList();
@@ -3079,7 +3062,7 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams)
//-----------------------------------------------
void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/)
{
- LOG_RECOVERY("AutoRecovery::implts_doSessionQuietQuit()")
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::implts_doSessionQuietQuit()");
// try to make sure next time office will be started user wont be
// notified about any other might be running office instance
@@ -3111,7 +3094,7 @@ void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/)
//-----------------------------------------------
void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams)
{
- LOG_RECOVERY("AutoRecovery::implts_doSessionRestore() ...")
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::implts_doSessionRestore() ...");
AutoRecovery::ETimerType eSuggestedTimer = AutoRecovery::E_DONT_START_TIMER;
do
@@ -3131,7 +3114,7 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams)
implts_changeAllDocVisibility(sal_True);
// Reset the configuration hint for "session save"!
- LOG_RECOVERY("... reset config key 'SessionData'")
+ SAL_INFO("fwk.autorecovery", "... reset config key 'SessionData'");
::comphelper::ConfigurationHelper::writeDirectKey(
m_xContext,
OUString(CFG_PACKAGE_RECOVERY),
@@ -3140,7 +3123,7 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams)
css::uno::makeAny(sal_False),
::comphelper::ConfigurationHelper::E_STANDARD);
- LOG_RECOVERY("... AutoRecovery::implts_doSessionRestore()")
+ SAL_INFO("fwk.autorecovery", "... AutoRecovery::implts_doSessionRestore()");
}
//-----------------------------------------------
@@ -3358,7 +3341,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL AutoRecovery::getPr
//-----------------------------------------------
void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()
{
- LOG_RECOVERY("AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() ...")
+ SAL_INFO("fwk.autorecovery", "AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() ...");
// SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
@@ -3432,7 +3415,7 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()
{
}
- LOG_RECOVERY("... AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()")
+ SAL_INFO("fwk.autorecovery", "... AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()");
}
//-----------------------------------------------
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 3d08cf1..36c1fbf 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -155,8 +155,10 @@ certain functionality.
@li @c fwk - framework (abbreviation)
@li @c fwk.accelerators
+ at li @c fwk.autorecovery
@li @c fwk.desktop
@li @c fwk.dispatch
+ at li @c fwk.joburl
@li @c fwk.loadenv
@li @c fwk.session
@li @c fwk.uielement
commit 9a8e2d09bc2111371f149498481dd422b86f9b68
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Sep 8 23:00:27 2013 +0300
Use SAL_WARN_IF instead of framework's home-grown LOG_ASSERT(2)
Also remove declarations for debug function that don't exist (have been
removed (misguidedly?) as unused perhaps).
Change-Id: I0bc3320c52b3d50dc851a07fdc30b593cc4856b1
diff --git a/framework/inc/classes/checkediterator.hxx b/framework/inc/classes/checkediterator.hxx
index 637c5c6..be73d21 100644
--- a/framework/inc/classes/checkediterator.hxx
+++ b/framework/inc/classes/checkediterator.hxx
@@ -100,8 +100,8 @@ class CheckedIterator
inline void initialize( const TContainer& rContainer )
{
// Check incoming parameter. We don't accept all!
- LOG_ASSERT2( &rContainer==NULL , "CheckedIterator::initialize()", "Invalid parameter detected!" )
- LOG_ASSERT2( m_eEndState!=E_UNKNOWN , "CheckedIterator::initialize()", "Instance already initialized! Don't do it again." )
+ SAL_WARN_IF( &rContainer==NULL, "fwk", "CheckedIterator::initialize(): Invalid parameter detected!" );
+ SAL_WARN_IF( m_eEndState!=E_UNKNOWN, "fwk", "CheckedIterator::initialize(): Instance already initialized! Don't do it again." );
if( m_eEndState == E_UNKNOWN )
{
@@ -187,7 +187,7 @@ class CheckedIterator
inline CheckedIterator& operator++()
{
// Warn programmer if he forget to initailize object!
- LOG_ASSERT2( m_pContainer==NULL, "CheckedIterator::operator++()", "Object not initialized!" )
+ SAL_WARN_IF( m_pContainer==NULL, "fwk", "CheckedIterator::operator++(): Object not initialized!" );
// Step to next element if any exist or set our end states.
switch( m_eEndState )
{
@@ -280,9 +280,9 @@ class CheckedIterator
inline typename TContainer::const_iterator getEntry()
{
// Warn programmer if he forget to initialize these object ...
- LOG_ASSERT2( m_pContainer==NULL, "CheckedIterator::getEntry()", "Object not initialized!" )
+ SAL_WARN_IF( m_pContainer==NULL, "fwk", "CheckedIterator::getEntry(): Object not initialized!" );
// or try to read a non existing element!
- LOG_ASSERT2( m_eEndState!=E_BEFOREEND, "CheckedIterator::getEntry()", "Wrong using of class detected!" )
+ SAL_WARN_IF( m_eEndState!=E_BEFOREEND, "fwk", "CheckedIterator::getEntry(): Wrong using of class detected!" );
return m_pPosition;
}
diff --git a/framework/inc/classes/filtercache.hxx b/framework/inc/classes/filtercache.hxx
index 63cc216..7bc7313 100644
--- a/framework/inc/classes/filtercache.hxx
+++ b/framework/inc/classes/filtercache.hxx
@@ -314,89 +314,6 @@ class FilterCache : private ThreadHelpBase
sal_Bool validateAndRepairHandler();
//-------------------------------------------------------------------------------------------------------------
- // protected methods
- //-------------------------------------------------------------------------------------------------------------
-
- protected:
-
- //-------------------------------------------------------------------------------------------------------------
- // private methods
- //-------------------------------------------------------------------------------------------------------------
-
- private:
-
- //-------------------------------------------------------------------------------------------------------------
- // debug methods
- //-------------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @seealso ASSERT in implementation!
-
- @param references to checking variables
- @return sal_False ,on invalid parameter
- @return sal_True ,otherwise
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_ASSERTIONS
-
- private:
-
- static sal_Bool implcp_searchType ( const OUString& sURL ,
- const OUString* pMediaType ,
- const OUString* pClipboardFormat ,
- const CheckedTypeIterator& aStartEntry ,
- const OUString& sResult );
- static sal_Bool implcp_searchFilterForType ( const OUString& sInternalTypeName ,
- const CheckedStringListIterator& aStartEntry ,
- const OUString& sResult );
- static sal_Bool implcp_searchDetectorForType ( const OUString& sInternalTypeName ,
- const CheckedStringListIterator& aStartEntry ,
- const OUString& sResult );
- static sal_Bool implcp_searchLoaderForType ( const OUString& sInternalTypeName ,
- const CheckedStringListIterator& aStartEntry ,
- const OUString& sResult );
- static sal_Bool implcp_searchContentHandlerForType ( const OUString& sInternalTypeName ,
- const CheckedStringListIterator& aStartEntry ,
- const OUString& sResult );
- static sal_Bool implcp_getTypeProperties ( const OUString& sName );
- static sal_Bool implcp_getFilterProperties ( const OUString& sName );
- static sal_Bool implcp_getDetectorProperties ( const OUString& sName );
- static sal_Bool implcp_getLoaderProperties ( const OUString& sName );
- static sal_Bool implcp_getContentHandlerProperties ( const OUString& sName );
- static sal_Bool implcp_getType ( const OUString& sName );
- static sal_Bool implcp_getFilter ( const OUString& sName );
- static sal_Bool implcp_getDetector ( const OUString& sName );
- static sal_Bool implcp_getLoader ( const OUString& sName );
- static sal_Bool implcp_getContentHandler ( const OUString& sName );
- static sal_Bool implcp_existsType ( const OUString& sName );
- static sal_Bool implcp_existsFilter ( const OUString& sName );
- static sal_Bool implcp_existsDetector ( const OUString& sName );
- static sal_Bool implcp_existsLoader ( const OUString& sName );
- static sal_Bool implcp_existsContentHandler ( const OUString& sName );
- static sal_Bool implcp_addFilter ( const OUString& sName ,
- const css::uno::Sequence< css::beans::PropertyValue >& lProperties );
- static sal_Bool implcp_replaceFilter ( const OUString& sName ,
- const css::uno::Sequence< css::beans::PropertyValue >& lProperties );
- static sal_Bool implcp_removeFilter ( const OUString& sName );
- static sal_Bool implcp_queryFilters ( const OUString& sQuery );
-
- #endif // #ifdef ENABLE_ASSERTIONS
-
- #ifdef ENABLE_COMPONENT_SELF_CHECK
-
- private:
-
- void impldbg_dumpCache();
-
- #endif // ENABLE_COMPONENT_SELF_CHECK
-
- //-------------------------------------------------------------------------------------------------------------
// private variables
//-------------------------------------------------------------------------------------------------------------
private:
diff --git a/framework/inc/classes/wildcard.hxx b/framework/inc/classes/wildcard.hxx
index 212d502..24cd078 100644
--- a/framework/inc/classes/wildcard.hxx
+++ b/framework/inc/classes/wildcard.hxx
@@ -100,52 +100,6 @@ class Wildcard
static sal_Bool match( const OUString& sText ,
const OUString& sPattern );
- //---------------------------------------------------------------------------------------------------------
- // debug and test methods
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-methods to check incoming parameter of some other mehods of this class
- @descr The follow methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
- This mechanism is active in debug version only!
-
- @seealso FRAMEWORK_ASSERT in implementation!
-
- @param references to checking variables
- @return sal_False on invalid parameter
- @return sal_True otherwise
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_ASSERTIONS
-
- static sal_Bool impldbg_checkParameter_match( const OUString& sText ,
- const OUString& sPattern );
-
- #endif // #ifdef ENABLE_ASSERTIONS
-
- /*-****************************************************************************************************//**
- @short test implementation of match() with different examples
- @descr If TESTMODE activated, you cann call these method to start and log some special examples.
- Do this if you have changed the implementation of method match() to test it.
-
- @seealso -
-
- @param -
- @return -
-
- @onerror Error-conditions are written to file or show in a messagebox.
- Thhat depends from current setting of ASSERT_OUTPUTTYPE. (see debug.hxx for further information.)
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_CLASSDEBUG
-
- void impldbg_testWildcard();
-
- #endif // #ifdef ENABLE_CLASSDEBUG
-
}; // class Wildcard
} // namespace framework
diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx
index 669abaf..ee3dbd8 100644
--- a/framework/inc/helper/ocomponentaccess.hxx
+++ b/framework/inc/helper/ocomponentaccess.hxx
@@ -221,14 +221,10 @@ class OComponentAccess : private ThreadHelpBase , // M
@onerror -
*//*-*****************************************************************************************************/
- #ifdef ENABLE_ASSERTIONS
-
private:
static sal_Bool impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< css::frame::XDesktop >& xOwner );
- #endif // #ifdef ENABLE_ASSERTIONS
-
//-------------------------------------------------------------------------------------------------------------
// variables
// (should be private everyway!)
diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx
index 84a9626..1284689 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -204,15 +204,11 @@ class OComponentEnumeration : public ThreadHelpBase ,
@onerror -
*//*-*****************************************************************************************************/
- #ifdef ENABLE_ASSERTIONS
-
private:
static sal_Bool impldbg_checkParameter_OComponentEnumerationCtor ( const css::uno::Sequence< css::uno::Reference< css::lang::XComponent > >& seqComponents );
static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aEvent );
- #endif // #ifdef ENABLE_ASSERTIONS
-
//-------------------------------------------------------------------------------------------------------------
// variables
// (should be private everyway!)
diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx
index 62ebac4..537a793 100644
--- a/framework/inc/helper/oframes.hxx
+++ b/framework/inc/helper/oframes.hxx
@@ -255,8 +255,6 @@ class OFrames : private ThreadHelpBase , // Must be the first of base
@onerror -
*//*-*****************************************************************************************************/
- #ifdef ENABLE_ASSERTIONS
-
private:
static sal_Bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::frame::XFrame >& xOwner ,
FrameContainer* pFrameContainer );
@@ -264,8 +262,6 @@ class OFrames : private ThreadHelpBase , // Must be the first of base
static sal_Bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame );
static sal_Bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags );
- #endif // #ifdef ENABLE_ASSERTIONS
-
// variables
// (should be private everyway!)
diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx
index de3d07a..e598b51 100644
--- a/framework/inc/macros/debug.hxx
+++ b/framework/inc/macros/debug.hxx
@@ -35,12 +35,6 @@
#ifndef ENABLE_LOGMECHANISM
#define ENABLE_LOGMECHANISM
#endif
- // Enable assertion handling himself AND additional warnings.
- // The default logtype is MESSAGEBOX.
- // see "assertion.hxx" for further information
- #ifndef ENABLE_ASSERTIONS
- #define ENABLE_ASSERTIONS
- #endif
//-----------------------------------------------------------------------------------------------------------------
// => "non product"
@@ -52,23 +46,14 @@
#ifndef ENABLE_LOGMECHANISM
#define ENABLE_LOGMECHANISM
#endif
- // Enable assertion handling himself.
- // The default logtype is MESSAGEBOX.
- // see "assertion.hxx" for further information
- #ifndef ENABLE_ASSERTIONS
- #define ENABLE_ASSERTIONS
- #endif
//-----------------------------------------------------------------------------------------------------------------
// => "product" (OSL_DEBUG_LEVEL == 0)
#else
#undef ENABLE_LOGMECHANISM
- #undef ENABLE_ASSERTIONS
#undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG
-// #undef ENABLE_TIMEMEASURE
- #undef ENABLE_MEMORYMEASURE
#undef ENABLE_FILTERDBG
#endif
@@ -80,11 +65,6 @@
#include <macros/debug/logmechanism.hxx>
//*****************************************************************************************************************
-// special macros for assertion handling
-//*****************************************************************************************************************
-#include <macros/debug/assertion.hxx>
-
-//*****************************************************************************************************************
// special macros for event handling
//*****************************************************************************************************************
#include <macros/debug/event.hxx>
diff --git a/framework/inc/macros/debug/assertion.hxx b/framework/inc/macros/debug/assertion.hxx
deleted file mode 100644
index 75cafcc..0000000
--- a/framework/inc/macros/debug/assertion.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_ASSERTION_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_ASSERTION_HXX_
-
-#if defined( ENABLE_ASSERTIONS )
-
- #include <osl/diagnose.h>
- #include <rtl/strbuf.hxx>
-
-#endif
-
-//*****************************************************************************************************************
-// special macros for assertion handling
-// 1) LOGTYPE use it to define the output of all assertions, errors, exception infos
-// 2) LOGFILE_ASSERTIONS use it to define the file name to log assertions if LOGTYPE=LOGTYPE_FILE...
-// active for "non product":
-// 4) LOG_ASSERT( BCONDITION, STEXT ) assert some critical errors which depend from given condition
-// 4a) LOG_ASSERT2( BCONDITION, SMETHOD, STEXT ) same like 4) + additional location of error
-// 5) LOG_ERROR( SMETHOD, STEXT ) show errors without any condition
-// active for debug only!
-//*****************************************************************************************************************
-
-//_________________________________________________________________________________________________________________
-#if defined( ENABLE_ASSERTIONS )
-
- /*_____________________________________________________________________________________________________________
- LOGFILE_ASSERTIONS
-
- For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
- _____________________________________________________________________________________________________________*/
-
- #ifndef LOGFILE_ASSERTIONS
- #define LOGFILE_ASSERTIONS "_framework_assertions.log"
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_ASSERT ( BCONDITION, STEXT )
- LOG_ASSERT2( BCONDITION, SMETHOD, STEXT )
-
- Forward assertion to logfile (if condition is sal_False - like a DBG_ASSERT!) and continue with program.
- Set LOGTYPE to LOGTYPE_FILECONTINUE to do this.
- BCONDITION is inserted in "(...)" because user can call this macro with an complex expression!
- _____________________________________________________________________________________________________________*/
- #if LOGTYPE==LOGTYPE_FILECONTINUE
-
- #define LOG_ASSERT( BCONDITION, STEXT ) \
- if ( ( BCONDITION ) == sal_False ) \
- { \
- WRITE_LOGFILE( LOGFILE_ASSERTIONS, STEXT ) \
- }
-
- #define LOG_ASSERT2( BCONDITION, SMETHOD, STEXT ) \
- if ( ( BCONDITION ) == sal_True ) \
- { \
- OStringBuffer _sAssertBuffer( 256 ); \
- _sAssertBuffer.append( "ASSERT:\n\t" ); \
- _sAssertBuffer.append( SMETHOD ); \
- _sAssertBuffer.append( "\n\t\"" ); \
- _sAssertBuffer.append( STEXT ); \
- _sAssertBuffer.append( "\"\n" ); \
- WRITE_LOGFILE( LOGFILE_ASSERTIONS, _sAssertBuffer.getStr() ) \
- }
-
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_ASSERT ( BCONDITION, STEXT )
- LOG_ASSERT2( BCONDITION, SMETHOD, STEXT )
-
- Forward assertion to file and exit the program.
- Set LOGTYPE to LOGTYPE_FILEEXIT to do this.
- BCONDITION is inserted in "(...)" because user can call this macro with an complex expression!
- _____________________________________________________________________________________________________________*/
- #if LOGTYPE==LOGTYPE_FILEEXIT
-
- #define LOG_ASSERT( BCONDITION, STEXT ) \
- if ( ( BCONDITION ) == sal_False ) \
- { \
- WRITE_LOGFILE( LOGFILE_ASSERTIONS, STEXT ) \
- exit(-1); \
- }
-
- #define LOG_ASSERT2( BCONDITION, SMETHODE, STEXT ) \
- if ( ( BCONDITION ) == sal_True ) \
- { \
- OStringBuffer _sAssertBuffer( 256 ); \
- _sAssertBuffer.append( "ASSERT:\n\t" ); \
- _sAssertBuffer.append( SMETHOD ); \
- _sAssertBuffer.append( "\n\t\"" ); \
- _sAssertBuffer.append( STEXT ); \
- _sAssertBuffer.append( "\"\n" ); \
- WRITE_LOGFILE( LOGFILE_ASSERTIONS, _sAssertBuffer.getStr() ) \
- exit(-1); \
- }
-
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_ASSERT ( BCONDITION, STEXT )
- LOG_ASSERT2( BCONDITION, SMETHOD, STEXT )
-
- Forward assertions to messagebox. (We use OSL_ENSURE to do this.)
- Set LOGTYPE to LOGTYPE_MESSAGEBOX to do this.
- BCONDITION is inserted in "(...)" because user can call this macro with an complex expression!
- _____________________________________________________________________________________________________________*/
- #if LOGTYPE==LOGTYPE_MESSAGEBOX
-
- #define LOG_ASSERT( BCONDITION, STEXT ) \
- OSL_ENSURE( ( BCONDITION ), STEXT );
-
- #define LOG_ASSERT2( BCONDITION, SMETHOD, STEXT ) \
- { \
- OStringBuffer _sAssertBuffer( 256 ); \
- _sAssertBuffer.append( "ASSERT:\n\t" ); \
- _sAssertBuffer.append( SMETHOD ); \
- _sAssertBuffer.append( "\n\t\"" ); \
- _sAssertBuffer.append( STEXT ); \
- _sAssertBuffer.append( "\"\n" ); \
- OSL_ENSURE( !( BCONDITION ), _sAssertBuffer.getStr() ); \
- }
-
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_ERROR( SMETHOD, STEXT )
-
- Show an error by using current set output mode by define LOGTYPE!
- _____________________________________________________________________________________________________________*/
-
- #define LOG_ERROR( SMETHOD, STEXT ) \
- LOG_ASSERT2( sal_True, SMETHOD, STEXT )
-
-#else
-
- // If right testmode is'nt set - implements these macros empty!
- #undef LOGFILE_ASSERTIONS
- #define LOG_ASSERT( BCONDITION, STEXT )
- #define LOG_ASSERT2( BCONDITION, SMETHOD, STEXT )
- #define LOG_ERROR( SMETHOD, STEXT )
-
-#endif // ENABLE_ASSERTIONS
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_ASSERTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/services/contenthandlerfactory.hxx b/framework/inc/services/contenthandlerfactory.hxx
index 0bb9bda..3c71f84 100644
--- a/framework/inc/services/contenthandlerfactory.hxx
+++ b/framework/inc/services/contenthandlerfactory.hxx
@@ -154,44 +154,6 @@ class ContentHandlerFactory : // interfaces
virtual void SAL_CALL removeFlushListener( const css::uno::Reference< css::util::XFlushListener >& xListener ) throw ( css::uno::RuntimeException );
//-------------------------------------------------------------------------------------------------------------
- // protected methods
- //-------------------------------------------------------------------------------------------------------------
-
- protected:
-
- //-------------------------------------------------------------------------------------------------------------
- // debug methods
- // (should be private everyway!)
- //-------------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @seealso ASSERTs in implementation!
-
- @param references to checking variables
- @return sal_False ,on invalid parameter
- @return sal_True ,otherwise
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_ASSERTIONS
-
- private:
-
- static sal_Bool implcp_ContentHandlerFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
- static sal_Bool implcp_createInstanceWithArguments ( const OUString& sTypeName ,
- const css::uno::Sequence< css::uno::Any >& lArguments );
- static sal_Bool implcp_getByName ( const OUString& sName );
- static sal_Bool implcp_hasByName ( const OUString& sName );
- static sal_Bool implcp_removeByName ( const OUString& sHandlerName );
-
- #endif // #ifdef ENABLE_ASSERTIONS
-
- //-------------------------------------------------------------------------------------------------------------
// private variables
// (should be private everyway!)
//-------------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx
index 546596a..a912be7 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -408,7 +408,6 @@ class Desktop : // base classes
// debug methods
// (should be private everytime!)
//-------------------------------------------------------------------------------------------------------------
- #ifdef ENABLE_ASSERTIONS
private:
static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xFactory );
@@ -418,8 +417,6 @@ class Desktop : // base classes
sal_Bool m_bIsTerminated ; /// check flag to protect us against dispose before terminate!
/// see dispose() for further information!
- #endif // #ifdef ENABLE_ASSERTIONS
-
//-------------------------------------------------------------------------------------------------------------
// variables
// (should be private everytime!)
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx
index 7de5456..fb51a98 100644
--- a/framework/inc/services/frame.hxx
+++ b/framework/inc/services/frame.hxx
@@ -361,8 +361,6 @@ class Frame : // interfaces
@onerror We return sal_True
*//*-*****************************************************************************************************/
- #ifdef ENABLE_ASSERTIONS
-
private:
static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xContext );
@@ -377,8 +375,6 @@ class Frame : // interfaces
static sal_Bool implcp_windowDeactivated ( const css::lang::EventObject& aEvent );
static sal_Bool implcp_disposing ( const css::lang::EventObject& aEvent );
- #endif // #ifdef ENABLE_ASSERTIONS
-
//*************************************************************************************************************
// variables
// -threadsafe by own read/write lock "m_aLock"
diff --git a/framework/inc/services/logindialog.hxx b/framework/inc/services/logindialog.hxx
index f5a6575..3c38895 100644
--- a/framework/inc/services/logindialog.hxx
+++ b/framework/inc/services/logindialog.hxx
@@ -729,34 +729,6 @@ class LoginDialog : public css::lang::XTypeProvider ,
OUString impl_readDialog ( );
//-------------------------------------------------------------------------------------------------------------
- // debug methods
- // (should be private everyway!)
- //-------------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @seealso ASSERTs in implementation!
-
- @param references to checking variables
- @return sal_False on invalid parameter<BR>
- sal_True otherway
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_ASSERTIONS
-
- private:
-
- sal_Bool impldbg_checkParameter_LoginDialog ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
- sal_Bool impldbg_checkParameter_setTitle ( const OUString& sTitle );
-
- #endif // #ifdef ENABLE_ASSERTIONS
-
- //-------------------------------------------------------------------------------------------------------------
// variables
// (should be private everyway!)
//-------------------------------------------------------------------------------------------------------------
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 546fc66..387451e 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -94,7 +94,7 @@ XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration(const css::un
//-----------------------------------------------
XMLBasedAcceleratorConfiguration::~XMLBasedAcceleratorConfiguration()
{
- LOG_ASSERT(!m_pWriteCache, "XMLBasedAcceleratorConfiguration::~XMLBasedAcceleratorConfiguration()\nChanges not flushed. Ignore it ...")
+ SAL_WARN_IF(m_pWriteCache, "fwk", "XMLBasedAcceleratorConfiguration::~XMLBasedAcceleratorConfiguration(): Changes not flushed. Ignore it ...");
}
//-----------------------------------------------
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index b10ed33..4fdddda 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -510,7 +510,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_searchProt
if (xInit.is())
{
css::uno::Reference< css::frame::XFrame > xOwner( m_xFrame.get(), css::uno::UNO_QUERY );
- LOG_ASSERT(xOwner.is(), "DispatchProvider::implts_searchProtocolHandler()\nCouldn't get reference to my owner frame. So I can't set may needed context information for this protocol handler.")
+ SAL_WARN_IF(!xOwner.is(), "fwk", "DispatchProvider::implts_searchProtocolHandler(): Couldn't get reference to my owner frame. So I can't set may needed context information for this protocol handler.");
if (xOwner.is())
{
try
diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index 0f01e23..751487a 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -58,35 +58,12 @@ using namespace ::cppu ;
const sal_uInt16 SLOTID_MDIWINDOWLIST = 5610;
-//-------------------------------------------------------------------------------------------------------------
-// debug methods
-// (should be private everyway!)
-//-------------------------------------------------------------------------------------------------------------
-
-/*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @seealso ASSERTs in implementation!
-
- @param css::uno::References to checking variables
- @return sal_False on invalid parameter<BR>
- sal_True otherway
-
- @onerror -
-*//*-*****************************************************************************************************/
-
-#ifdef ENABLE_ASSERTIONS
-
static sal_Bool impldbg_checkParameter_MenuDispatcher ( const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xOwner );
static sal_Bool impldbg_checkParameter_addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
const css::util::URL& aURL );
static sal_Bool impldbg_checkParameter_removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
const css::util::URL& aURL );
-#endif // #ifdef ENABLE_ASSERTIONS
-
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
@@ -104,7 +81,7 @@ MenuDispatcher::MenuDispatcher( const uno::Reference< XComponentContext >&
{
// Safe impossible cases
// We need valid information about our owner for work.
- LOG_ASSERT( impldbg_checkParameter_MenuDispatcher( xContext, xOwner ), "MenuDispatcher::MenuDispatcher()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_MenuDispatcher( xContext, xOwner ), "fwk", "MenuDispatcher::MenuDispatcher()\nInvalid parameter detected!" );
m_bActivateListener = sal_True;
xOwner->addFrameActionListener( uno::Reference< XFrameActionListener >( (OWeakObject *)this, UNO_QUERY ));
@@ -138,7 +115,7 @@ void SAL_CALL MenuDispatcher::addStatusListener( const uno::Reference< XStat
ResetableGuard aGuard( m_aLock );
// Safe impossible cases
// Method not defined for all incoming parameter
- LOG_ASSERT( impldbg_checkParameter_addStatusListener( xControl, aURL ), "MenuDispatcher::addStatusListener()\nInvalid parameter detected.\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_addStatusListener( xControl, aURL ), "fwk", "MenuDispatcher::addStatusListener(): Invalid parameter detected." );
// Add listener to container.
m_aListenerContainer.addInterface( aURL.Complete, xControl );
}
@@ -153,7 +130,7 @@ void SAL_CALL MenuDispatcher::removeStatusListener( const uno::Reference< X
ResetableGuard aGuard( m_aLock );
// Safe impossible cases
// Method not defined for all incoming parameter
- LOG_ASSERT( impldbg_checkParameter_removeStatusListener( xControl, aURL ), "MenuDispatcher::removeStatusListener()\nInvalid parameter detected.\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_removeStatusListener( xControl, aURL ), "fwk", "MenuDispatcher::removeStatusListener(): Invalid parameter detected." );
// Add listener to container.
m_aListenerContainer.removeInterface( aURL.Complete, xControl );
}
@@ -205,7 +182,7 @@ void SAL_CALL MenuDispatcher::disposing( const EventObject& ) throw( RuntimeExce
// Ready for multithreading
ResetableGuard aGuard( m_aLock );
// Safe impossible cases
- LOG_ASSERT( !(m_bAlreadyDisposed==sal_True), "MenuDispatcher::disposing()\nObject already disposed .. don't call it again!\n" )
+ SAL_WARN_IF( m_bAlreadyDisposed, "fwk", "MenuDispatcher::disposing(): Object already disposed .. don't call it again!" );
if( m_bAlreadyDisposed == sal_False )
{
@@ -334,23 +311,6 @@ sal_Bool MenuDispatcher::impl_setMenuBar( MenuBar* pMenuBar, sal_Bool bMenuFromR
return sal_False;
}
-//_________________________________________________________________________________________________________________
-// debug methods
-//_________________________________________________________________________________________________________________
-
-/*-----------------------------------------------------------------------------------------------------------------
- The follow methods checks the parameter for other functions. If a parameter or his value is non valid,
- we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT!
-
- ATTENTION
-
- If you miss a test for one of this parameters, contact the autor or add it himself !(?)
- But ... look for right testing! See using of this methods!
------------------------------------------------------------------------------------------------------------------*/
-
-#ifdef ENABLE_ASSERTIONS
-
-//*****************************************************************************************************************
static sal_Bool impldbg_checkParameter_MenuDispatcher( const uno::Reference< XComponentContext >& xContext ,
const uno::Reference< XFrame >& xOwner )
{
@@ -412,8 +372,6 @@ static sal_Bool impldbg_checkParameter_removeStatusListener( const uno::Refer
return bOK ;
}
-#endif // #ifdef ENABLE_ASSERTIONS
-
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 2503636..c30629d 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -329,7 +329,7 @@ SAL_CALL PopupMenuDispatcher::disposing( const EventObject& ) throw( RuntimeExce
// Ready for multithreading
ResetableGuard aGuard( m_aLock );
// Safe impossible cases
- LOG_ASSERT( !(m_bAlreadyDisposed==sal_True), "MenuDispatcher::disposing()\nObject already disposed .. don't call it again!\n" )
+ SAL_WARN_IF( m_bAlreadyDisposed, "fwk", "MenuDispatcher::disposing(): Object already disposed .. don't call it again!" );
if( m_bAlreadyDisposed == sal_False )
{
diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx
index 871bfca..9a7af5c2 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -20,7 +20,6 @@
#include "framework/addonmenu.hxx"
#include "framework/addonsoptions.hxx"
#include <general.h>
-#include <macros/debug/assertion.hxx>
#include <framework/imageproducer.hxx>
#include <framework/menuconfiguration.hxx>
diff --git a/framework/source/fwe/classes/bmkmenu.cxx b/framework/source/fwe/classes/bmkmenu.cxx
index dd2074f..b15c9f4 100644
--- a/framework/source/fwe/classes/bmkmenu.cxx
+++ b/framework/source/fwe/classes/bmkmenu.cxx
@@ -21,7 +21,6 @@
#include "framework/bmkmenu.hxx"
#include <general.h>
-#include <macros/debug/assertion.hxx>
#include <framework/imageproducer.hxx>
#include <framework/menuconfiguration.hxx>
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx b/framework/source/fwi/classes/protocolhandlercache.cxx
index 274613c..0f588a0 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -231,7 +231,7 @@ void HandlerCFGAccess::read( HandlerHash** ppHandler ,
// get values at all
css::uno::Sequence< css::uno::Any > lValues = GetProperties( lFullNames );
- LOG_ASSERT2( lFullNames.getLength()!=lValues.getLength(), "HandlerCFGAccess::read()", "Miss some configuration values of handler set!" )
+ SAL_WARN_IF( lFullNames.getLength()!=lValues.getLength(), "fwk", "HandlerCFGAccess::read(): Miss some configuration values of handler set!" );
// fill structures
nSource = 0;
diff --git a/framework/source/fwi/threadhelp/transactionmanager.cxx b/framework/source/fwi/threadhelp/transactionmanager.cxx
index c407540..95297f5 100644
--- a/framework/source/fwi/threadhelp/transactionmanager.cxx
+++ b/framework/source/fwi/threadhelp/transactionmanager.cxx
@@ -296,7 +296,7 @@ void TransactionManager::impl_throwExceptions( EExceptionMode eMode, ERejectReas
case E_UNINITIALIZED : if( eMode == E_HARDEXCEPTIONS )
{
// Help programmer to find out, why this exception is thrown!
- LOG_ERROR( "TransactionManager...", "Owner instance not correctly initialized yet. Call was rejected! Normally it's an algorithm error ... wrong use of class!" )
+ SAL_WARN( "fwk", "TransactionManager...: Owner instance not correctly initialized yet. Call was rejected! Normally it's an algorithm error ... wrong use of class!" );
//ATTENTION: temp. disabled - till all bad code positions are detected and changed! */
// throw css::uno::RuntimeException( DECLARE_ASCII("TransactionManager...\nOwner instance not right initialized yet. Call was rejected! Normaly it's an algorithm error ... wrong usin of class!\n" ), css::uno::Reference< css::uno::XInterface >() );
}
@@ -304,18 +304,18 @@ void TransactionManager::impl_throwExceptions( EExceptionMode eMode, ERejectReas
case E_INCLOSE : if( eMode == E_HARDEXCEPTIONS )
{
// Help programmer to find out, why this exception is thrown!
- LOG_ERROR( "TransactionManager...", "Owner instance stand in close method. Call was rejected!" )
+ SAL_WARN( "fwk", "TransactionManager...: Owner instance stand in close method. Call was rejected!" );
throw css::lang::DisposedException( DECLARE_ASCII("TransactionManager...\nOwner instance stand in close method. Call was rejected!\n" ), css::uno::Reference< css::uno::XInterface >() );
}
break;
case E_CLOSED : {
// Help programmer to find out, why this exception is thrown!
- LOG_ERROR( "TransactionManager...", "Owner instance already closed. Call was rejected!" )
+ SAL_WARN( "fwk", "TransactionManager...: Owner instance already closed. Call was rejected!" );
throw css::lang::DisposedException( DECLARE_ASCII("TransactionManager...\nOwner instance already closed. Call was rejected!\n" ), css::uno::Reference< css::uno::XInterface >() );
}
case E_NOREASON : {
// Help programmer to find out
- LOG_ERROR( "TransactionManager...", "Impossible case E_NOREASON!" )
+ SAL_WARN( "fwk", "TransactionManager...: Impossible case E_NOREASON!" );
}
break;
default: break; // nothing to do
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx
index 32cb0ac..85e62cd 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -46,7 +46,7 @@ OComponentAccess::OComponentAccess( const css::uno::Reference< XDesktop >& xOwne
, m_xOwner ( xOwner )
{
// Safe impossible cases
- LOG_ASSERT( impldbg_checkParameter_OComponentAccessCtor( xOwner ), "OComponentAccess::OComponentAccess()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_OComponentAccessCtor( xOwner ), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" );
}
//*****************************************************************************************************************
@@ -200,8 +200,6 @@ css::uno::Reference< XComponent > OComponentAccess::impl_getFrameComponent( cons
But ... look for right testing! See using of this methods!
-----------------------------------------------------------------------------------------------------------------*/
-#ifdef ENABLE_ASSERTIONS
-
//*****************************************************************************************************************
sal_Bool OComponentAccess::impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< XDesktop >& xOwner )
{
@@ -219,8 +217,6 @@ sal_Bool OComponentAccess::impldbg_checkParameter_OComponentAccessCtor( const
return bOK ;
}
-#endif // #ifdef ENABLE_ASSERTIONS
-
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx
index 67c66e2..c1b3ea8 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -49,7 +49,7 @@ OComponentEnumeration::OComponentEnumeration( const Sequence< css::uno::Referenc
{
// Safe impossible states
// "Method" not defined for ALL parameters!
- LOG_ASSERT( impldbg_checkParameter_OComponentEnumerationCtor( seqComponents ), "OComponentEnumeration::OComponentEnumeration()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_OComponentEnumerationCtor( seqComponents ), "fwk", "OComponentEnumeration::OComponentEnumeration(): Invalid parameter detected!" );
}
//*****************************************************************************************************************
@@ -75,7 +75,7 @@ aEvent
// Safe impossible cases
// This method is not specified for all incoming parameters.
- LOG_ASSERT( impldbg_checkParameter_disposing( aEvent ), "OComponentEnumeration::disposing()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_disposing( aEvent ), "fwk", "OComponentEnumeration::disposing(): Invalid parameter detected!" );
// Reset instance to defaults, release references and free memory.
impl_resetObject();
@@ -157,8 +157,6 @@ void OComponentEnumeration::impl_resetObject()
But ... look for right testing! See using of this methods!
-----------------------------------------------------------------------------------------------------------------*/
-#ifdef ENABLE_ASSERTIONS
-
//*****************************************************************************************************************
// An empty list is allowed ... hasMoreElements() will return false then!
sal_Bool OComponentEnumeration::impldbg_checkParameter_OComponentEnumerationCtor( const Sequence< css::uno::Reference< XComponent > >& seqComponents )
@@ -193,8 +191,6 @@ sal_Bool OComponentEnumeration::impldbg_checkParameter_disposing( const EventObj
return bOK ;
}
-#endif // #ifdef ENABLE_ASSERTIONS
-
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index af078dc..73fa918 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -51,7 +51,7 @@ OFrames::OFrames( const css::uno::Reference< XFrame >& xOwner
{
// Safe impossible cases
// Method is not defined for ALL incoming parameters!
- LOG_ASSERT( impldbg_checkParameter_OFramesCtor( xOwner, pFrameContainer ), "OFrames::OFrames()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_OFramesCtor( xOwner, pFrameContainer ), "fwk", "OFrames::OFrames(): Invalid parameter detected!" );
}
//*****************************************************************************************************************
@@ -73,7 +73,7 @@ void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) thr
// Safe impossible cases
// Method is not defined for ALL incoming parameters!
- LOG_ASSERT( impldbg_checkParameter_append( xFrame ), "OFrames::append()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_append( xFrame ), "fwk", "OFrames::append(): Invalid parameter detected!" );
// Do the follow only, if owner instance valid!
// Lock owner for follow operations - make a "hard reference"!
@@ -86,7 +86,7 @@ void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) thr
xFrame->setCreator( xOwner );
}
// Else; Do nothing! Ouer owner is dead.
- LOG_ASSERT( !(xOwner.is()==sal_False), "OFrames::append()\nOuer owner is dead - you can't append any frames ...!\n" )
+ SAL_WARN_IF( !xOwner.is(), "fwk", "OFrames::append():Our owner is dead - you can't append any frames ...!" );
}
//*****************************************************************************************************************
@@ -99,7 +99,7 @@ void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) thr
// Safe impossible cases
// Method is not defined for ALL incoming parameters!
- LOG_ASSERT( impldbg_checkParameter_remove( xFrame ), "OFrames::remove()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_remove( xFrame ), "fwk", "OFrames::remove(): Invalid parameter detected!" );
// Do the follow only, if owner instance valid!
// Lock owner for follow operations - make a "hard reference"!
@@ -113,7 +113,7 @@ void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) thr
// See documentation of interface XFrames for further information.
}
// Else; Do nothing! Ouer owner is dead.
- LOG_ASSERT( !(xOwner.is()==sal_False), "OFrames::remove()\nOuer owner is dead - you can't remove any frames ...!\n" )
+ SAL_WARN_IF( !xOwner.is(), "fwk", "OFrames::remove(): Our owner is dead - you can't remove any frames ...!" );
}
//*****************************************************************************************************************
@@ -126,7 +126,7 @@ Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int
// Safe impossible cases
// Method is not defined for ALL incoming parameters!
- LOG_ASSERT( impldbg_checkParameter_queryFrames( nSearchFlags ), "OFrames::queryFrames()\nInvalid parameter detected!\n" )
+ SAL_WARN_IF( !impldbg_checkParameter_queryFrames( nSearchFlags ), "fwk", "OFrames::queryFrames(): Invalid parameter detected!" );
// Set default return value. (empty sequence)
Sequence< css::uno::Reference< XFrame > > seqFrames;
@@ -147,10 +147,7 @@ Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int
//_____________________________________________________________________________________________________________
// Search with AUTO-flag is not supported yet!
// We think about right implementation.
- LOG_ASSERT( !(nSearchFlags & FrameSearchFlag::AUTO), "OFrames::queryFrames()\nSearch with AUTO-flag is not supported yet!\nWe think about right implementation.\n" )
- // If searched for tasks ...
- // Its not supported yet.
- LOG_ASSERT( !(nSearchFlags & FrameSearchFlag::AUTO), "OFrames::queryFrames()\nSearch for tasks not supported yet!\n" )
+ SAL_WARN_IF( (nSearchFlags & FrameSearchFlag::AUTO), "fwk", "OFrames::queryFrames(): Search with AUTO-flag is not supported yet!" );
//_____________________________________________________________________________________________________________
// Search for ALL and GLOBAL is superflous!
@@ -220,7 +217,7 @@ Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int
}
}
// Else; Do nothing! Ouer owner is dead.
- LOG_ASSERT( !(xOwner.is()==sal_False), "OFrames::queryFrames()\nOuer owner is dead - you can't query for frames ...!\n" )
+ SAL_WARN_IF( !xOwner.is(), "fwk", "OFrames::queryFrames(): Our owner is dead - you can't query for frames ...!" );
// Resturn result of this operation.
return seqFrames;
@@ -387,8 +384,6 @@ void OFrames::impl_appendSequence( Sequence< css::uno::Reference< XFram
But ... look for right testing! See using of this methods!
-----------------------------------------------------------------------------------------------------------------*/
-#ifdef ENABLE_ASSERTIONS
-
//*****************************************************************************************************************
// An instance of this class can only work with valid initialization.
// We share the mutex with ouer owner class, need a valid factory to instanciate new services and
@@ -475,8 +470,6 @@ sal_Bool OFrames::impldbg_checkParameter_queryFrames( sal_Int32 nSearchFlags )
return bOK ;
}
-#endif // #ifdef ENABLE_ASSERTIONS
-
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 0463b9d..3d3c2dc 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -1086,7 +1086,7 @@ void AutoRecovery::implts_readConfig()
if (aInfo.ID > m_nIdPool)
{
m_nIdPool = aInfo.ID+1;
- LOG_ASSERT(m_nIdPool>=0, "AutoRecovery::implts_readConfig()\nOverflow of IDPool detected!")
+ SAL_WARN_IF(m_nIdPool<0, "fwk", "AutoRecovery::implts_readConfig(): Overflow of IDPool detected!");
}
aWriteLock.unlock();
// <- SAFE ----------------------
@@ -1757,7 +1757,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// create a new cache entry ... this document isn't known.
++m_nIdPool;
aNew.ID = m_nIdPool;
- LOG_ASSERT(m_nIdPool>=0, "AutoRecovery::implts_registerDocument()\nOverflow of ID pool detected.")
+ SAL_WARN_IF(m_nIdPool<0, "fwk", "AutoRecovery::implts_registerDocument(): Overflow of ID pool detected.");
m_lDocCache.push_back(aNew);
AutoRecovery::TDocumentList::iterator pIt1 = AutoRecovery::impl_searchDocument(m_lDocCache, xDocument);
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index e037f21..8ea6f78 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -127,8 +127,8 @@ DEFINE_INIT_SERVICE ( Desktop,
// Safe impossible cases
// We can't work without this helper!
- LOG_ASSERT2( m_xFramesHelper.is ()==sal_False, "Desktop::Desktop()", "Frames helper is not valid. XFrames, XIndexAccess and XElementAcces are not supported!\n")
- LOG_ASSERT2( m_xDispatchHelper.is()==sal_False, "Desktop::Desktop()", "Dispatch helper is not valid. XDispatch will not work correctly!\n" )
+ SAL_WARN_IF( !m_xFramesHelper.is(), "fwk", "Desktop::Desktop(): Frames helper is not valid. XFrames, XIndexAccess and XElementAcces are not supported!");
+ SAL_WARN_IF( !m_xDispatchHelper.is(), "fwk", "Desktop::Desktop(): Dispatch helper is not valid. XDispatch will not work correctly!" );
// Enable object for real working!
// Otherwise all calls will be rejected ...
@@ -167,9 +167,7 @@ Desktop::Desktop( const css::uno::Reference< css::uno::XComponentContext >& xCon
, ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType > ( m_aLock.getShareableOslMutex() )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
// Init member
- #ifdef ENABLE_ASSERTIONS
, m_bIsTerminated ( sal_False ) // see dispose() for further information!
- #endif
, m_xContext ( xContext )
, m_aChildTaskContainer ( )
, m_aListenerContainer ( m_aLock.getShareableOslMutex() )
@@ -191,7 +189,7 @@ Desktop::Desktop( const css::uno::Reference< css::uno::XComponentContext >& xCon
{
// Safe impossible cases
// We don't accept all incoming parameter.
- LOG_ASSERT2( implcp_ctor( xContext ), "Desktop::Desktop()", "Invalid parameter detected!")
+ SAL_WARN_IF( implcp_ctor( xContext ), "fwk", "Desktop::Desktop(): Invalid parameter detected!" );
}
/*-************************************************************************************************************//**
@@ -207,15 +205,8 @@ Desktop::Desktop( const css::uno::Reference< css::uno::XComponentContext >& xCon
*//*-*************************************************************************************************************/
Desktop::~Desktop()
{
-#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?" )
+ SAL_WARN_IF( !m_bIsTerminated, "fwk", "Desktop not terminated before being destructed" );
+ SAL_WARN_IF( m_aTransactionManager.getWorkingMode()!=E_CLOSE, "fwk", "Desktop::~Desktop(): Who forgot to dispose this service?" );
}
css::uno::Any SAL_CALL Desktop::queryInterface( const css::uno::Type& _rType ) throw(css::uno::RuntimeException)
@@ -332,7 +323,6 @@ sal_Bool SAL_CALL Desktop::terminate()
impl_sendCancelTerminationEvent(lCalledTerminationListener);
else
{
- #ifdef ENABLE_ASSERTIONS
// "Protect" us against dispose before terminate calls!
// see dispose() for further information.
/* SAFE AREA --------------------------------------------------------------------------------------- */
@@ -340,7 +330,6 @@ sal_Bool SAL_CALL Desktop::terminate()
m_bIsTerminated = sal_True;
aWriteLock.unlock();
/* UNSAFE AREA ------------------------------------------------------------------------------------- */
- #endif
impl_sendNotifyTerminationEvent();
@@ -1141,11 +1130,7 @@ void SAL_CALL Desktop::dispose()
// 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
+ SAL_WARN_IF( !m_bIsTerminated, "fwk", "Desktop disposed before terminating it" );
WriteGuard aWriteLock( m_aLock ); // start synchronize
@@ -1229,7 +1214,7 @@ void SAL_CALL Desktop::addEventListener( const css::uno::Reference< css::lang::X
/* UNSAFE AREA --------------------------------------------------------------------------------------------- */
// Safe impossible cases
// Method not defined for all incoming parameter.
- LOG_ASSERT2( implcp_addEventListener( xListener ), "Desktop::addEventListener()", "Invalid parameter detected!" )
+ SAL_WARN_IF( implcp_addEventListener( xListener ), "fwk", "Desktop::addEventListener(): Invalid parameter detected!" );
// Register transaction and reject wrong calls.
TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
@@ -1242,7 +1227,7 @@ void SAL_CALL Desktop::removeEventListener( const css::uno::Reference< css::lang
/* UNSAFE AREA --------------------------------------------------------------------------------------------- */
// Safe impossible cases
// Method not defined for all incoming parameter.
- LOG_ASSERT2( implcp_removeEventListener( xListener ), "Desktop::removeEventListener()", "Invalid parameter detected!" )
+ SAL_WARN_IF( implcp_removeEventListener( xListener ), "fwk", "Desktop::removeEventListener(): Invalid parameter detected!" );
// Register transaction and reject wrong calls.
TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list