summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-16 11:25:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-18 19:57:03 +0200
commit0abf2ac27859f1e91a3d183b81948b1fe8f5aca3 (patch)
tree00103445f77dc18675daa4dfaf583fcb92942043 /sc/source
parent78c255519aac33b14c6d46fb963f8ecbbb80e67c (diff)
AppendContentsIfInRefDoc never passed a null ScDocument*
Change-Id: Ia21f8fecdf8a6aea7ea9c6ea4d579c5e53882bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102982 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/chgtrack.cxx10
-rw-r--r--sc/source/ui/undo/undoblk3.cxx7
2 files changed, 9 insertions, 8 deletions
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index a1779618333f..84848a57e540 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -2768,21 +2768,21 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange,
}
}
-void ScChangeTrack::AppendContentsIfInRefDoc( ScDocument* pRefDoc,
+void ScChangeTrack::AppendContentsIfInRefDoc( ScDocument& rRefDoc,
sal_uLong& nStartAction, sal_uLong& nEndAction )
{
- ScCellIterator aIter(pRefDoc, ScRange(0,0,0,rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB));
+ ScCellIterator aIter(&rRefDoc, ScRange(0,0,0,rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB));
if (aIter.first())
{
nStartAction = GetActionMax() + 1;
StartBlockModify( ScChangeTrackMsgType::Append, nStartAction );
- SvNumberFormatter* pFormatter = pRefDoc->GetFormatTable();
+ SvNumberFormatter* pFormatter = rRefDoc.GetFormatTable();
do
{
const ScAddress& rPos = aIter.GetPos();
- const ScPatternAttr* pPat = pRefDoc->GetPattern(rPos);
+ const ScPatternAttr* pPat = rRefDoc.GetPattern(rPos);
AppendContent(
- rPos, aIter.getCellValue(), pPat->GetNumberFormat(pFormatter), pRefDoc);
+ rPos, aIter.getCellValue(), pPat->GetNumberFormat(pFormatter), &rRefDoc);
}
while (aIter.next());
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index f08e420a4ad8..d7358831d75f 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -940,7 +940,7 @@ void ScUndoReplace::SetChangeTrack()
if ( pUndoDoc )
{ //! UndoDoc includes only the changed cells,
// that is why an Iterator can be used
- pChangeTrack->AppendContentsIfInRefDoc( pUndoDoc.get(),
+ pChangeTrack->AppendContentsIfInRefDoc( *pUndoDoc,
nStartChangeAction, nEndChangeAction );
}
else
@@ -1193,7 +1193,7 @@ void ScUndoConversion::SetChangeTrack()
if ( pChangeTrack )
{
if ( pUndoDoc )
- pChangeTrack->AppendContentsIfInRefDoc( pUndoDoc.get(),
+ pChangeTrack->AppendContentsIfInRefDoc( *pUndoDoc,
nStartChangeAction, nEndChangeAction );
else
{
@@ -1285,6 +1285,7 @@ pRedoDoc ( std::move(pNewRedoDoc) ),
aRange ( aMarkRange ),
bMulti ( bNewMulti )
{
+ assert(pUndoDoc && pUndoDoc);
SetChangeTrack();
}
@@ -1303,7 +1304,7 @@ void ScUndoRefConversion::SetChangeTrack()
{
ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
- pChangeTrack->AppendContentsIfInRefDoc( pUndoDoc.get(),
+ pChangeTrack->AppendContentsIfInRefDoc( *pUndoDoc,
nStartChangeAction, nEndChangeAction );
else
nStartChangeAction = nEndChangeAction = 0;