[Libreoffice-commits] core.git: sc/inc sc/source

Caolán McNamara caolanm at redhat.com
Tue Jun 6 16:00:12 UTC 2017


 sc/inc/document.hxx              |    6 +++---
 sc/source/core/data/document.cxx |   16 ++++++++--------
 sc/source/ui/undo/undoblk.cxx    |    2 +-
 sc/source/ui/undo/undoblk3.cxx   |    2 +-
 sc/source/ui/unoobj/cellsuno.cxx |    2 +-
 sc/source/ui/view/viewfunc.cxx   |    2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit c2b8e87e6be5597c5ef7f0d0b5fbd127a2d57009
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 6 13:04:30 2017 +0100

    2nd arg of ApplySelectionFrame is always not null
    
    Change-Id: I50a5c9c3f0f2b7424fa1b9b27ceeee9ae9348413

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index ca8a02769af4..9a179808ac10 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1593,9 +1593,9 @@ public:
     void            GetSelectionFrame( const ScMarkData& rMark,
                                        SvxBoxItem&      rLineOuter,
                                        SvxBoxInfoItem&  rLineInner );
-    void            ApplySelectionFrame( const ScMarkData& rMark,
-                                         const SvxBoxItem* pLineOuter,
-                                         const SvxBoxInfoItem* pLineInner );
+    void            ApplySelectionFrame(const ScMarkData& rMark,
+                                        const SvxBoxItem& rLineOuter,
+                                        const SvxBoxInfoItem* pLineInner);
     void            ApplyFrameAreaTab( const ScRange& rRange,
                                        const SvxBoxItem* pLineOuter,
                                        const SvxBoxInfoItem* pLineInner );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9d68bb5a5564..a72420c4e33f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5643,7 +5643,7 @@ bool ScDocument::IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 }
 
 void ScDocument::ApplySelectionFrame( const ScMarkData& rMark,
-                                      const SvxBoxItem* pLineOuter,
+                                      const SvxBoxItem& rLineOuter,
                                       const SvxBoxInfoItem* pLineInner )
 {
     ScRangeList aRangeList;
@@ -5658,15 +5658,15 @@ void ScDocument::ApplySelectionFrame( const ScMarkData& rMark,
             for ( size_t j=0; j < nRangeCount; j++ )
             {
                 ScRange aRange = *aRangeList[ j ];
-                maTabs[*itr]->ApplyBlockFrame( pLineOuter, pLineInner,
+                maTabs[*itr]->ApplyBlockFrame( &rLineOuter, pLineInner,
                     aRange.aStart.Col(), aRange.aStart.Row(),
                     aRange.aEnd.Col(),   aRange.aEnd.Row() );
             }
         }
     }
-    if( pLineOuter && pLineOuter->IsRemoveAdjacentCellBorder() )
+    if (rLineOuter.IsRemoveAdjacentCellBorder())
     {
-        SvxBoxItem aTmp0( *pLineOuter );
+        SvxBoxItem aTmp0(rLineOuter);
         aTmp0.SetLine( nullptr, SvxBoxItemLine::TOP );
         aTmp0.SetLine( nullptr, SvxBoxItemLine::BOTTOM );
         aTmp0.SetLine( nullptr, SvxBoxItemLine::LEFT );
@@ -5687,16 +5687,16 @@ void ScDocument::ApplySelectionFrame( const ScMarkData& rMark,
         SvxBoxInfoItem aTopInfo( aTmp1 );
         SvxBoxInfoItem aBottomInfo( aTmp1 );
 
-        if( pLineInner->IsValid( SvxBoxInfoItemValidFlags::TOP ) && !pLineOuter->GetTop() )
+        if (pLineInner->IsValid( SvxBoxInfoItemValidFlags::TOP ) && !rLineOuter.GetTop())
             aTopInfo.SetValid( SvxBoxInfoItemValidFlags::BOTTOM );
 
-        if( pLineInner->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) && !pLineOuter->GetBottom() )
+        if (pLineInner->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) && !rLineOuter.GetBottom())
             aBottomInfo.SetValid( SvxBoxInfoItemValidFlags::TOP );
 
-        if( pLineInner->IsValid( SvxBoxInfoItemValidFlags::LEFT ) && !pLineOuter->GetLeft() )
+        if (pLineInner->IsValid( SvxBoxInfoItemValidFlags::LEFT ) && !rLineOuter.GetLeft())
             aLeftInfo.SetValid( SvxBoxInfoItemValidFlags::RIGHT );
 
-        if( pLineInner->IsValid( SvxBoxInfoItemValidFlags::RIGHT ) &&  !pLineOuter->GetRight() )
+        if (pLineInner->IsValid( SvxBoxInfoItemValidFlags::RIGHT ) && !rLineOuter.GetRight())
             aRightInfo.SetValid( SvxBoxInfoItemValidFlags::LEFT );
 
         const ScRangeList& rRangeListTopEnvelope = rMark.GetTopEnvelope();
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index a13a3a50f1eb..5afa28553b49 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -2364,7 +2364,7 @@ void ScUndoBorder::Redo()
         aMark.SetMarkArea( aRange );
         aMark.SelectTable( nTab, true );
 
-        rDoc.ApplySelectionFrame(aMark, xOuter.get(), xInner.get());
+        rDoc.ApplySelectionFrame(aMark, *xOuter, xInner.get());
     }
     for (size_t i = 0; i < nCount; ++i)
         pDocShell->PostPaint( *(*xRanges)[i], PaintPartFlags::Grid, SC_PF_LINES | SC_PF_TESTMERGE );
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index a39ceff96ceb..35452714d868 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -414,7 +414,7 @@ void ScUndoSelectionAttr::DoChange( const bool bUndo )
         aMarkData.MarkToSimple();
 
         if (pLineOuter)
-            rDoc.ApplySelectionFrame( aMarkData, pLineOuter, pLineInner );
+            rDoc.ApplySelectionFrame(aMarkData, *pLineOuter, pLineInner);
     }
 
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 32f615aef1b2..d741224fe558 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1075,7 +1075,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
         aMark.SetMarkArea( aRange );
         aMark.SelectTable( nTab, true );
 
-        rDoc.ApplySelectionFrame( aMark, &rOuter, &rInner );
+        rDoc.ApplySelectionFrame(aMark, rOuter, &rInner);
         // don't need RowHeight if there is only a border
     }
 
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 8e0b13226a15..2c7e7c885242 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1062,7 +1062,7 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem
     sal_uInt16 nExt = SC_PF_TESTMERGE;
     pDocSh->UpdatePaintExt( nExt, aMarkRangeWithEnvelope ); // content before the change
 
-    pDoc->ApplySelectionFrame(aFuncMark, &rNewOuter, pNewInner);
+    pDoc->ApplySelectionFrame(aFuncMark, rNewOuter, pNewInner);
 
     pDocSh->UpdatePaintExt( nExt, aMarkRangeWithEnvelope ); // content after the change
 


More information about the Libreoffice-commits mailing list