summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 09:34:22 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 09:34:22 +0000
commitf0e45972f3e720561ad44013a08679cd5d6a7ceb (patch)
tree8b801fb773c92f1be2cfa49a884921c0a4a329e4 /cppuhelper
parent64c9e3a0fd60028816b747c50c5880956d4aa8f9 (diff)
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.
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/macro_expander.cxx53
1 files changed, 18 insertions, 35 deletions
diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx
index 114721da5..3304be8f3 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -4,9 +4,9 @@
*
* $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 terms of GNU Lesser General Public License Version 2.1.
@@ -124,20 +124,20 @@ public:
//__________________________________________________________________________________________________
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;
}
+ if (h) {
+ rtl_bootstrap_args_close(h);
+ }
}
//__________________________________________________________________________________________________
Bootstrap_MacroExpander::~Bootstrap_MacroExpander() SAL_THROW( () )
{
- if (m_bstrap)
- {
- rtl_bootstrap_args_close( m_bstrap );
- m_bstrap = 0;
- }
+ disposing();
}
// XServiceInfo impl
@@ -199,35 +199,18 @@ void SAL_CALL Bootstrap_MacroExpander::initialize(
OUString Bootstrap_MacroExpander::expandMacros( OUString const & exp )
throw (lang::IllegalArgumentException)
{
- // determine bootstrap handle
- rtlBootstrapHandle bstrap;
- if (m_rc_path.getLength())
- {
- // late init
- 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
- {
- m_bstrap = bstrap;
- }
+ rtlBootstrapHandle h;
+ if (m_rc_path.getLength() != 0) {
+ osl::MutexGuard g(m_mutex);
+ if (!m_bstrap) {
+ m_bstrap = rtl_bootstrap_args_open(m_rc_path.pData);
}
- bstrap = m_bstrap;
+ h = m_bstrap;
+ } else {
+ h = cppu::get_unorc().getHandle();
}
- else
- {
- bstrap = ::cppu::get_unorc().getHandle();
- }
-
- // expand
OUString ret( exp );
- rtl_bootstrap_expandMacros_from_handle( bstrap, &ret.pData );
+ rtl_bootstrap_expandMacros_from_handle( h, &ret.pData );
return ret;
}