diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-01-10 11:42:11 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-01-10 12:06:00 +0100 |
commit | 897aa4fa71813ca188b0e1e01ca41ca1e35d415d (patch) | |
tree | c58cf7af66b6f31aeaaac5f6f8e4e6ad8a500491 | |
parent | Translate German comments and correct a few English ones (diff) | |
download | core-897aa4fa71813ca188b0e1e01ca41ca1e35d415d.tar.gz core-897aa4fa71813ca188b0e1e01ca41ca1e35d415d.zip |
Tools container rework regression fix (for fdo#41657)
Don't de-reference invalid iterator (and no point in doing anything
with an empty style sheet list anyway).
-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; + } } } |