summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-30 10:20:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-30 14:28:20 +0200
commit947e89cf6755d15b57ee3c5fa2661e7a1c09402b (patch)
tree49417de63d5d0b8c4e467c6e10e2b00ce801f72f /sw/source/core/unocore
parent93099409f3e9894b7a40182f775d76757fa2fb5b (diff)
SwPosition::GetDoc can return a reference
and remove discovered redundant null checks Change-Id: I90e2a84b260bfaf283b787db055cd1ed54dab4ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unobkm.cxx4
-rw-r--r--sw/source/core/unocore/unotbl.cxx7
2 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 97550fec41da..233d14b23421 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -101,8 +101,8 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis,
{
pMarkBase->SetXBookmark(xBookmark);
}
- assert(m_pDoc == nullptr || m_pDoc == pBkmk->GetMarkPos().GetDoc());
- m_pDoc = pBkmk->GetMarkPos().GetDoc();
+ assert(m_pDoc == nullptr || m_pDoc == &pBkmk->GetMarkPos().GetDoc());
+ m_pDoc = &pBkmk->GetMarkPos().GetDoc();
}
else if (m_pRegisteredBookmark)
{
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 86b0b7ca5446..f58ee3dad7e0 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1074,11 +1074,8 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
return uno::Any();
SwPosition aPos(*pTableNode);
- SwDoc* pDoc = aPos.GetDoc();
- if (!pDoc)
- return uno::Any();
-
- m_xParentText = sw::CreateParentXText(*pDoc, aPos);
+ SwDoc& rDoc = aPos.GetDoc();
+ m_xParentText = sw::CreateParentXText(rDoc, aPos);
}
return uno::makeAny(m_xParentText);