summaryrefslogtreecommitdiff
path: root/ucb/source/core/ucbstore.cxx
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2000-10-26 11:34:56 +0000
committerKai Sommerfeld <kso@openoffice.org>2000-10-26 11:34:56 +0000
commit8bc7078c9ac309d2ed33f3e1534a328fe14b9df2 (patch)
tree600bf42f7b2261d293963b9cfaf324b8e99199eb /ucb/source/core/ucbstore.cxx
parentace52b78ef7fa28bdbe200efeda291ef19dab67d (diff)
Fixed: Assert conditions in PropertySetRegistry::removePropertySet(...).
Diffstat (limited to 'ucb/source/core/ucbstore.cxx')
-rw-r--r--ucb/source/core/ucbstore.cxx136
1 files changed, 69 insertions, 67 deletions
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 3d2156294915..fe2ca48b38e6 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucbstore.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kso $ $Date: 2000-10-25 06:32:48 $
+ * last change: $Author: kso $ $Date: 2000-10-26 12:34:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -556,90 +556,92 @@ PropertySetRegistry::openPropertySet( const OUString& key, sal_Bool create )
void SAL_CALL PropertySetRegistry::removePropertySet( const OUString& key )
throw( RuntimeException )
{
- if ( key.getLength() )
- {
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ if ( !key.getLength() )
+ return;
- Reference< XHierarchicalNameAccess > xRootHierNameAccess(
+ osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+
+ Reference< XHierarchicalNameAccess > xRootHierNameAccess(
getRootConfigReadAccess(), UNO_QUERY );
- if ( xRootHierNameAccess.is() )
- {
- Reference< XStringEscape > xEsc( xRootHierNameAccess, UNO_QUERY );
+ if ( xRootHierNameAccess.is() )
+ {
+ Reference< XStringEscape > xEsc( xRootHierNameAccess, UNO_QUERY );
- OSL_ENSURE( xEsc.is(),
- "PropertySetRegistry::removePropertySet - "
- "No string escape!" );
+ OSL_ENSURE( xEsc.is(),
+ "PropertySetRegistry::removePropertySet - "
+ "No string escape!" );
- OUString aEscapedKey;
- if ( xEsc.is() )
+ OUString aEscapedKey;
+ if ( xEsc.is() )
+ {
+ try
{
- try
- {
- aEscapedKey = xEsc->escapeString( key );
- }
- catch ( IllegalArgumentException& )
- {
- // escapeString
+ aEscapedKey = xEsc->escapeString( key );
+ }
+ catch ( IllegalArgumentException& )
+ {
+ // escapeString
- OSL_ENSURE( xEsc.is(),
- "PropertySetRegistry::removePropertySet - "
- "caught IllegalArgumentException!" );
+ OSL_ENSURE( xEsc.is(),
+ "PropertySetRegistry::removePropertySet - "
+ "caught IllegalArgumentException!" );
- aEscapedKey = key;
- }
- }
- else
aEscapedKey = key;
+ }
+ }
+ else
+ aEscapedKey = key;
- // Propertyset in registry?
- if ( xRootHierNameAccess->hasByHierarchicalName( aEscapedKey ) )
- {
- Reference< XChangesBatch > xBatch(
+ // Propertyset in registry?
+ if ( !xRootHierNameAccess->hasByHierarchicalName( aEscapedKey ) )
+ return;
+
+ Reference< XChangesBatch > xBatch(
getConfigWriteAccess( OUString() ), UNO_QUERY );
- Reference< XNameContainer > xContainer( xBatch, UNO_QUERY );
+ Reference< XNameContainer > xContainer( xBatch, UNO_QUERY );
- OSL_ENSURE( xBatch.is(),
- "PropertySetRegistry::removePropertySet - "
- "No batch!" );
+ OSL_ENSURE( xBatch.is(),
+ "PropertySetRegistry::removePropertySet - "
+ "No batch!" );
- OSL_ENSURE( xContainer.is(),
- "PropertySetRegistry::removePropertySet - "
- "No conteiner!" );
+ OSL_ENSURE( xContainer.is(),
+ "PropertySetRegistry::removePropertySet - "
+ "No conteiner!" );
- if ( xBatch.is() && xContainer.is() )
- {
- try
- {
- // Remove item.
- xContainer->removeByName( aEscapedKey );
+ if ( xBatch.is() && xContainer.is() )
+ {
+ try
+ {
+ // Remove item.
+ xContainer->removeByName( aEscapedKey );
- // Commit changes.
- xBatch->commitChanges();
+ // Commit changes.
+ xBatch->commitChanges();
- // Success.
- return;
- }
- catch ( NoSuchElementException& )
- {
- // removeByName
+ // Success.
+ return;
+ }
+ catch ( NoSuchElementException& )
+ {
+ // removeByName
- OSL_ENSURE( sal_False,
- "PropertySetRegistry::removePropertySet - "
- "caught NoSuchElementException!" );
- return;
- }
- catch ( WrappedTargetException& )
- {
- // commitChanges
+ OSL_ENSURE( sal_False,
+ "PropertySetRegistry::removePropertySet - "
+ "caught NoSuchElementException!" );
+ return;
+ }
+ catch ( WrappedTargetException& )
+ {
+ // commitChanges
- OSL_ENSURE( sal_False,
- "PropertySetRegistry::removePropertySet - "
- "caught WrappedTargetException!" );
- return;
- }
- }
+ OSL_ENSURE( sal_False,
+ "PropertySetRegistry::removePropertySet - "
+ "caught WrappedTargetException!" );
+ return;
}
}
+
+ return;
}
OSL_ENSURE( sal_False, "PropertySetRegistry::removePropertySet - Error!" );