diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/stlpool.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index f6ee1bddb9cb..3625bbf196c7 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -681,24 +681,26 @@ void SdStyleSheetPool::CopyLayoutSheets(const String& rLayoutName, SdStyleSheetP std::vector<SfxStyleSheetBase*> aOutlineSheets; CreateOutlineSheetList(rLayoutName,aOutlineSheets); - std::vector<SfxStyleSheetBase*>::iterator it = aOutlineSheets.begin(); - - SfxStyleSheetBase* pParent = *it; - ++it; - - while (it != aOutlineSheets.end()) + if( !aOutlineSheets.empty() ) { - pSheet = *it; + std::vector<SfxStyleSheetBase*>::iterator it = aOutlineSheets.begin(); + SfxStyleSheetBase* pParent = *it; + ++it; - if (!pSheet) - break; + while (it != aOutlineSheets.end()) + { + pSheet = *it; - if (pSheet->GetParent().Len() == 0) - pSheet->SetParent(pParent->GetName()); + if (!pSheet) + break; - pParent = pSheet; + if (pSheet->GetParent().Len() == 0) + pSheet->SetParent(pParent->GetName()); - ++it; + pParent = pSheet; + + ++it; + } } } |