diff options
author | Christian Lippka <christian.lippka@oracle.com> | 2010-10-04 13:40:44 +0200 |
---|---|---|
committer | Christian Lippka <christian.lippka@oracle.com> | 2010-10-04 13:40:44 +0200 |
commit | 011f9c9c2d7d323e0eebfb57bc4af94d881eb653 (patch) | |
tree | 3593db23864f7007341cf7a27017a422256eb3c2 /sd/source/core | |
parent | 4518c75201381b5b693f091b3d99980e5291b0f1 (diff) |
impress201: #i113805# removed limitation to allow change of style name and parent for not pre defined styles
Diffstat (limited to 'sd/source/core')
-rwxr-xr-x[-rw-r--r--] | sd/source/core/stlsheet.cxx | 41 |
1 files changed, 18 insertions, 23 deletions
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 ); } } |