diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-05 12:18:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-05 21:25:40 +0200 |
commit | be44b86998b2681d0de231bd9f5364a968e7c6b8 (patch) | |
tree | 9d89691c3cefba01cd78d260b4c826003ebe6641 /sw/source/core/edit/edfcol.cxx | |
parent | 029e720dec82a68fb0135a3f2d3735e92963dc62 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/edit/edfcol.cxx')
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
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) |