INTEGRATION: CWS warnings01 (1.7.42); FILE MERGED

2005/09/22 15:38:58 sb 1.7.42.2: RESYNC: (1.7-1.8); FILE MERGED
2005/09/07 11:05:30 sb 1.7.42.1: #i53898# Made code warning-free.
This commit is contained in:
Jens-Heiner Rechtien
2006-06-19 09:34:22 +00:00
parent 4e2788de19
commit 0f44758c63

View File

@@ -4,9 +4,9 @@
* *
* $RCSfile: macro_expander.cxx,v $ * $RCSfile: macro_expander.cxx,v $
* *
* $Revision: 1.8 $ * $Revision: 1.9 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 09:27:49 $ * last change: $Author: hr $ $Date: 2006-06-19 10:34:22 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@@ -124,20 +124,20 @@ public:
//__________________________________________________________________________________________________ //__________________________________________________________________________________________________
void Bootstrap_MacroExpander::disposing() void Bootstrap_MacroExpander::disposing()
{ {
if (m_bstrap) rtlBootstrapHandle h;
{ {
rtl_bootstrap_args_close( m_bstrap ); osl::MutexGuard g(m_mutex);
h = m_bstrap;
m_bstrap = 0; m_bstrap = 0;
} }
if (h) {
rtl_bootstrap_args_close(h);
}
} }
//__________________________________________________________________________________________________ //__________________________________________________________________________________________________
Bootstrap_MacroExpander::~Bootstrap_MacroExpander() SAL_THROW( () ) Bootstrap_MacroExpander::~Bootstrap_MacroExpander() SAL_THROW( () )
{ {
if (m_bstrap) disposing();
{
rtl_bootstrap_args_close( m_bstrap );
m_bstrap = 0;
}
} }
// XServiceInfo impl // XServiceInfo impl
@@ -199,35 +199,18 @@ void SAL_CALL Bootstrap_MacroExpander::initialize(
OUString Bootstrap_MacroExpander::expandMacros( OUString const & exp ) OUString Bootstrap_MacroExpander::expandMacros( OUString const & exp )
throw (lang::IllegalArgumentException) throw (lang::IllegalArgumentException)
{ {
// determine bootstrap handle rtlBootstrapHandle h;
rtlBootstrapHandle bstrap; if (m_rc_path.getLength() != 0) {
if (m_rc_path.getLength()) osl::MutexGuard g(m_mutex);
{ if (!m_bstrap) {
// late init m_bstrap = rtl_bootstrap_args_open(m_rc_path.pData);
if (! m_bstrap)
{
rtlBootstrapHandle bstrap = rtl_bootstrap_args_open( m_rc_path.pData );
ClearableMutexGuard guard( Mutex::getGlobalMutex() );
if (m_bstrap)
{
guard.clear();
rtl_bootstrap_args_close( bstrap );
} }
else h = m_bstrap;
{ } else {
m_bstrap = bstrap; h = cppu::get_unorc().getHandle();
} }
}
bstrap = m_bstrap;
}
else
{
bstrap = ::cppu::get_unorc().getHandle();
}
// expand
OUString ret( exp ); OUString ret( exp );
rtl_bootstrap_expandMacros_from_handle( bstrap, &ret.pData ); rtl_bootstrap_expandMacros_from_handle( h, &ret.pData );
return ret; return ret;
} }