diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-06 10:45:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-06 13:43:37 +0200 |
commit | 097cb414ab890f4a1bc4a3f826b5cbc10f0b8ec8 (patch) | |
tree | b04bf46979b9cdb963a0f3704480e1b16fd27d32 /sc/source/ui/view | |
parent | 9b50c4f63c2ecb95245511940dacb3e91027499f (diff) |
pOldOuter etc couldn't be null
Change-Id: I0fb0168fa4199a21640e248ee3bb4b88608b1597
Reviewed-on: https://gerrit.libreoffice.org/38432
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index ca21a561fed8..96ac268c1f80 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -909,15 +909,15 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet, // font language has changed. Redo the online spelling. ResetAutoSpell(); - const SvxBoxItem* pOldOuter = static_cast<const SvxBoxItem*> (&pOldSet->Get( ATTR_BORDER )); - const SvxBoxItem* pNewOuter = static_cast<const SvxBoxItem*> (&pDialogSet->Get( ATTR_BORDER )); - const SvxBoxInfoItem* pOldInner = static_cast<const SvxBoxInfoItem*> (&pOldSet->Get( ATTR_BORDER_INNER )); - const SvxBoxInfoItem* pNewInner = static_cast<const SvxBoxInfoItem*> (&pDialogSet->Get( ATTR_BORDER_INNER )); + const SvxBoxItem& rOldOuter = static_cast<const SvxBoxItem&> (pOldSet->Get(ATTR_BORDER)); + const SvxBoxItem& rNewOuter = static_cast<const SvxBoxItem&> (pDialogSet->Get(ATTR_BORDER)); + const SvxBoxInfoItem& rOldInner = static_cast<const SvxBoxInfoItem&> (pOldSet->Get(ATTR_BORDER_INNER)); + const SvxBoxInfoItem& rNewInner = static_cast<const SvxBoxInfoItem&> (pDialogSet->Get(ATTR_BORDER_INNER)); SfxItemSet& rNewSet = aNewAttrs.GetItemSet(); SfxItemPool* pNewPool = rNewSet.GetPool(); - pNewPool->Put( *pNewOuter ); // don't delete yet - pNewPool->Put( *pNewInner ); + pNewPool->Put(rNewOuter); // don't delete yet + pNewPool->Put(rNewInner); rNewSet.ClearItem( ATTR_BORDER ); rNewSet.ClearItem( ATTR_BORDER_INNER ); @@ -931,44 +931,38 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet, bool bFrame = (pDialogSet->GetItemState( ATTR_BORDER ) != SfxItemState::DEFAULT) || (pDialogSet->GetItemState( ATTR_BORDER_INNER ) != SfxItemState::DEFAULT); - if ( pNewOuter==pOldOuter && pNewInner==pOldInner ) + if (&rNewOuter == &rOldOuter && &rNewInner == &rOldInner) bFrame = false; // this should be intercepted by the pool: ?!??!?? - if ( bFrame && pNewOuter && pNewInner ) - if ( *pNewOuter == *pOldOuter && *pNewInner == *pOldInner ) - bFrame = false; - - if ( pNewInner ) - { - bFrame = bFrame - && ( pNewInner->IsValid(SvxBoxInfoItemValidFlags::LEFT) - || pNewInner->IsValid(SvxBoxInfoItemValidFlags::RIGHT) - || pNewInner->IsValid(SvxBoxInfoItemValidFlags::TOP) - || pNewInner->IsValid(SvxBoxInfoItemValidFlags::BOTTOM) - || pNewInner->IsValid(SvxBoxInfoItemValidFlags::HORI) - || pNewInner->IsValid(SvxBoxInfoItemValidFlags::VERT) ); - } - else + if (bFrame && rNewOuter == rOldOuter && rNewInner == rOldInner) bFrame = false; + bFrame = bFrame + && ( rNewInner.IsValid(SvxBoxInfoItemValidFlags::LEFT) + || rNewInner.IsValid(SvxBoxInfoItemValidFlags::RIGHT) + || rNewInner.IsValid(SvxBoxInfoItemValidFlags::TOP) + || rNewInner.IsValid(SvxBoxInfoItemValidFlags::BOTTOM) + || rNewInner.IsValid(SvxBoxInfoItemValidFlags::HORI) + || rNewInner.IsValid(SvxBoxInfoItemValidFlags::VERT) ); + if (!bFrame) ApplySelectionPattern( aNewAttrs ); // standard only else { // if new items are default-items, overwrite the old items: - bool bDefNewOuter = IsStaticDefaultItem(pNewOuter); - bool bDefNewInner = IsStaticDefaultItem(pNewInner); + bool bDefNewOuter = IsStaticDefaultItem(&rNewOuter); + bool bDefNewInner = IsStaticDefaultItem(&rNewInner); ApplyPatternLines( aNewAttrs, - bDefNewOuter ? pOldOuter : pNewOuter, - bDefNewInner ? pOldInner : pNewInner ); + bDefNewOuter ? &rOldOuter : &rNewOuter, + bDefNewInner ? &rOldInner : &rNewInner ); } - pNewPool->Remove( *pNewOuter ); // release - pNewPool->Remove( *pNewInner ); + pNewPool->Remove(rNewOuter); // release + pNewPool->Remove(rNewInner); // adjust height AdjustBlockHeight(); |