Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4044
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/44/4044/1
fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFO
- replaced RTL_CONTEXT_ with SAL_INFO
- replace OSL_* with SAL_*
Change-Id: Id4e90b83a7275bfd30914f7514a609cebbfbf4ac
---
M desktop/source/app/app.cxx
M desktop/source/app/appinit.cxx
M desktop/source/app/check_ext_deps.cxx
M desktop/source/offacc/acceptor.cxx
M desktop/source/splash/splash.cxx
M embeddedobj/source/commonembedding/embedobj.cxx
M embeddedobj/source/commonembedding/persistence.cxx
M embeddedobj/source/commonembedding/visobj.cxx
M embeddedobj/source/commonembedding/xfactory.cxx
M embeddedobj/source/general/xcreator.cxx
M embeddedobj/source/msole/oleembed.cxx
M embeddedobj/source/msole/olepersist.cxx
M embeddedobj/source/msole/olevisual.cxx
M embeddedobj/source/msole/xolefactory.cxx
14 files changed, 191 insertions(+), 227 deletions(-)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index de16f0a..e857115 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -86,7 +86,6 @@
#include <unotools/pathoptions.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/menuoptions.hxx>
-#include <rtl/logfile.hxx>
#include <rtl/bootstrap.hxx>
#include <vcl/help.hxx>
#include <vcl/msgbox.hxx>
@@ -166,8 +165,7 @@
case osl::FileBase::E_NOENT:
return; //TODO: SAL_WARN if recursive
default:
- SAL_WARN(
- "desktop", "cannot open directory " << dir.getURL() << ": " << +rc);
+ SAL_WARN("desktop.app", "cannot open directory " << dir.getURL() << ": " << +rc);
return;
}
for (;;) {
@@ -177,9 +175,7 @@
break;
}
if (rc != osl::FileBase::E_None) {
- SAL_WARN(
- "desktop",
- "cannot iterate directory " << dir.getURL() << ": " << +rc);
+ SAL_WARN( "desktop.app", "cannot iterate directory " << dir.getURL() << ": " << +rc);
break;
}
osl::FileStatus stat(
@@ -187,9 +183,7 @@
osl_FileStatus_Mask_FileURL);
rc = i.getFileStatus(stat);
if (rc != osl::FileBase::E_None) {
- SAL_WARN(
- "desktop",
- "cannot stat in directory " << dir.getURL() << ": " << +rc);
+ SAL_WARN( "desktop.app", "cannot stat in directory " << dir.getURL() << ": " << +rc);
continue;
}
if (stat.getFileType() == osl::FileStatus::Directory) { //TODO: symlinks
@@ -197,19 +191,19 @@
} else {
rc = osl::File::remove(stat.getFileURL());
SAL_WARN_IF(
- rc != osl::FileBase::E_None, "desktop",
+ rc != osl::FileBase::E_None, "desktop.app",
"cannot remove file " << stat.getFileURL() << ": " << +rc);
}
}
if (dir.isOpen()) {
rc = dir.close();
SAL_WARN_IF(
- rc != osl::FileBase::E_None, "desktop",
+ rc != osl::FileBase::E_None, "desktop.app",
"cannot close directory " << dir.getURL() << ": " << +rc);
}
rc = osl::Directory::remove(url);
SAL_WARN_IF(
- rc != osl::FileBase::E_None, "desktop",
+ rc != osl::FileBase::E_None, "desktop.app",
"cannot remove directory " << url << ": " << +rc);
}
@@ -261,12 +255,10 @@
rc = fr.readLine(s1);
osl::FileBase::RC rc2 = fr.close();
SAL_WARN_IF(
- rc2 != osl::FileBase::E_None, "desktop",
+ rc2 != osl::FileBase::E_None, "desktop.app",
"cannot close " << fr.getURL() << " after reading: " << +rc2);
if (rc != osl::FileBase::E_None) {
- SAL_WARN(
- "desktop",
- "cannot read from " << fr.getURL() << ": " << +rc);
+ SAL_WARN( "desktop.app", "cannot read from " << fr.getURL() << ": " << +rc);
break;
}
OUString s2(
@@ -282,9 +274,7 @@
case osl::FileBase::E_NOENT:
break;
default:
- SAL_WARN(
- "desktop",
- "cannot open " << fr.getURL() << " for reading: " << +rc);
+ SAL_WARN( "desktop.app", "cannot open " << fr.getURL() << " for reading: " << +rc);
break;
}
removeTree(extDir);
@@ -294,18 +284,16 @@
rtl::Bootstrap::expandMacros(userRcFile); //TODO: detect failure
rc = osl::File::remove(userRcFile);
SAL_WARN_IF(
- rc != osl::FileBase::E_None && rc != osl::FileBase::E_NOENT, "desktop",
+ rc != osl::FileBase::E_None && rc != osl::FileBase::E_NOENT, "desktop.app",
"cannot remove file " << userRcFile << ": " << +rc);
rc = osl::Directory::createPath(extDir);
SAL_WARN_IF(
- rc != osl::FileBase::E_None && rc != osl::FileBase::E_EXIST, "desktop",
+ rc != osl::FileBase::E_None && rc != osl::FileBase::E_EXIST, "desktop.app",
"cannot create path " << extDir << ": " << +rc);
osl::File fw(buildIdFile);
rc = fw.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Create);
if (rc != osl::FileBase::E_None) {
- SAL_WARN(
- "desktop",
- "cannot open " << fw.getURL() << " for writing: " << +rc);
+ SAL_WARN( "desktop.app", "cannot open " << fw.getURL() << " for writing: " << +rc);
return true;
}
OString buf(OUStringToOString(buildId, RTL_TEXTENCODING_UTF8));
@@ -317,11 +305,11 @@
SAL_WARN_IF(
(rc != osl::FileBase::E_None
|| n != static_cast< sal_uInt32 >(buf.getLength())),
- "desktop",
+ "desktop.app",
"cannot write to " << fw.getURL() << ": " << +rc << ", " << n);
rc = fw.close();
SAL_WARN_IF(
- rc != osl::FileBase::E_None, "desktop",
+ rc != osl::FileBase::E_None, "desktop.app",
"cannot close " << fw.getURL() << " after writing: " << +rc);
return true;
}
@@ -557,7 +545,7 @@
, m_bServicesRegistered( false )
, m_aBootstrapError( BE_OK )
{
- RTL_LOGFILE_TRACE( "desktop (cd100003) ::Desktop::Desktop" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::Desktop" );
}
Desktop::~Desktop()
@@ -569,7 +557,7 @@
void Desktop::Init()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::Init" );
SetBootstrapStatus(BS_OK);
m_bCleanedExtensionCache = cleanExtensionCache();
@@ -605,7 +593,7 @@
const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
// start ipc thread only for non-remote offices
- RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) ::OfficeIPCThread::EnableOfficeIPCThread"
);
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::OfficeIPCThread::EnableOfficeIPCThread" );
OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread();
if ( aStatus == OfficeIPCThread::IPC_STATUS_PIPE_ERROR )
{
@@ -650,21 +638,21 @@
void Desktop::InitFinished()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::InitFinished" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::InitFinished" );
CloseSplashScreen();
}
void Desktop::DeInit()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::DeInit" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::DeInit" );
try {
// instead of removing of the configManager just let it commit all the changes
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
+ SAL_INFO( "desktop.app", "<- store config items" );
utl::ConfigManager::storeConfigItems();
FlushConfiguration();
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
+ SAL_INFO( "desktop.app", "<- store config items" );
// close splashscreen if it's still open
CloseSplashScreen();
@@ -685,16 +673,16 @@
// this will leave some garbage behind..
}
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::DeInit" );
+ SAL_INFO( "desktop.app", "FINISHED WITH Destop::DeInit" );
}
sal_Bool Desktop::QueryExit()
{
try
{
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
+ SAL_INFO( "desktop.app", "<- store config items" );
utl::ConfigManager::storeConfigItems();
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
+ SAL_INFO( "desktop.app", "<- store config items" );
}
catch ( const RuntimeException& )
{
@@ -881,8 +869,8 @@
/// the bootstrap INI file could not be found or read
/// the bootstrap INI is missing a required entry
/// the bootstrap INI contains invalid data
- case ::utl::Bootstrap::MISSING_BOOTSTRAP_FILE_ENTRY:
- case ::utl::Bootstrap::INVALID_BOOTSTRAP_FILE_ENTRY:
+ case ::utl::Bootstrap::MISSING_BOOTSTRAP_FILE_ENTRY:
+ case ::utl::Bootstrap::INVALID_BOOTSTRAP_FILE_ENTRY:
case ::utl::Bootstrap::MISSING_BOOTSTRAP_FILE:
{
OUString aBootstrapFileURL;
@@ -895,7 +883,7 @@
/// the version locator INI file could not be found or read
/// the version locator INI has no entry for this version
/// the version locator INI entry is not a valid directory URL
- case ::utl::Bootstrap::INVALID_VERSION_FILE_ENTRY:
+ case ::utl::Bootstrap::INVALID_VERSION_FILE_ENTRY:
case ::utl::Bootstrap::MISSING_VERSION_FILE_ENTRY:
case ::utl::Bootstrap::MISSING_VERSION_FILE:
{
@@ -907,7 +895,7 @@
break;
/// the user installation directory does not exist
- case ::utl::Bootstrap::MISSING_USER_DIRECTORY:
+ case ::utl::Bootstrap::MISSING_USER_DIRECTORY:
{
OUString aUserInstallationURL;
@@ -1336,7 +1324,7 @@
// frame/window is created. Since we do not use the TaskCreator here, we need to mimic its
behavior,
// otherwise documents loaded into this frame will later on miss functionality depending
on the style.
Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
- OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's
container window!" );
+ SAL_WARN_IF( !pContainerWindow, "desktop.app", "Desktop::Main: no implementation access to
the frame's container window!" );
if (!pContainerWindow) {
fprintf (stderr, "Error: It very much looks as if you have used 'linkoo' (or
bin/ooinstall -l)\n"
"but have then forgotten to source 'ooenv' into your shell before running !\n"
@@ -1367,7 +1355,7 @@
{
pExecGlobals = new ExecuteGlobals();
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Main" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::Main" );
// Remember current context object
com::sun::star::uno::ContextLayer layer(
@@ -1416,16 +1404,16 @@
ResMgr::SetReadStringHook( ReplaceStringHookProc );
// Startup screen
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main { OpenSplashScreen" );
+ SAL_INFO( "desktop.app", "desktop (lo119109) Desktop::Main { OpenSplashScreen" );
OpenSplashScreen();
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main } OpenSplashScreen" );
+ SAL_INFO( "desktop.app", "desktop (lo119109) Desktop::Main } OpenSplashScreen" );
SetSplashScreenProgress(10);
UserInstall::UserInstallStatus inst_fin = UserInstall::finalize();
if (inst_fin != UserInstall::Ok && inst_fin != UserInstall::Created)
{
- OSL_FAIL("userinstall failed");
+ SAL_WARN( "desktop.app", "userinstall failed");
if ( inst_fin == UserInstall::E_NoDiskSpace )
HandleBootstrapErrors(
BE_USERINSTALL_NOTENOUGHDISKSPACE, OUString() );
@@ -1452,7 +1440,7 @@
// check user installation directory for lockfile so we can be sure
// there is no other instance using our data files from a remote host
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
+ SAL_INFO( "desktop.app", "desktop (lo119109) Desktop::Main -> Lockfile" );
m_xLockfile.reset(new Lockfile);
#if HAVE_FEATURE_DESKTOP
@@ -1462,10 +1450,10 @@
// Lockfile exists, and user clicked 'no'
return EXIT_FAILURE;
}
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main <- Lockfile" );
+ SAL_INFO( "desktop.app", "desktop (lo119109) Desktop::Main <- Lockfile" );
// check if accessibility is enabled but not working and allow to quit
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ GetEnableATToolSupport" );
+ SAL_INFO( "desktop.app", "{ GetEnableATToolSupport" );
if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
{
bool bQuitApp;
@@ -1474,7 +1462,7 @@
if( bQuitApp )
return EXIT_FAILURE;
}
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} GetEnableATToolSupport" );
+ SAL_INFO( "desktop.app", "} GetEnableATToolSupport" );
#endif
// terminate if requested...
@@ -1512,10 +1500,10 @@
SetDisplayName( aTitle );
SetSplashScreenProgress(35);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" );
+ SAL_INFO( "desktop.app", "{ create SvtPathOptions and SvtLanguageOptions" );
pExecGlobals->pPathOptions.reset( new SvtPathOptions);
SetSplashScreenProgress(40);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" );
+ SAL_INFO( "desktop.app", "} create SvtPathOptions and SvtLanguageOptions" );
xDesktop = css::frame::Desktop::create( xContext );
@@ -1559,9 +1547,9 @@
sal_Bool bExistsRecoveryData = sal_False;
sal_Bool bExistsSessionData = sal_False;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ impl_checkRecoveryState" );
+ SAL_INFO( "desktop.app", "{ impl_checkRecoveryState" );
impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" );
+ SAL_INFO( "desktop.app", "} impl_checkRecoveryState" );
OUString pidfileName = rCmdLineArgs.GetPidfileName();
if ( !pidfileName.isEmpty() )
@@ -1580,18 +1568,18 @@
sal_uInt64 written = 0;
if ( pidfile.write(pid.getStr(), pid.getLength(), written) !=
osl::File::E_None )
{
- SAL_WARN("desktop", "cannot write pidfile " << pidfile.getURL());
+ SAL_WARN("desktop.app", "cannot write pidfile " << pidfile.getURL());
}
pidfile.close();
}
else
{
- SAL_WARN("desktop", "cannot open pidfile " << pidfile.getURL() <<
osl::FileBase::RC(rc));
+ SAL_WARN("desktop.app", "cannot open pidfile " << pidfile.getURL() <<
osl::FileBase::RC(rc));
}
}
else
{
- SAL_WARN("desktop", "cannot get pidfile URL from path" << pidfileName);
+ SAL_WARN("desktop.app", "cannot get pidfile URL from path" << pidfileName);
}
}
@@ -1615,9 +1603,9 @@
(!bExistsSessionData ) &&
(!Application::AnyInput( VCL_INPUT_APPEVENT ) ))
{
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
+ SAL_INFO( "desktop.app", "{ create BackingComponent" );
ShowBackingComponent(this);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" );
+ SAL_INFO( "desktop.app", "} create BackingComponent" );
}
}
}
@@ -1666,7 +1654,7 @@
!rCmdLineArgs.IsNoQuickstart() )
InitializeQuickstartMode( xContext );
- RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop"
);
+ SAL_INFO( "desktop.app", "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
try
{
if ( xDesktop.is() )
@@ -1698,7 +1686,7 @@
Application::AcquireSolarMutex( nAcquireCount );
// call Application::Execute to process messages in vcl message loop
- RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
+ SAL_INFO( "desktop.app", "PERFORMANCE - enter Application::Execute()" );
try
{
@@ -1774,12 +1762,12 @@
{
if ( osl::File::remove( pidfileURL ) != osl::FileBase::E_None )
{
- SAL_WARN("desktop", "shutdown: cannot remove pidfile " << pidfileURL);
+ SAL_WARN("desktop.app", "shutdown: cannot remove pidfile " << pidfileURL);
}
}
else
{
- SAL_WARN("desktop", "shutdown: cannot get pidfile URL from path" << pidfileName);
+ SAL_WARN("desktop.app", "shutdown: cannot get pidfile URL from path" << pidfileName);
}
}
@@ -1793,15 +1781,15 @@
Application::AcquireSolarMutex(nAcquireCount);
// be sure that path/language options gets destroyed before
// UCB is deinitialized
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> dispose path/language options" );
+ SAL_INFO( "desktop.app", "-> dispose path/language options" );
pExecGlobals->pLanguageOptions.reset( 0 );
pExecGlobals->pPathOptions.reset( 0 );
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- dispose path/language options" );
+ SAL_INFO( "desktop.app", "<- dispose path/language options" );
sal_Bool bRR = pExecGlobals->bRestartRequested;
delete pExecGlobals, pExecGlobals = NULL;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" );
+ SAL_INFO( "desktop.app", "FINISHED WITH Destop::Main" );
if ( bRR )
{
restartOnMac(true);
@@ -1820,7 +1808,7 @@
bool Desktop::InitializeConfiguration()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (jb99855) ::InitConfiguration" );
+ SAL_INFO( "desktop.app", "desktop (jb99855) ::InitConfiguration" );
try
{
css::configuration::theDefaultProvider::get(
@@ -1916,7 +1904,7 @@
// the shutdown icon sits in the systray and allows the user to keep
// the office instance running for quicker restart
// this will only be activated if --quickstart was specified on cmdline
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance
com.sun.star.office.Quickstart" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) createInstance
com.sun.star.office.Quickstart" );
sal_Bool bQuickstart = shouldLaunchQuickstart();
@@ -2012,7 +2000,7 @@
IMPL_LINK_NOARG(Desktop, OpenClients_Impl)
{
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE - DesktopOpenClients_Impl()" );
+ SAL_INFO( "desktop.app", "PERFORMANCE - DesktopOpenClients_Impl()" );
try {
OpenClients();
@@ -2043,7 +2031,7 @@
// Registers a COM class factory of the service manager with the windows operating system.
void Desktop::EnableOleAutomation()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (jl97489) ::Desktop::EnableOleAutomation" );
+ SAL_INFO( "desktop.app", "desktop (jl97489) ::Desktop::EnableOleAutomation" );
#ifdef WNT
Reference< XMultiServiceFactory > xSMgr= comphelper::getProcessServiceFactory();
xSMgr->createInstance(OUString("com.sun.star.bridge.OleApplicationRegistration"));
@@ -2376,9 +2364,8 @@
}
catch(const css::uno::Exception& e)
{
- OUString aMessage = OUString("Could not disable AutoRecovery.\n")
- + e.Message;
- OSL_FAIL(OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ OUString aMessage = OUString("Could not disable AutoRecovery.\n") + e.Message;
+ SAL_WARN( "desktop.app", "" << aMessage);
}
}
else
@@ -2405,9 +2392,8 @@
}
catch(const css::uno::Exception& e)
{
- OUString aMessage = OUString("Error during recovery\n")
- + e.Message;
- OSL_FAIL(OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ OUString aMessage = OUString("Error during recovery\n") + e.Message;
+ SAL_WARN( "desktop.app", "" << aMessage);
}
}
@@ -2428,9 +2414,8 @@
}
catch(const com::sun::star::uno::Exception& e)
{
- OUString aMessage = OUString("Registration of session listener failed\n")
- + e.Message;
- OSL_FAIL(OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ OUString aMessage = OUString("Registration of session listener failed\n") + e.Message;
+ SAL_WARN( "desktop.app", "" << aMessage);
}
if ( !bExistsRecoveryData )
@@ -2442,9 +2427,8 @@
}
catch(const com::sun::star::uno::Exception& e)
{
- OUString aMessage = OUString("Error in session management\n")
- + e.Message;
- OSL_FAIL(OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ OUString aMessage = OUString("Error in session management\n") + e.Message;
+ SAL_WARN( "desktop.app", "" << aMessage);
}
}
}
@@ -2536,7 +2520,7 @@
void Desktop::OpenDefault()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::OpenDefault" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::Desktop::OpenDefault" );
OUString aName;
SvtModuleOptions aOpt;
@@ -2791,7 +2775,7 @@
destroyAcceptor(rAppEvent.GetData());
break;
default:
- OSL_FAIL("this cannot happen");
+ SAL_WARN( "desktop.app", "this cannot happen");
break;
}
}
@@ -2885,7 +2869,7 @@
}
catch(const ::com::sun::star::uno::Exception&)
{
- OSL_FAIL( "Desktop::DoFirstRunInitializations: caught an exception while trigger job
executor ..." );
+ SAL_WARN( "desktop.app", "Desktop::DoFirstRunInitializations: caught an exception while
trigger job executor ..." );
}
}
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index d555c03..9c818d8 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -46,7 +46,6 @@
#include <tools/rcid.h>
-#include <rtl/logfile.hxx>
#include <rtl/instance.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/localfilehelper.hxx>
@@ -69,7 +68,7 @@
static void configureUcb()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (sb93797) ::configureUcb" );
+ SAL_INFO( "desktop.app", "desktop (sb93797) ::configureUcb" );
// For backwards compatibility, in case some code still uses plain
// createInstance w/o args directly to obtain an instance:
@@ -98,14 +97,14 @@
}
catch ( const Exception & )
{
- SAL_WARN( "desktop", "missing gnome-vfs component to initialize thread workaround" );
+ SAL_WARN( "desktop.app", "missing gnome-vfs component to initialize thread workaround" );
}
#endif // ENABLE_GNOME_VFS
}
void Desktop::InitApplicationServiceManager()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createApplicationServiceManager" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::createApplicationServiceManager" );
Reference<XMultiServiceFactory> sm;
#ifdef ANDROID
OUString aUnoRc( OUString( "file:///assets/program/unorc" ) );
@@ -124,7 +123,7 @@
{
if( !m_bServicesRegistered )
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::registerServices" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::registerServices" );
// interpret command line arguments
CommandLineArgs& rCmdLine = GetCommandLineArgs();
@@ -188,13 +187,13 @@
{
// no error handling needed...
// acceptor just won't come up
- OSL_FAIL("Acceptor could not be created.");
+ SAL_WARN( "desktop.app", "Acceptor could not be created.");
}
}
else
{
// there is already an acceptor with this description
- OSL_FAIL("Acceptor already exists.");
+ SAL_WARN( "desktop.app", "Acceptor already exists.");
}
}
}
@@ -216,7 +215,7 @@
void Desktop::enableAcceptors()
{
- RTL_LOGFILE_CONTEXT(aLog, "desktop (lo119109) Desktop::enableAcceptors");
+ SAL_INFO( "desktop.app", "desktop (lo119109) Desktop::enableAcceptors");
if (!bAccept)
{
// from now on, all new acceptors are enabled
@@ -243,7 +242,7 @@
// this is the last reference and the acceptor will be destructed
rMap.erase(aAcceptString);
} else {
- OSL_FAIL("Found no acceptor to remove");
+ SAL_WARN( "desktop.app", "Found no acceptor to remove");
}
}
}
@@ -257,7 +256,7 @@
void Desktop::CreateTemporaryDirectory()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createTemporaryDirectory" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::createTemporaryDirectory" );
OUString aTempBaseURL;
try
@@ -312,7 +311,7 @@
void Desktop::RemoveTemporaryDirectory()
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::removeTemporaryDirectory" );
+ SAL_INFO( "desktop.app", "desktop (cd100003) ::removeTemporaryDirectory" );
// remove current temporary directory
String &rCurrentTempURL = CurrentTempURL::get();
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index bb9aadb..53ee92e 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -22,7 +22,6 @@
#include <rtl/bootstrap.hxx>
#include <rtl/ustring.hxx>
-#include <rtl/logfile.hxx>
#include "cppuhelper/compbase3.hxx"
#include "vcl/wrkwin.hxx"
@@ -246,7 +245,7 @@
if ( !xExtensionManager.is() )
{
- OSL_FAIL( "Could not get the Extension Manager!" );
+ SAL_WARN( "desktop.app", "Could not get the Extension Manager!" );
return true;
}
@@ -293,7 +292,7 @@
catch ( const uno::RuntimeException & ) { throw; }
catch (const uno::Exception & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop.app", "" << exc.Message );
}
if ( bRegistered )
@@ -411,7 +410,7 @@
void Desktop::SynchronizeExtensionRepositories()
{
- RTL_LOGFILE_CONTEXT(aLog,"desktop (jl) ::Desktop::SynchronizeExtensionRepositories");
+ SAL_INFO( "desktop.app", "desktop (jl) ::Desktop::SynchronizeExtensionRepositories");
uno::Reference< uno::XComponentContext > context(
comphelper_getProcessComponentContext());
uno::Reference< ucb::XCommandEnvironment > silent(
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx
index a9b08f4..5c0aaab 100644
--- a/desktop/source/offacc/acceptor.cxx
+++ b/desktop/source/offacc/acceptor.cxx
@@ -93,16 +93,16 @@
{
while ( m_rAcceptor.is() )
{
- RTL_LOGFILE_CONTEXT( aLog, "desktop (lo119109) Acceptor::run" );
+ SAL_INFO( "desktop.offacc", "desktop (lo119109) Acceptor::run" );
try
{
// wait until we get enabled
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109)"\
+ SAL_INFO( "desktop.offacc", "desktop (lo119109)"\
"Acceptor::run waiting for office to come up");
m_cEnable.wait();
if (m_bDying) //see destructor
break;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109)"\
+ SAL_INFO( "desktop.offacc", "desktop (lo119109)"\
"Acceptor::run now enabled and continuing");
// accept connection
@@ -111,8 +111,7 @@
// is destructed so we break out of the run method terminating the thread
if (! rConnection.is()) break;
OUString aDescription = rConnection->getDescription();
- RTL_LOGFILE_CONTEXT_TRACE1( aLog, "desktop (lo119109) Acceptor::run connection %s",
- OUStringToOString(aDescription, RTL_TEXTENCODING_ASCII_US).getStr());
+ SAL_INFO( "desktop.offacc", "desktop (lo119109) Acceptor::run connection " <<
aDescription );
// create instanceprovider for this connection
Reference< XInstanceProvider > rInstanceProvider(
@@ -125,7 +124,7 @@
osl::MutexGuard g(m_aMutex);
m_bridges.add(rBridge);
} catch (const Exception& e) {
- SAL_WARN("desktop", "caught Exception \"" << e.Message << "\"");
+ SAL_WARN("desktop.offacc", "caught Exception \"" << e.Message << "\"");
// connection failed...
// something went wrong during connection setup.
// just wait for a new connection to accept
@@ -139,7 +138,7 @@
{
// prevent multiple initialization
ClearableMutexGuard aGuard( m_aMutex );
- RTL_LOGFILE_CONTEXT( aLog, "destop (lo119109) Acceptor::initialize()" );
+ SAL_INFO( "desktop.offacc", "destop (lo119109) Acceptor::initialize()" );
sal_Bool bOk = sal_False;
@@ -149,8 +148,7 @@
// not yet initialized and acceptstring
if (!m_bInit && nArgs > 0 && (aArguments[0] >>= m_aAcceptString))
{
- RTL_LOGFILE_CONTEXT_TRACE1( aLog, "desktop (lo119109) Acceptor::initialize string=%s",
- OUStringToOString(m_aAcceptString, RTL_TEXTENCODING_ASCII_US).getStr());
+// SAL_INFO( "desktop.offacc", "desktop (lo119109) Acceptor::initialize string=" <<
m_aAcceptString );
// get connect string and protocol from accept string
// "<connectString>;<protocol>"
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index c5bc653..3f63fbe 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -30,7 +30,6 @@
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/bootstrap.hxx>
-#include <rtl/logfile.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/math.hxx>
#include <vcl/introwin.hxx>
@@ -207,8 +206,8 @@
void SAL_CALL SplashScreen::setValue(sal_Int32 nValue)
throw (RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "::SplashScreen::setValue (lo119109)" );
- RTL_LOGFILE_CONTEXT_TRACE1( aLog, "value=%d", nValue );
+ SAL_INFO( "desktop.splash", "::SplashScreen::setValue (lo119109)" );
+ SAL_INFO( "desktop.splash", "value=" << nValue );
SolarMutexGuard aSolarGuard;
if (_bVisible && !_bProgressEnd) {
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx
b/embeddedobj/source/commonembedding/embedobj.cxx
index 24a7850..e2fe4f7 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <comphelper/processfactory.hxx>
-#include <rtl/logfile.hxx>
#include <vcl/svapp.hxx>
#include <targetstatecontrol.hxx>
@@ -205,7 +204,7 @@
}
else
{
- OSL_FAIL( "Unacceptable state switch!\n" );
+ SAL_WARN( "embeddedobj.common", "Unacceptable state switch!\n" );
throw uno::RuntimeException(); // TODO
}
}
@@ -277,7 +276,7 @@
}
else
{
- OSL_FAIL( "Unacceptable state switch!\n" );
+ SAL_WARN( "embeddedobj.common", "Unacceptable state switch!\n" );
throw uno::RuntimeException(); // TODO
}
}
@@ -347,7 +346,7 @@
}
else
{
- OSL_FAIL( "Unacceptable state switch!\n" );
+ SAL_WARN( "embeddedobj.common", "Unacceptable state switch!\n" );
throw uno::RuntimeException(); // TODO
}
}
@@ -360,7 +359,7 @@
}
else
{
- OSL_FAIL( "Unacceptable state switch!\n" );
+ SAL_WARN( "embeddedobj.common", "Unacceptable state switch!\n" );
throw uno::RuntimeException(); // TODO
}
}
@@ -425,7 +424,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" );
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ),
uno::UNO_QUERY);
{
@@ -529,7 +528,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" );
SolarMutexGuard aSolarGuard;
//TODO: a gross hack to avoid deadlocks when this is called from the
diff --git a/embeddedobj/source/commonembedding/persistence.cxx
b/embeddedobj/source/commonembedding/persistence.cxx
index cc99b3b..2f2b045 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -52,8 +52,6 @@
#include <comphelper/mimeconfighelper.hxx>
#include <comphelper/namedvaluecollection.hxx>
-#include <rtl/logfile.hxx>
-
#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
@@ -120,7 +118,7 @@
const uno::Reference< embed::XStorage
& xStorage,
const uno::Reference<
uno::XComponentContext >& xContext )
{
- OSL_ENSURE( xStorage.is(), "The storage can not be empty!" );
+ SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "The storage can not be empty!" );
uno::Reference< io::XInputStream > xResult;
@@ -149,7 +147,7 @@
try {
uno::Reference< lang::XComponent > xComponent( xTempStorage, uno::UNO_QUERY );
- OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" );
+ SAL_WARN_IF( !xComponent.is(), "embeddedobj.common", "Wrong storage implementation!" );
if ( xComponent.is() )
xComponent->dispose();
}
@@ -246,7 +244,7 @@
{
if ( xNewParentStorage == m_xParentStorage && aNewName.equals( m_aEntryName ) )
{
- OSL_ENSURE( xNewObjectStorage == m_xObjectStorage, "The storage must be the same!\n" );
+ SAL_WARN_IF( xNewObjectStorage != m_xObjectStorage, "embeddedobj.common", "The storage
must be the same!\n" );
return;
}
@@ -284,7 +282,7 @@
sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ :
embed::ElementModes::READWRITE;
uno::Reference< embed::XStorage > xNewOwnStorage = xNewParentStorage->openStorageElement(
aNewName, nStorageMode );
- OSL_ENSURE( xNewOwnStorage.is(), "The method can not return empty reference!" );
+ SAL_WARN_IF( !xNewOwnStorage.is(), "embeddedobj.common", "The method can not return empty
reference!" );
SwitchOwnPersistence( xNewParentStorage, xNewOwnStorage, aNewName );
}
@@ -302,7 +300,7 @@
}
catch( const lang::NoSupportException & )
{
- OSL_FAIL( "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" );
+ SAL_WARN( "embeddedobj.common", "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set
parent at document!" );
}
}
@@ -327,7 +325,7 @@
if ( m_xRecoveryStorage.is() )
{
uno::Reference< document::XStorageBasedDocument > xDoc( xLoadable, uno::UNO_QUERY );
- OSL_ENSURE( xDoc.is(), "OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover
from a storage when the document is not storage based!" );
+ SAL_WARN_IF( !xDoc.is(), "embeddedobj.common",
"OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover from a storage when the document is
not storage based!" );
if ( xDoc.is() )
{
::comphelper::NamedValueCollection aLoadArgs;
@@ -463,7 +461,7 @@
o_rLoadArgs.put( "ReadOnly", m_bReadOnly );
OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat(
i_rxStorage ) );
- OSL_ENSURE( !aFilterName.isEmpty(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong
document service name!" );
+ SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common",
"OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" );
if ( aFilterName.isEmpty() )
throw io::IOException(); // TODO: error message/code
@@ -516,7 +514,7 @@
{
}
- OSL_ENSURE( !aTempFileURL.isEmpty(), "Coudn't retrieve temporary file URL!\n" );
+ SAL_WARN_IF( aTempFileURL.isEmpty(), "embeddedobj.common", "Coudn't retrieve temporary
file URL!\n" );
aLoadArgs.put( "URL", aTempFileURL );
aLoadArgs.put( "InputStream", xTempInpStream );
@@ -586,7 +584,7 @@
OUString aFilterName = GetFilterName( nStorageFormat );
- OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" );
+ SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common", "Wrong document service name!" );
if ( aFilterName.isEmpty() )
throw io::IOException(); // TODO:
@@ -607,7 +605,7 @@
}
catch( const uno::Exception& )
{
- OSL_FAIL( "Looks like stream was closed already" );
+ SAL_WARN( "embeddedobj.common", "Looks like stream was closed already" );
}
return aResult;
@@ -634,7 +632,7 @@
}
catch( const uno::Exception& )
{
- OSL_FAIL( "The object was not stored!\n" );
+ SAL_WARN( "embeddedobj.common", "The object was not stored!\n" );
}
}
}
@@ -731,7 +729,7 @@
const OUString& aHierarchName,
sal_Bool bAttachToTheStorage )
{
- OSL_ENSURE( xStorage.is(), "No storage is provided for storing!" );
+ SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "No storage is provided for storing!" );
if ( !xStorage.is() )
throw uno::RuntimeException(); // TODO:
@@ -747,7 +745,7 @@
{
OUString aFilterName = GetFilterName( nStorageFormat );
- OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" );
+ SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common", "Wrong document service name!" );
if ( aFilterName.isEmpty() )
throw io::IOException(); // TODO:
@@ -768,7 +766,7 @@
// store document to temporary stream based on temporary file
uno::Reference < io::XInputStream > xTempIn = StoreDocumentToTempStream_Impl(
nStorageFormat, aBaseURL, aHierarchName );
- OSL_ENSURE( xTempIn.is(), "The stream reference can not be empty!\n" );
+ SAL_WARN_IF( !xTempIn.is(), "embeddedobj.common", "The stream reference can not be
empty!\n" );
// open storage based on document temporary file for reading
uno::Reference < lang::XSingleServiceFactory > xStorageFactory =
embed::StorageFactory::create(m_xContext);
@@ -828,7 +826,7 @@
{
uno::Reference< util::XCloseable > xResult;
- OSL_ENSURE( m_bIsLink, "The object is not a linked one!\n" );
+ SAL_WARN_IF( !m_bIsLink, "embeddedobj.common", "The object is not a linked one!\n" );
uno::Sequence< beans::PropertyValue > aTempMediaDescr;
@@ -842,7 +840,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve storage media type!\n" );
}
if ( m_pDocHolder->GetComponent().is() )
@@ -865,7 +863,7 @@
{
}
- OSL_ENSURE( !aTempFileURL.isEmpty(), "Couldn't retrieve temporary file URL!\n" );
+ SAL_WARN_IF( aTempFileURL.isEmpty(), "embeddedobj.common", "Couldn't retrieve temporary
file URL!\n" );
aTempMediaDescr[0].Name = OUString( "URL" );
aTempMediaDescr[0].Value <<= aTempFileURL;
@@ -903,7 +901,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::setPersistentEntry" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OCommonEmbeddedObject::setPersistentEntry" );
// the type of the object must be already set
// a kind of typedetection should be done in the factory
@@ -1040,7 +1038,7 @@
m_pDocHolder->SetOutplaceFrameProperties( aOutFrameProps );
}
else
- OSL_FAIL( "OCommonEmbeddedObject::setPersistentEntry: illegal type for argument
'OutplaceFrameProperties'!" );
+ SAL_WARN( "embeddedobj.common", "OCommonEmbeddedObject::setPersistentEntry:
illegal type for argument 'OutplaceFrameProperties'!" );
}
else if ( lObjArgs[nObjInd].Name == "ModuleName" )
{
@@ -1131,7 +1129,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeToEntry" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeToEntry" );
::osl::ResettableMutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
@@ -1168,7 +1166,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve target storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!\n" );
}
try
@@ -1181,7 +1179,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve own storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve own storage media type!\n" );
}
sal_Bool bTryOptimization = sal_False;
@@ -1257,7 +1255,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeAsEntry" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeAsEntry" );
// TODO: use lObjArgs
@@ -1299,7 +1297,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve target storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!\n" );
}
try
@@ -1312,7 +1310,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve own storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve own storage media type!\n" );
}
PostEvent_Impl( OUString( "OnSaveAs" ) );
@@ -1394,7 +1392,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::saveCompleted" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::saveCompleted" );
::osl::MutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
@@ -1422,7 +1420,7 @@
if ( !m_bWaitSaveCompleted && !bUseNew )
return;
- OSL_ENSURE( m_bWaitSaveCompleted, "Unexpected saveCompleted() call!\n" );
+ SAL_WARN_IF( !m_bWaitSaveCompleted, "embeddedobj.common", "Unexpected saveCompleted() call!\n"
);
if ( !m_bWaitSaveCompleted )
throw io::IOException(); // TODO: illegal call
@@ -1445,7 +1443,7 @@
{
try {
uno::Reference< lang::XComponent > xComponent( m_xNewObjectStorage, uno::UNO_QUERY );
- OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" );
+ SAL_WARN_IF( !xComponent.is(), "embeddedobj.common", "Wrong storage implementation!" );
if ( xComponent.is() )
xComponent->dispose();
}
@@ -1522,7 +1520,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeOwn" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeOwn" );
// during switching from Activated to Running and from Running to Loaded states the object will
// ask container to store the object, the container has to make decision
@@ -1553,7 +1551,7 @@
PostEvent_Impl( OUString( "OnSave" ) );
- OSL_ENSURE( m_pDocHolder->GetComponent().is(), "If an object is activated or in running state
it must have a document!\n" );
+ SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "If an object is
activated or in running state it must have a document!\n" );
if ( !m_pDocHolder->GetComponent().is() )
throw uno::RuntimeException();
@@ -1588,7 +1586,7 @@
}
catch ( const uno::Exception& )
{
- OSL_FAIL( "Can not retrieve storage media type!\n" );
+ SAL_WARN( "embeddedobj.common", "Can not retrieve storage media type!\n" );
}
aGuard.clear();
@@ -1830,7 +1828,7 @@
{}
m_pDocHolder->SetComponent( xDocument, m_bReadOnly );
- OSL_ENSURE( m_pDocHolder->GetComponent().is(), "If document cant be created, an exception must
be thrown!\n" );
+ SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "If document cant be
created, an exception must be thrown!\n" );
if ( m_nObjectState == embed::EmbedStates::LOADED )
{
diff --git a/embeddedobj/source/commonembedding/visobj.cxx
b/embeddedobj/source/commonembedding/visobj.cxx
index 38c89fd..b624b6a 100644
--- a/embeddedobj/source/commonembedding/visobj.cxx
+++ b/embeddedobj/source/commonembedding/visobj.cxx
@@ -23,8 +23,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <rtl/logfile.hxx>
-
#include <commonembobj.hxx>
@@ -37,13 +35,13 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::setVisualAreaSize" );
+ SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033)
OCommonEmbeddedObject::setVisualAreaSize" );
::osl::MutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified
objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -79,7 +77,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::getVisualAreaSize" );
+ SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033)
OCommonEmbeddedObject::getVisualAreaSize" );
::osl::MutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
@@ -89,7 +87,7 @@
throw embed::WrongStateException( OUString( "The own object has no persistence!\n" ),
uno::Reference< uno::XInterface >( static_cast<
::cppu::OWeakObject* >(this) ) );
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified
objects no graphical replacement is required!\n" );
if ( m_bHasClonedSize )
return m_aClonedSize;
@@ -123,7 +121,7 @@
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified
objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -162,7 +160,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OCommonEmbeddedObject::getPrefferedVisualRepresentation" );
+ SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033)
OCommonEmbeddedObject::getPrefferedVisualRepresentation" );
::osl::MutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
@@ -173,7 +171,7 @@
uno::Reference< uno::XInterface >( static_cast<
::cppu::OWeakObject* >(this) ) );
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified
objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -188,7 +186,7 @@
bBackToLoaded = m_bIsLink;
}
- OSL_ENSURE( m_pDocHolder->GetComponent().is(), "Running or Active object has no component!\n"
);
+ SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "Running or Active
object has no component!\n" );
// TODO: return for the aspect of the document
embed::VisualRepresentation aVisualRepresentation;
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx
b/embeddedobj/source/commonembedding/xfactory.cxx
index 74e4d4f..0ccd7b1 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -24,7 +24,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
@@ -70,7 +69,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitFromEntry" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitFromEntry" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -161,7 +160,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -226,7 +225,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitNew" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceInitNew" );
uno::Reference< uno::XInterface > xResult;
@@ -279,7 +278,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceUserInit" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceUserInit" );
// the initialization is completelly controlled by user
if ( !xStorage.is() )
@@ -339,7 +338,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceLink" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceLink" );
uno::Reference< uno::XInterface > xResult;
@@ -395,7 +394,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceLinkUserInit" );
+ SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033)
OOoEmbeddedObjectFactory::createInstanceLinkUserInit" );
uno::Reference< uno::XInterface > xResult;
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index b3e0257..734f8c5 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -29,7 +29,6 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
@@ -74,7 +73,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitNew" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitNew" );
uno::Reference< uno::XInterface > xResult;
@@ -119,7 +118,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitFromEntry" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitFromEntry" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -238,7 +237,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitFromMediaDescriptor" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceInitFromMediaDescriptor" );
// TODO: use lObjArgs
@@ -303,7 +302,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceUserInit" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceUserInit" );
uno::Reference< uno::XInterface > xResult;
@@ -344,7 +343,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceLink" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceLink" );
uno::Reference< uno::XInterface > xResult;
@@ -419,7 +418,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceLinkUserInit" );
+ SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033)
UNOEmbeddedObjectCreator::createInstanceLinkUserInit" );
uno::Reference< uno::XInterface > xResult;
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 859a9b9..6b2cd207 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -42,7 +42,6 @@
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <rtl/logfile.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/mimeconfighelper.hxx>
@@ -104,7 +103,7 @@
//----------------------------------------------
uno::Sequence< sal_Int32 > OleEmbeddedObject::GetIntermediateVerbsSequence_Impl( sal_Int32
nNewState )
{
- OSL_ENSURE( m_nObjectState != embed::EmbedStates::LOADED, "Loaded object is switched to
running state without verbs using!" );
+ SAL_WARN_IF( m_nObjectState == embed::EmbedStates::LOADED, "embeddedobj.ole", "Loaded object
is switched to running state without verbs using!" );
// actually there will be only one verb
if ( m_nObjectState == embed::EmbedStates::RUNNING && nNewState == embed::EmbedStates::ACTIVE )
@@ -415,7 +414,7 @@
if ( !aStorageName.isEmpty() )
try {
m_xParentStorage->removeElement( aStorageName );
- } catch( const uno::Exception& ) { OSL_FAIL( "Can not remove temporary
storage!" ); }
+ } catch( const uno::Exception& ) { SAL_WARN( "embeddedobj.ole", "Can not
remove temporary storage!" ); }
break;
}
}
@@ -445,7 +444,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::changeState" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::changeState" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -603,7 +602,7 @@
throw ( embed::WrongStateException,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getReachableStates" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getReachableStates" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -762,7 +761,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::doVerb" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::doVerb" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -898,7 +897,7 @@
throw ( embed::WrongStateException,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getSupportedVerb" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getSupportedVerb" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -1022,7 +1021,7 @@
else
{
// the object must be up to date
- OSL_ENSURE( m_nUpdateMode == embed::EmbedUpdateModes::ALWAYS_UPDATE, "Unknown update
mode!\n" );
+ SAL_WARN_IF( m_nUpdateMode != embed::EmbedUpdateModes::ALWAYS_UPDATE, "embeddedobj.ole",
"Unknown update mode!\n" );
}
}
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 7b683ce..4ed68c9 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -37,8 +37,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <rtl/logfile.hxx>
-
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/mimeconfighelper.hxx>
@@ -77,7 +75,7 @@
//----------------------------------------------
OUString GetNewTempFileURL_Impl( const uno::Reference< lang::XMultiServiceFactory >& xFactory )
{
- OSL_ENSURE( xFactory.is(), "No factory is provided!\n" );
+ SAL_WARN_IF( !xFactory.is(), "embeddedobj.ole", "No factory is provided!\n" );
OUString aResult;
@@ -263,7 +261,7 @@
uno::Reference< io::XStream > OleEmbeddedObject::GetNewFilledTempStream_Impl( const
uno::Reference< io::XInputStream >& xInStream )
throw( io::IOException )
{
- OSL_ENSURE( xInStream.is(), "Wrong parameter is provided!\n" );
+ SAL_WARN_IF( !xInStream.is(), "embeddedobj.ole", "Wrong parameter is provided!\n" );
uno::Reference < io::XStream > xTempFile(
io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
@@ -481,7 +479,7 @@
sal_Int64 nLength = xTempSeek->getLength() - 40;
if ( nLength < 0 || nLength >= 0xFFFFFFFF )
{
- OSL_FAIL( "Length is not acceptable!" );
+ SAL_WARN( "embeddedobj.ole", "Length is not acceptable!" );
return;
}
for ( sal_Int32 nInd = 0; nInd < 4; nInd++ )
@@ -566,7 +564,7 @@
SetVisReplInStream( sal_True );
else
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObject::HasVisualReplInStream, analizing" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObject::HasVisualReplInStream, analizing" );
uno::Reference< io::XInputStream > xStream;
@@ -634,7 +632,7 @@
if ( xStream.is() )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObject::TryToRetrieveCachedVisualRepresentation, retrieving" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObject::TryToRetrieveCachedVisualRepresentation, retrieving" );
uno::Reference< container::XNameContainer > xNameContainer;
uno::Sequence< uno::Any > aArgs( 2 );
@@ -768,7 +766,7 @@
{
if ( xNewParentStorage == m_xParentStorage && aNewName.equals( m_aEntryName ) )
{
- OSL_ENSURE( xNewObjectStream == m_xObjectStream, "The streams must be the same!\n" );
+ SAL_WARN_IF( xNewObjectStream != m_xObjectStream, "embeddedobj.ole", "The streams must be
the same!\n" );
return;
}
@@ -797,7 +795,7 @@
sal_Int32 nStreamMode = m_bReadOnly ? embed::ElementModes::READ :
embed::ElementModes::READWRITE;
uno::Reference< io::XStream > xNewOwnStream = xNewParentStorage->openStreamElement( aNewName,
nStreamMode );
- OSL_ENSURE( xNewOwnStream.is(), "The method can not return empty reference!" );
+ SAL_WARN_IF( !xNewOwnStream.is(), "embeddedobj.ole", "The method can not return empty
reference!" );
SwitchOwnPersistence( xNewParentStorage, xNewOwnStream, aNewName );
}
@@ -830,8 +828,8 @@
sal_Bool bResult = sal_False;
- OSL_ENSURE( m_nObjectState != -1, "The object has no persistence!\n" );
- OSL_ENSURE( m_nObjectState != embed::EmbedStates::LOADED, "The object get OnShowWindow in
loaded state!\n" );
+ SAL_WARN_IF( m_nObjectState == -1, "embeddedobj.ole", "The object has no persistence!\n" );
+ SAL_WARN_IF( m_nObjectState == embed::EmbedStates::LOADED, "embeddedobj.ole", "The object get
OnShowWindow in loaded state!\n" );
if ( m_nObjectState == -1 || m_nObjectState == embed::EmbedStates::LOADED )
return sal_False;
@@ -923,7 +921,7 @@
//------------------------------------------------------
OUString OleEmbeddedObject::CreateTempURLEmpty_Impl()
{
- OSL_ENSURE( m_aTempURL.isEmpty(), "The object has already the temporary file!" );
+ SAL_WARN_IF( !m_aTempURL.isEmpty(), "embeddedobj.ole", "The object has already the temporary
file!" );
m_aTempURL = GetNewTempFileURL_Impl( m_xFactory );
return m_aTempURL;
@@ -934,7 +932,7 @@
{
if ( m_aTempURL.isEmpty() )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::GetTempURL_Impl,
tempfile creation" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::GetTempURL_Impl,
tempfile creation" );
// if there is no temporary file, it will be created from the own entry
uno::Reference< embed::XOptimizedStorage > xOptParStorage( m_xParentStorage,
uno::UNO_QUERY );
@@ -1046,7 +1044,7 @@
ucb::SimpleFileAccess::create( comphelper::getComponentContext(m_xFactory) ) );
uno::Reference< io::XInputStream > xTempInStream = xTempAccess->openFileRead( m_aTempURL );
- OSL_ENSURE( xTempInStream.is(), "The object's temporary file can not be reopened for
reading!\n" );
+ SAL_WARN_IF( !xTempInStream.is(), "embeddedobj.ole", "The object's temporary file can not be
reopened for reading!\n" );
// TODO: use bStoreVisReplace
@@ -1218,7 +1216,7 @@
if ( !xCachedVisualRepresentation.is() )
xCachedVisualRepresentation = TryToRetrieveCachedVisualRepresentation_Impl(
xTargetStream );
- OSL_ENSURE( xCachedVisualRepresentation.is(), "No representation is available!" );
+ SAL_WARN_IF( !xCachedVisualRepresentation.is(), "embeddedobj.ole", "No representation
is available!" );
// the following copying will be done in case it is SaveAs anyway
// if it is not SaveAs the seekable access is not required currently
@@ -1293,7 +1291,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::setPersistentEntry" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::setPersistentEntry" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY );
@@ -1501,7 +1499,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeToEntry" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeToEntry" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY );
@@ -1535,7 +1533,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeAsEntry" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeAsEntry" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY );
@@ -1564,7 +1562,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::saveCompleted" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::saveCompleted" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY );
@@ -1591,7 +1589,7 @@
if ( !m_bWaitSaveCompleted && !bUseNew )
return;
- OSL_ENSURE( m_bWaitSaveCompleted, "Unexpected saveCompleted() call!\n" );
+ SAL_WARN_IF( !m_bWaitSaveCompleted, "embeddedobj.ole", "Unexpected saveCompleted() call!\n" );
if ( !m_bWaitSaveCompleted )
throw io::IOException(); // TODO: illegal call
@@ -1611,7 +1609,7 @@
// close remembered stream
try {
uno::Reference< lang::XComponent > xComponent( m_xNewObjectStream, uno::UNO_QUERY );
- OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" );
+ SAL_WARN_IF( !xComponent.is(), "embeddedobj.ole", "Wrong storage implementation!" );
if ( xComponent.is() )
xComponent->dispose();
}
@@ -1729,7 +1727,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeOwn" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeOwn" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY );
@@ -1805,7 +1803,7 @@
else
{
m_xCachedVisualRepresentation = TryToRetrieveCachedVisualRepresentation_Impl(
m_xObjectStream );
- OSL_ENSURE( m_xCachedVisualRepresentation.is(), "No representation is available!"
);
+ SAL_WARN_IF( !m_xCachedVisualRepresentation.is(), "embeddedobj.ole", "No
representation is available!" );
}
}
else
diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx
index d09d2aa..801b93e 100644
--- a/embeddedobj/source/msole/olevisual.cxx
+++ b/embeddedobj/source/msole/olevisual.cxx
@@ -25,8 +25,6 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
-#include <rtl/logfile.hxx>
-
#include <oleembobj.hxx>
#include <olecomponent.hxx>
#include <comphelper/mimeconfighelper.hxx>
@@ -81,7 +79,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::setVisualAreaSize" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::setVisualAreaSize" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -97,7 +95,7 @@
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects
no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -126,7 +124,7 @@
}
catch( const uno::Exception& )
{
- OSL_FAIL( "The object should not be resized without activation!\n" );
+ SAL_WARN( "embeddedobj.ole", "The object should not be resized without activation!\n"
);
}
aGuard.reset();
}
@@ -162,7 +160,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getVisualAreaSize" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getVisualAreaSize" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -177,7 +175,7 @@
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects
no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -209,7 +207,7 @@
sal_Bool bSuccess = sal_False;
if ( getCurrentState() == embed::EmbedStates::LOADED )
{
- OSL_FAIL( "Loaded object has no cached size!\n" );
+ SAL_WARN( "embeddedobj.ole", "Loaded object has no cached size!\n" );
// try to switch the object to RUNNING state and request the value again
try {
@@ -290,7 +288,7 @@
// return cached value
if ( m_bHasCachedSize )
{
- OSL_ENSURE( nAspect == m_nCachedAspect, "Unexpected aspect is requested!\n" );
+ SAL_WARN_IF( nAspect != m_nCachedAspect, "embeddedobj.ole", "Unexpected aspect is
requested!\n" );
aResult = m_aCachedSize;
}
else
@@ -310,7 +308,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObject::getPreferredVisualRepresentation" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObject::getPreferredVisualRepresentation" );
// begin wrapping related part ====================
uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject;
@@ -325,7 +323,7 @@
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects
no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
@@ -418,7 +416,7 @@
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
- OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical
replacement is required!\n" );
+ SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects
no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
throw embed::WrongStateException( OUString( "Illegal call!\n" ),
diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx
index fb3baeb..11e7a7f 100644
--- a/embeddedobj/source/msole/xolefactory.cxx
+++ b/embeddedobj/source/msole/xolefactory.cxx
@@ -24,9 +24,6 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/embed/Aspects.hpp>
-#include <rtl/logfile.hxx>
-
-
#include "xolefactory.hxx"
#include "oleembobj.hxx"
@@ -69,7 +66,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitFromEntry" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitFromEntry" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -141,7 +138,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -183,7 +180,7 @@
uno::Exception,
uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitNew" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceInitNew" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -224,7 +221,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceLink" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceLink" );
if ( !xStorage.is() )
throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
@@ -270,7 +267,7 @@
uno::Exception,
uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceUserInit" );
+ SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033)
OleEmbeddedObjectFactory::createInstanceUserInit" );
// the initialization is completelly controlled by user
if ( !xStorage.is() )
--
To view, visit https://gerrit.libreoffice.org/4044
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4e90b83a7275bfd30914f7514a609cebbfbf4ac
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Ioan Radu <ioan.radu.g@gmail.com>
Context
- [PATCH] fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFO · Ioan Radu (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.