summaryrefslogtreecommitdiffstats
path: root/comphelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-06 19:03:52 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-06 22:23:48 +0100
commit2a6ca136a151d23e0b651b308549dfe98188b160 (patch)
tree292af830ac52b07247d525993c2483281735344c /comphelper
parentjsdialog: enable calc formula error dialog (diff)
downloadcore-2a6ca136a151d23e0b651b308549dfe98188b160.tar.gz
core-2a6ca136a151d23e0b651b308549dfe98188b160.zip
cid#1560051 Missing move assignment operator
Change-Id: Ie59d391cd68f9d90fd8ac99a81ba8b997221165a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161716 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/logging.cxx35
1 files changed, 22 insertions, 13 deletions
diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx
index 3bce820a82ac..ae150290bedd 100644
--- a/comphelper/source/misc/logging.cxx
+++ b/comphelper/source/misc/logging.cxx
@@ -48,24 +48,33 @@ namespace comphelper
const Reference< XLogger >& getLogger() const { return m_xLogger; }
};
- EventLogger_Impl::EventLogger_Impl( const Reference< XComponentContext >& _rxContext, const OUString& _rLoggerName )
- :m_aContext( _rxContext )
+ namespace
{
- try
+ Reference<XLogger> createLogger(const Reference<XComponentContext>& rxContext, const OUString& rLoggerName)
{
- Reference< XLoggerPool > xPool( LoggerPool::get( m_aContext ) );
- if ( !_rLoggerName.isEmpty() )
- m_xLogger = xPool->getNamedLogger( _rLoggerName );
- else
- m_xLogger = xPool->getDefaultLogger();
- }
- catch( const Exception& )
- {
- TOOLS_WARN_EXCEPTION(
- "comphelper", "EventLogger_Impl::impl_createLogger_nothrow: caught an exception!" );
+ try
+ {
+ Reference<XLoggerPool> xPool(LoggerPool::get(rxContext));
+ if (!rLoggerName.isEmpty())
+ return xPool->getNamedLogger(rLoggerName);
+ else
+ return xPool->getDefaultLogger();
+ }
+ catch( const Exception& )
+ {
+ TOOLS_WARN_EXCEPTION(
+ "comphelper", "EventLogger_Impl::impl_createLogger_nothrow: caught an exception!" );
+ }
+ return Reference<XLogger>();
}
}
+ EventLogger_Impl::EventLogger_Impl(const Reference< XComponentContext >& _rxContext, const OUString& rLoggerName)
+ : m_aContext(_rxContext)
+ , m_xLogger(createLogger(_rxContext, rLoggerName))
+ {
+ }
+
EventLogger::EventLogger( const Reference< XComponentContext >& _rxContext, const char* _pAsciiLoggerName )
:m_pImpl( std::make_shared<EventLogger_Impl>( _rxContext, OUString::createFromAscii( _pAsciiLoggerName ) ) )
{