sw/source/core/edit/edfcol.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit be44b86998b2681d0de231bd9f5364a968e7c6b8 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Oct 5 12:18:59 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Oct 5 21:25:40 2020 +0200 SwEditShell::SignParagraph always dereferences GetDoc() Change-Id: I4f45db8fdab7679de0f7eacf8f14a24539ae0d5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103963 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 4323022526de..6fd50e7536d8 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1743,7 +1743,8 @@ void SwUndoParagraphSigning::Remove() void SwEditShell::SignParagraph() { - SwDocShell* pDocShell = GetDoc()->GetDocShell(); + SwDoc& rDoc = *GetDoc(); + SwDocShell* pDocShell = rDoc.GetDocShell(); if (!pDocShell || !GetCursor() || !GetCursor()->Start()) return; const SwPosition* pPosStart = GetCursor()->Start(); @@ -1801,17 +1802,17 @@ void SwEditShell::SignParagraph() SetParagraphSignatureValidation(bOldValidationFlag); }); - GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::PARA_SIGN_ADD, nullptr); + rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::PARA_SIGN_ADD, nullptr); const uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel(); uno::Reference<css::text::XTextField> xField = lcl_InsertParagraphSignature(xModel, xParagraph, signature, aUsage); lcl_UpdateParagraphSignatureField(*GetDoc(), xModel, xParagraph, xField, utf8Text); - GetDoc()->GetIDocumentUndoRedo().AppendUndo( + rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoParagraphSigning>(GetDoc(), xField, xParagraph, true)); - GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::PARA_SIGN_ADD, nullptr); + rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::PARA_SIGN_ADD, nullptr); } void SwEditShell::ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits