diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-23 08:54:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-23 22:25:34 +0200 |
commit | 428d17a2ed068dcbb21eb66338ee7fcf2cfa8929 (patch) | |
tree | f84f14c91fa8661b89413db29bfbfe01cf2580f9 /sc/source/ui | |
parent | df7abb6981546aebebe69dc944f2a6555a7b669c (diff) |
some places where ScDocument* is never passed a nullptr
and so some nullptr checks can be removed
Change-Id: I7dedc2c6d054d9749db9766eaa3a5681842b2b69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103239
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dataprovider/dataprovider.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undodat.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 20 |
8 files changed, 20 insertions, 20 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 965e0b8e54a9..5de58eb6dd00 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -680,7 +680,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) m_pDoc->GetName( m_aBlock.aStart.Tab(), aTabName ); rDestDoc.RenameTab( 0, aTabName ); - rDestDoc.CopyStdStylesFrom( m_pDoc.get() ); + rDestDoc.CopyStdStylesFrom(*m_pDoc); SCCOL nStartX = m_aBlock.aStart.Col(); SCROW nStartY = m_aBlock.aStart.Row(); @@ -738,7 +738,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) ScRange aMergeRange = aDestRange; rDestDoc.ExtendMerge( aMergeRange, true ); - m_pDoc->CopyDdeLinks( &rDestDoc ); // copy values of DDE Links + m_pDoc->CopyDdeLinks( rDestDoc ); // copy values of DDE Links // page format (grid etc) and page size (maximum size for ole object) diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx index 8ad2ee0cf38d..1d1efc9d77d0 100644 --- a/sc/source/ui/dataprovider/dataprovider.cxx +++ b/sc/source/ui/dataprovider/dataprovider.cxx @@ -177,8 +177,8 @@ const std::vector<std::shared_ptr<sc::DataTransformation>>& ExternalDataSource:: return maDataTransformations; } -ExternalDataMapper::ExternalDataMapper(ScDocument* /*pDoc*/) - //mpDoc(pDoc) +ExternalDataMapper::ExternalDataMapper(ScDocument& /*rDoc*/) + //mrDoc(rDoc) { } diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index a7a265135a44..5a2be9602c8b 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1008,7 +1008,7 @@ void ScUndoPaste::DoChange(bool bUndo) } pRedoDoc.reset( new ScDocument( SCDOCMODE_UNDO ) ); - pRedoDoc->InitUndoSelected( &rDoc, aMarkData, bColInfo, bRowInfo ); + pRedoDoc->InitUndoSelected( rDoc, aMarkData, bColInfo, bRowInfo ); } // read "redo" data from the document in the first undo // all sheets - CopyToDocument skips those that don't exist in pRedoDoc diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 30a1a040c7a6..16148d5e61a9 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -1833,7 +1833,7 @@ void ScUndoDataForm::DoChange( const bool bUndo ) bool bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==rDoc.MaxCol() ); xRedoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - xRedoDoc->InitUndoSelected(&rDoc, *mxMarkData, bColInfo, bRowInfo); + xRedoDoc->InitUndoSelected(rDoc, *mxMarkData, bColInfo, bRowInfo); } // read "redo" data from the document in the first undo // all sheets - CopyToDocument skips those that don't exist in pRedoDoc diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index b43f49d9eb2e..d31180a0f4bf 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3251,7 +3251,7 @@ void SAL_CALL ScCellRangesBase::addChartDataChangeEventListener( const uno::Refe // failed to create unique name. return; - ScChartListener* pListener = new ScChartListener( aName, &rDoc, aRangesRef ); + ScChartListener* pListener = new ScChartListener( aName, rDoc, aRangesRef ); pListener->SetUno( aListener, this ); pColl->insert( pListener ); pListener->StartListeningTo(); diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 87812b90a94f..419c373d0980 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -237,7 +237,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName, } ScChartListener* pChartListener = - new ScChartListener( aName, &rDoc, xNewRanges ); + new ScChartListener( aName, rDoc, xNewRanges ); rDoc.GetChartListenerCollection()->insert( pChartListener ); pChartListener->StartListeningTo(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index b96c30d9d057..71afb1e75d34 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -315,7 +315,7 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont SCITEM_QUERYDATA>{} ); ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown); - pDBData->ExtendDataArea(&rDoc); + pDBData->ExtendDataArea(rDoc); pDBData->GetQueryParam( aQueryParam ); ScRange aArea; @@ -340,7 +340,7 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont SCITEM_QUERYDATA>{} ); ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown); - pDBData->ExtendDataArea(&rDoc); + pDBData->ExtendDataArea(rDoc); pDBData->GetQueryParam( aQueryParam ); ScRange aArea; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index d4463cee1828..a635c900460b 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -122,7 +122,7 @@ void ScViewFunc::CutToClip() if ( bRecord ) { pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); - pUndoDoc->InitUndoSelected( &rDoc, rMark ); + pUndoDoc->InitUndoSelected( rDoc, rMark ); // all sheets - CopyToDocument skips those that don't exist in pUndoDoc ScRange aCopyRange = aRange; aCopyRange.aStart.SetTab(0); @@ -1250,7 +1250,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, if ( bRecord ) { pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); - pUndoDoc->InitUndoSelected( &rDoc, aFilteredMark, bColInfo, bRowInfo ); + pUndoDoc->InitUndoSelected( rDoc, aFilteredMark, bColInfo, bRowInfo ); // all sheets - CopyToDocument skips those that don't exist in pUndoDoc SCTAB nTabCount = rDoc.GetTableCount(); @@ -1336,7 +1336,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, if ( pMixDoc ) // calculate with original data? { - rDoc.MixDocument( aUserRange, nFunction, bSkipEmpty, pMixDoc.get() ); + rDoc.MixDocument( aUserRange, nFunction, bSkipEmpty, *pMixDoc ); } pMixDoc.reset(); @@ -1549,7 +1549,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( if (rDoc.IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - pUndoDoc->InitUndoSelected(&rDoc, aMark, false, bRowInfo); + pUndoDoc->InitUndoSelected(rDoc, aMark, false, bRowInfo); rDoc.CopyToDocument(aMarkedRange, nUndoFlags, false, *pUndoDoc, &aMark); } @@ -1559,7 +1559,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( if ( nFlags & InsertDeleteFlags::CONTENTS ) { pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - pMixDoc->InitUndoSelected(&rDoc, aMark); + pMixDoc->InitUndoSelected(rDoc, aMark); rDoc.CopyToDocument(aMarkedRange, InsertDeleteFlags::CONTENTS, false, *pMixDoc, &aMark); } } @@ -1578,7 +1578,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( true, bAsLink, false, bSkipEmpty); if (pMixDoc) - rDoc.MixDocument(aMarkedRange, nFunction, bSkipEmpty, pMixDoc.get()); + rDoc.MixDocument(aMarkedRange, nFunction, bSkipEmpty, *pMixDoc); AdjustBlockHeight(); // update row heights before pasting objects @@ -1700,7 +1700,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( if (rDoc.IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - pUndoDoc->InitUndoSelected(&rDoc, aMark); + pUndoDoc->InitUndoSelected(rDoc, aMark); for (size_t i = 0, n = aRanges.size(); i < n; ++i) { rDoc.CopyToDocument( @@ -1714,7 +1714,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( if (nFlags & InsertDeleteFlags::CONTENTS) { pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - pMixDoc->InitUndoSelected(&rDoc, aMark); + pMixDoc->InitUndoSelected(rDoc, aMark); for (size_t i = 0, n = aRanges.size(); i < n; ++i) { rDoc.CopyToDocument( @@ -1739,7 +1739,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( if (pMixDoc) { for (size_t i = 0, n = aRanges.size(); i < n; ++i) - rDoc.MixDocument(aRanges[i], nFunction, bSkipEmpty, pMixDoc.get()); + rDoc.MixDocument(aRanges[i], nFunction, bSkipEmpty, *pMixDoc); } AdjustBlockHeight(); // update row heights before pasting objects @@ -1978,7 +1978,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , if ( bRecord ) { pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); - pUndoDoc->InitUndoSelected( &rDoc , rMark , bColInfo , bRowInfo ); + pUndoDoc->InitUndoSelected( rDoc , rMark , bColInfo , bRowInfo ); rDoc.CopyToDocument( aUserRange , InsertDeleteFlags::VALUE , false, *pUndoDoc ); } sal_uInt16 nExtFlags = 0; |