summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/core/stlpool.cxx2
-rw-r--r--svl/source/items/IndexedStyleSheets.cxx4
2 files changed, 5 insertions, 1 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 8a7cc23d11cc..19f3031993cb 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -655,6 +655,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
it != aSheetsWithFamily.end(); ++it )
{
rtl::Reference< SfxStyleSheetBase > xSheet = GetStyleSheetByPositionInIndex( *it );
+ if( !xSheet.is() )
+ continue;
rtl::OUString aName( xSheet->GetName() );
// now check whether we already have a sheet with the same name
diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx
index ca45b534ee92..087f8172f124 100644
--- a/svl/source/items/IndexedStyleSheets.cxx
+++ b/svl/source/items/IndexedStyleSheets.cxx
@@ -182,7 +182,9 @@ IndexedStyleSheets::HasStyleSheet(rtl::Reference< SfxStyleSheetBase > style) con
rtl::Reference< SfxStyleSheetBase >
IndexedStyleSheets::GetStyleSheetByPosition(unsigned pos)
{
- return mStyleSheets.at(pos);
+ if( pos < mStyleSheets.size() )
+ return mStyleSheets.at(pos);
+ return NULL;
}
void