summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/edfcol.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-05 12:21:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-05 21:28:06 +0200
commit1b4b3db429555c48dd800f175f92040b73cece65 (patch)
tree79428d0fb525ee623a500f5f8a0eef198cdd1f09 /sw/source/core/edit/edfcol.cxx
parentbe44b86998b2681d0de231bd9f5364a968e7c6b8 (diff)
SwUndoParagraphSigning never passed null SwDoc*
ditto: SwUndoFrameFormatCreate ctor SwUndoCharFormatCreate ctor SwUndoCondTextFormatCollCreate ctor SwUndoTextFormatCollCreate ctor SwUndoFormatCreate ctor SwUndoFrameFormatDelete ctor SwUndoCharFormatDelete ctor SwUndoTextFormatCollDelete ctor SwUndoCondTextFormatCollDelete ctor SwUndoFormatDelete ctor SwUndoRenameCharFormat ctor SwUndoRenameFormatColl ctor SwUndoRenameFrameFormat ctor SwUndoNumruleRename ctor SwUndoNumruleDelete ctor SwUndoNumruleCreate ctor SwUndoInsNum ctor Change-Id: I71805bf3f13235c91e9d4746e2ca0a4e4804824c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103964 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.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 6fd50e7536d8..0812f3bebc8b 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -670,7 +670,7 @@ void lcl_ValidateParagraphSignatures(SwDoc& rDoc, const uno::Reference<text::XTe
{
rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::PARA_SIGN_ADD, nullptr);
rDoc.GetIDocumentUndoRedo().AppendUndo(
- std::make_unique<SwUndoParagraphSigning>(&rDoc, xField, xParagraph, false));
+ std::make_unique<SwUndoParagraphSigning>(rDoc, xField, xParagraph, false));
lcl_RemoveParagraphMetadataField(xField);
rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::PARA_SIGN_ADD, nullptr);
}
@@ -1659,18 +1659,18 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
}
}
-SwUndoParagraphSigning::SwUndoParagraphSigning(SwDoc* pDoc,
+SwUndoParagraphSigning::SwUndoParagraphSigning(SwDoc& rDoc,
const uno::Reference<text::XTextField>& xField,
const uno::Reference<text::XTextContent>& xParent,
const bool bRemove)
- : SwUndo(SwUndoId::PARA_SIGN_ADD, pDoc),
- m_pDoc(pDoc),
+ : SwUndo(SwUndoId::PARA_SIGN_ADD, &rDoc),
+ m_rDoc(rDoc),
m_xField(xField),
m_xParent(xParent),
m_bRemove(bRemove)
{
// Save the metadata and field content to undo/redo.
- uno::Reference<frame::XModel> xModel = m_pDoc->GetDocShell()->GetBaseModel();
+ uno::Reference<frame::XModel> xModel = m_rDoc.GetDocShell()->GetBaseModel();
const std::map<OUString, OUString> aStatements = lcl_getRDFStatements(xModel, m_xField);
const auto it = aStatements.find(ParagraphSignatureIdRDFName);
if (it != aStatements.end())
@@ -1707,35 +1707,35 @@ void SwUndoParagraphSigning::RepeatImpl(::sw::RepeatContext&)
void SwUndoParagraphSigning::Insert()
{
// Disable undo to avoid introducing noise when we edit the metadata field.
- const bool isUndoEnabled = m_pDoc->GetIDocumentUndoRedo().DoesUndo();
- m_pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ const bool isUndoEnabled = m_rDoc.GetIDocumentUndoRedo().DoesUndo();
+ m_rDoc.GetIDocumentUndoRedo().DoUndo(false);
// Prevent validation since this will trigger a premature validation
// upon inserting, but before setting the metadata.
- SwEditShell* pEditSh = m_pDoc->GetEditShell();
+ SwEditShell* pEditSh = m_rDoc.GetEditShell();
const bool bOldValidationFlag = pEditSh->SetParagraphSignatureValidation(false);
comphelper::ScopeGuard const g([&] () {
pEditSh->SetParagraphSignatureValidation(bOldValidationFlag);
- m_pDoc->GetIDocumentUndoRedo().DoUndo(isUndoEnabled);
+ m_rDoc.GetIDocumentUndoRedo().DoUndo(isUndoEnabled);
});
- m_xField = lcl_InsertParagraphSignature(m_pDoc->GetDocShell()->GetBaseModel(), m_xParent, m_signature, m_usage);
- lcl_DoUpdateParagraphSignatureField(*m_pDoc, m_xField, m_display);
+ m_xField = lcl_InsertParagraphSignature(m_rDoc.GetDocShell()->GetBaseModel(), m_xParent, m_signature, m_usage);
+ lcl_DoUpdateParagraphSignatureField(m_rDoc, m_xField, m_display);
}
void SwUndoParagraphSigning::Remove()
{
// Disable undo to avoid introducing noise when we edit the metadata field.
- const bool isUndoEnabled = m_pDoc->GetIDocumentUndoRedo().DoesUndo();
- m_pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ const bool isUndoEnabled = m_rDoc.GetIDocumentUndoRedo().DoesUndo();
+ m_rDoc.GetIDocumentUndoRedo().DoUndo(false);
// Prevent validation since this will trigger a premature validation
// upon removing.
- SwEditShell* pEditSh = m_pDoc->GetEditShell();
+ SwEditShell* pEditSh = m_rDoc.GetEditShell();
const bool bOldValidationFlag = pEditSh->SetParagraphSignatureValidation(false);
comphelper::ScopeGuard const g([&] () {
pEditSh->SetParagraphSignatureValidation(bOldValidationFlag);
- m_pDoc->GetIDocumentUndoRedo().DoUndo(isUndoEnabled);
+ m_rDoc.GetIDocumentUndoRedo().DoUndo(isUndoEnabled);
});
lcl_RemoveParagraphMetadataField(m_xField);
@@ -1810,7 +1810,7 @@ void SwEditShell::SignParagraph()
lcl_UpdateParagraphSignatureField(*GetDoc(), xModel, xParagraph, xField, utf8Text);
rDoc.GetIDocumentUndoRedo().AppendUndo(
- std::make_unique<SwUndoParagraphSigning>(GetDoc(), xField, xParagraph, true));
+ std::make_unique<SwUndoParagraphSigning>(rDoc, xField, xParagraph, true));
rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::PARA_SIGN_ADD, nullptr);
}