diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-31 10:55:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-31 15:10:05 +0100 |
commit | f1d2442662a1c593c0ed47391156719ffdf9385f (patch) | |
tree | 981ca55751c7586938f4fe2d70b3801debf51fa7 /sc/source/ui | |
parent | c8da023efe26efcb166c3525ca73fe62f26e154c (diff) |
we always have a ScDocument so pass by reference
Change-Id: Ic82c71ea6d0490d17fcca07afe4f7da9441a5794
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158715
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 5691a67b9780..7ad32d4963b9 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1396,7 +1396,7 @@ void ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c if (pNewNote) { ScDocShell::LOKCommentNotify(hadOldNote ? LOKCommentNotificationType::Modify : LOKCommentNotificationType::Add, - &rDoc, rPos, pNewNote); + rDoc, rPos, pNewNote); } } else if (!bApi) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 0ef5be3c50e8..f8a33f91d1e8 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2535,9 +2535,9 @@ bool ScDocShell::DdeSetData( const OUString& rItem, return pObj; } -void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument* pDocument, const ScAddress& rPos, const ScPostIt* pNote) +void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote) { - if ( !pDocument->IsDocVisible() || // don't want callbacks until document load + if ( !rDocument.IsDocVisible() || // don't want callbacks until document load !comphelper::LibreOfficeKit::isActive() || comphelper::LibreOfficeKit::isTiledAnnotations() ) return; @@ -2562,7 +2562,7 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu // Calculating the cell cursor position ScViewData* pViewData = GetViewData(); if (pViewData && pViewData->GetActiveWin()) - aAnnotation.put("cellRange", ScPostIt::NoteRangeToJsonString(*pDocument, rPos)); + aAnnotation.put("cellRange", ScPostIt::NoteRangeToJsonString(rDocument, rPos)); } } diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index a2bbb5454573..eb9a3450ad22 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -403,7 +403,7 @@ public: static OUString GetDBaseFilterName(); static OUString GetDifFilterName(); static bool HasAutomaticTableName( std::u16string_view rFilter ); - static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument* pDocument, const ScAddress& rPos, const ScPostIt* pNote); + static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote); DECL_DLLPRIVATE_LINK( RefreshDBDataHdl, Timer*, void ); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 16c79ea457f5..4cb9d03fed6d 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -812,7 +812,7 @@ void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData ) OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" ); ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false ); rDoc.SetNote( maPos, std::unique_ptr<ScPostIt>(pNote) ); - ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, &rDoc, maPos, pNote); + ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, rDoc, maPos, pNote); } } @@ -829,7 +829,7 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData ) caption object from the drawing layer while deleting pNote (removing the caption is done by a drawing undo action). */ pNote->ForgetCaption(); - ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, &rDoc, maPos, pNote.get()); + ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, rDoc, maPos, pNote.get()); } } |