summaryrefslogtreecommitdiff
path: root/sd/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/core')
-rwxr-xr-xsd/source/core/shapelist.cxx38
-rwxr-xr-x[-rw-r--r--]sd/source/core/stlsheet.cxx41
2 files changed, 18 insertions, 61 deletions
diff --git a/sd/source/core/shapelist.cxx b/sd/source/core/shapelist.cxx
index bf5b98471b53..4bb14b642f79 100755
--- a/sd/source/core/shapelist.cxx
+++ b/sd/source/core/shapelist.cxx
@@ -84,44 +84,6 @@ SdrObject* ShapeList::removeShape( SdrObject& rObject )
return 0;
}
-void ShapeList::replaceShape( SdrObject& rOldObject, SdrObject& rNewObject )
-{
- if( &rOldObject == &rNewObject )
- return;
-
- ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rNewObject ) );
- if( aIter != maShapeList.end() )
- {
- bool bIterErased = aIter == maIter;
- (*aIter)->RemoveObjectUser(*this);
- aIter = maShapeList.erase( aIter );
-
- if( bIterErased )
- maIter = aIter;
- }
-
- aIter = std::find( maShapeList.begin(), maShapeList.end(), &rOldObject );
- if( aIter != maShapeList.end() )
- {
- bool bIterErased = aIter == maIter;
-
- ListImpl::iterator iNew( maShapeList.insert( aIter, &rNewObject ) );
-
- (*aIter)->RemoveObjectUser(*this);
- aIter = maShapeList.erase( aIter );
-
- rNewObject.AddObjectUser( *this );
-
- if( bIterErased )
- maIter = iNew;
- }
- else
- {
- DBG_ERROR("sd::ShapeList::replaceShape(), given shape not part of list!");
- addShape( rNewObject );
- }
-}
-
/** removes all shapes from this list
NOTE: iterators will become invalid */
void ShapeList::clear()
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 7e090d0e9a98..51d1375c9984 100644..100755
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1003,13 +1003,11 @@ void SAL_CALL SdStyleSheet::setName( const OUString& rName ) throw(RuntimeExcep
{
OGuard aGuard( Application::GetSolarMutex() );
throwIfDisposed();
- if( IsUserDefined() )
+
+ if( SetName( rName ) )
{
- if( SetName( rName ) )
- {
- msApiName = rName;
- Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
- }
+ msApiName = rName;
+ Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
}
}
@@ -1056,28 +1054,25 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& rParentName ) throw
OGuard aGuard( Application::GetSolarMutex() );
throwIfDisposed();
- if( IsUserDefined() )
+ if( rParentName.getLength() )
{
- if( rParentName.getLength() )
- {
- const SfxStyles& rStyles = mxPool->GetStyles();
+ const SfxStyles& rStyles = mxPool->GetStyles();
- for( SfxStyles::const_iterator iter( rStyles.begin() ); iter != rStyles.end(); iter++ )
+ for( SfxStyles::const_iterator iter( rStyles.begin() ); iter != rStyles.end(); iter++ )
+ {
+ SdStyleSheet* pStyle = static_cast< SdStyleSheet* >( (*iter).get() );
+ if( pStyle && (pStyle->nFamily == nFamily) && (pStyle->msApiName == rParentName) )
{
- SdStyleSheet* pStyle = static_cast< SdStyleSheet* >( (*iter).get() );
- if( pStyle && (pStyle->nFamily == nFamily) && (pStyle->msApiName == rParentName) )
- {
- if( pStyle != this )
- SetParent( pStyle->GetName() );
- return;
- }
+ if( pStyle != this )
+ SetParent( pStyle->GetName() );
+ return;
}
- throw NoSuchElementException();
- }
- else
- {
- SetParent( rParentName );
}
+ throw NoSuchElementException();
+ }
+ else
+ {
+ SetParent( rParentName );
}
}