diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-05-10 23:04:45 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-05-10 23:14:19 +0200 |
commit | 2241dd8d83fa8a89502ad7985427c5c79d94ce21 (patch) | |
tree | a9a9b961468877fb6a7bece971c62bb6fb137ab6 /sd | |
parent | 3440766f0ad43454287a874b5fd34b6f2af6bdf1 (diff) |
SdStyleSheetPool: de-dent that
Change-Id: Ifce20de3068e12c42bfcd115ad852371f97b971c
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/stlpool.cxx | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 26490e0d7b9c..84e970a96f8e 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -688,32 +688,30 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily bAddToList = true; } } + // we do not already have a sheet with the same name and contents. Create a new one. + if (!pExistingSheet) { - // we do not already have a sheet with the same name and contents. Create a new one. - if (!pExistingSheet) - { - assert(!Find(aName, eFamily)); - rtl::Reference< SfxStyleSheetBase > xNewSheet( &Make( aName, eFamily ) ); + assert(!Find(aName, eFamily)); + rtl::Reference< SfxStyleSheetBase > xNewSheet( &Make( aName, eFamily ) ); - xNewSheet->SetMask( xSheet->GetMask() ); + xNewSheet->SetMask( xSheet->GetMask() ); - // Also set parent relation for copied style sheets - OUString aParent( xSheet->GetParent() ); - if( !aParent.isEmpty() ) - aNewStyles.push_back( std::pair< rtl::Reference< SfxStyleSheetBase >, OUString >( xNewSheet, aParent ) ); + // Also set parent relation for copied style sheets + OUString aParent( xSheet->GetParent() ); + if( !aParent.isEmpty() ) + aNewStyles.push_back( std::pair< rtl::Reference< SfxStyleSheetBase >, OUString >( xNewSheet, aParent ) ); - xNewSheet->SetHelpId( aHelpFile, xSheet->GetHelpId( aHelpFile ) ); - xNewSheet->GetItemSet().Put( xSheet->GetItemSet() ); + xNewSheet->SetHelpId( aHelpFile, xSheet->GetHelpId( aHelpFile ) ); + xNewSheet->GetItemSet().Put( xSheet->GetItemSet() ); - rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( xNewSheet.get() ) ) ); - aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) ); - } - else if (bAddToList) - { - // Add to list - used for renaming - rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pExistingSheet ) ) ); - aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) ); - } + rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( xNewSheet.get() ) ) ); + aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) ); + } + else if (bAddToList) + { + // Add to list - used for renaming + rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pExistingSheet ) ) ); + aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) ); } } |