summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/table/tablecontroller.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 38a41b5ae04f..64b40da926c2 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1081,14 +1081,19 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
{
SfxItemSet aSet( xCell->GetItemSet() );
bool bChanges = false;
- const SfxItemSet& rStyleAttribs = xCell->GetStyleSheet()->GetItemSet();
-
- for ( sal_uInt16 nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
+ SfxStyleSheet *pStyleSheet = xCell->GetStyleSheet();
+ SAL_WARN_IF(!pStyleSheet, "svx", "no stylesheet for table cell?");
+ if (pStyleSheet)
{
- if( (rStyleAttribs.GetItemState( nWhich ) == SfxItemState::SET) && (aSet.GetItemState( nWhich ) == SfxItemState::SET) )
+ const SfxItemSet& rStyleAttribs = pStyleSheet->GetItemSet();
+
+ for ( sal_uInt16 nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
{
- aSet.ClearItem( nWhich );
- bChanges = true;
+ if( (rStyleAttribs.GetItemState( nWhich ) == SfxItemState::SET) && (aSet.GetItemState( nWhich ) == SfxItemState::SET) )
+ {
+ aSet.ClearItem( nWhich );
+ bChanges = true;
+ }
}
}