diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-06 12:52:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-06 17:13:00 +0200 |
commit | 44f4ebc0325623ed81a4021ed0d6939bd6c0c41f (patch) | |
tree | 80c4ff21799fffa433b7f5274b486563c34f59a7 /sc/source | |
parent | tdf#104450: Use Calibri; let LO to fallback to Carlito (diff) | |
download | core-44f4ebc0325623ed81a4021ed0d6939bd6c0c41f.tar.gz core-44f4ebc0325623ed81a4021ed0d6939bd6c0c41f.zip |
coverity#1412032 ApplyPatternLines always passed non-null 2nd arg
Change-Id: Ibf1754682a0d586a377709b8dacee1260a1f2ee1
Reviewed-on: https://gerrit.libreoffice.org/38445
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/viewfunc.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 12 |
3 files changed, 9 insertions, 11 deletions
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index de5ff455069f..94c304de0b65 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -162,9 +162,9 @@ public: void ApplyAttr( const SfxPoolItem& rAttrItem ); void ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursorOnly = false); - void ApplyPatternLines( const ScPatternAttr& rAttr, - const SvxBoxItem* pNewOuter, - const SvxBoxInfoItem* pNewInner ); + void ApplyPatternLines(const ScPatternAttr& rAttr, + const SvxBoxItem& rNewOuter, + const SvxBoxInfoItem* pNewInner); void ApplyUserItemSet( const SfxItemSet& rItemSet ); diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index c3057d7b4bcd..a39ceff96ceb 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -470,7 +470,7 @@ void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget) { ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (pLineOuter) - rViewShell.ApplyPatternLines( *pApplyPattern, pLineOuter, pLineInner ); + rViewShell.ApplyPatternLines(*pApplyPattern, *pLineOuter, pLineInner); else rViewShell.ApplySelectionPattern( *pApplyPattern ); } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 96ac268c1f80..8e0b13226a15 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -957,7 +957,7 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet, bool bDefNewInner = IsStaticDefaultItem(&rNewInner); ApplyPatternLines( aNewAttrs, - bDefNewOuter ? &rOldOuter : &rNewOuter, + bDefNewOuter ? rOldOuter : rNewOuter, bDefNewInner ? &rOldInner : &rNewInner ); } @@ -996,7 +996,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem ) // patterns and borders -void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem* pNewOuter, +void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem& rNewOuter, const SvxBoxInfoItem* pNewInner ) { ScDocument* pDoc = GetViewData().GetDocument(); @@ -1006,9 +1006,7 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem if (!pDoc->IsUndoEnabled()) bRecord = false; - bool bRemoveAdjCellBorder = false; - if( pNewOuter ) - bRemoveAdjCellBorder = pNewOuter->IsRemoveAdjacentCellBorder(); + bool bRemoveAdjCellBorder = rNewOuter.IsRemoveAdjacentCellBorder(); ScRange aMarkRange, aMarkRangeWithEnvelope; aFuncMark.MarkToSimple(); bool bMulti = aFuncMark.IsMultiMarked(); @@ -1058,13 +1056,13 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem pDocSh, aFuncMark, aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), aMarkRange.aStart.Tab(), aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(), aMarkRange.aEnd.Tab(), - pUndoDoc, bCopyOnlyMarked, &rAttr, pNewOuter, pNewInner, &aMarkRangeWithEnvelope ) ); + pUndoDoc, bCopyOnlyMarked, &rAttr, &rNewOuter, pNewInner, &aMarkRangeWithEnvelope ) ); } sal_uInt16 nExt = SC_PF_TESTMERGE; pDocSh->UpdatePaintExt( nExt, aMarkRangeWithEnvelope ); // content before the change - pDoc->ApplySelectionFrame( aFuncMark, pNewOuter, pNewInner ); + pDoc->ApplySelectionFrame(aFuncMark, &rNewOuter, pNewInner); pDocSh->UpdatePaintExt( nExt, aMarkRangeWithEnvelope ); // content after the change |