summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbapalette.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/vba/vbapalette.cxx')
-rw-r--r--sc/source/ui/vba/vbapalette.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index 4010200a370f..557b00937e0b 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -95,10 +95,11 @@ ScVbaPalette::getPalette() const
{
uno::Reference< container::XIndexAccess > xIndex;
uno::Reference< beans::XPropertySet > xProps;
- if ( m_pShell )
- xProps.set( m_pShell->GetModel(), uno::UNO_QUERY_THROW );
- else
+ if ( !m_pShell )
throw uno::RuntimeException("Can't extract palette, no doc shell" );
+
+ xProps.set( m_pShell->GetModel(), uno::UNO_QUERY_THROW );
+
xIndex.set( xProps->getPropertyValue("ColorPalette"), uno::UNO_QUERY );
if ( !xIndex.is() )
return new DefaultPalette();