diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-04 19:58:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-05 12:40:13 +0200 |
commit | 1d35f90dfe46cadc913e35f509669785cfa8ec18 (patch) | |
tree | 7e43524448d64bf8ddb797c7138856ebb0e41350 /sw/source/core/unocore | |
parent | 4ada921dbb6a431b632cfccd06178dad68860ab6 (diff) |
SwDateTimeField::GetDateTime always dereferences its SwDoc*
ditto:
SwXFrameEnumeration ctor
lcl_ReAssignTOXType
Change-Id: Idaa6bef29cbc4c3a08d578ef4bedcaa071547944
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103928
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/unocoll.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index c9a2cdc0dff4..a6287cbd714d 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1056,7 +1056,7 @@ namespace protected: virtual ~SwXFrameEnumeration() override {}; public: - SwXFrameEnumeration(const SwDoc* const pDoc); + SwXFrameEnumeration(const SwDoc& rDoc); //XEnumeration virtual sal_Bool SAL_CALL hasMoreElements() override; @@ -1070,12 +1070,12 @@ namespace } template<FlyCntType T> -SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) +SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc& rDoc) : m_aFrames() { SolarMutexGuard aGuard; - const SwFrameFormats* const pFormats = pDoc->GetSpzFrameFormats(); - if(pFormats->empty()) + const SwFrameFormats* const pFormats = rDoc.GetSpzFrameFormats(); + if (pFormats->empty()) return; // #i104937# const size_t nSize = pFormats->size(); @@ -1090,7 +1090,7 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); if(!pIdx || !pIdx->GetNodes().IsDocNodes()) continue; - const SwNode* pNd = pDoc->GetNodes()[ pIdx->GetIndex() + 1 ]; + const SwNode* pNd = rDoc.GetNodes()[ pIdx->GetIndex() + 1 ]; if(UnoFrameWrap_traits<T>::filter(pNd)) m_aFrames.push_back(lcl_UnoWrapFrame<T>(pFormat)); } @@ -1165,13 +1165,13 @@ uno::Reference<container::XEnumeration> SwXFrames::createEnumeration() { case FLYCNTTYPE_FRM: return uno::Reference< container::XEnumeration >( - new SwXFrameEnumeration<FLYCNTTYPE_FRM>(GetDoc())); + new SwXFrameEnumeration<FLYCNTTYPE_FRM>(*GetDoc())); case FLYCNTTYPE_GRF: return uno::Reference< container::XEnumeration >( - new SwXFrameEnumeration<FLYCNTTYPE_GRF>(GetDoc())); + new SwXFrameEnumeration<FLYCNTTYPE_GRF>(*GetDoc())); case FLYCNTTYPE_OLE: return uno::Reference< container::XEnumeration >( - new SwXFrameEnumeration<FLYCNTTYPE_OLE>(GetDoc())); + new SwXFrameEnumeration<FLYCNTTYPE_OLE>(*GetDoc())); default: throw uno::RuntimeException(); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 9cfe87f04901..442527ef454b 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -98,13 +98,13 @@ static void lcl_BitMaskToAny(uno::Any & o_rValue, } static void -lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) +lcl_ReAssignTOXType(SwDoc& rDoc, SwTOXBase& rTOXBase, const OUString& rNewName) { - const sal_uInt16 nUserCount = pDoc->GetTOXTypeCount( TOX_USER ); + const sal_uInt16 nUserCount = rDoc.GetTOXTypeCount( TOX_USER ); const SwTOXType* pNewType = nullptr; for(sal_uInt16 nUser = 0; nUser < nUserCount; nUser++) { - const SwTOXType* pType = pDoc->GetTOXType( TOX_USER, nUser ); + const SwTOXType* pType = rDoc.GetTOXType( TOX_USER, nUser ); if (pType->GetTypeName()==rNewName) { pNewType = pType; @@ -114,7 +114,7 @@ lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) if(!pNewType) { SwTOXType aNewType(TOX_USER, rNewName); - pNewType = pDoc->InsertTOXType( aNewType ); + pNewType = rDoc.InsertTOXType( aNewType ); } rTOXBase.RegisterToTOXType( *const_cast<SwTOXType*>(pNewType) ); @@ -594,7 +594,7 @@ SwXDocumentIndex::setPropertyValue( { if (rTOXBase.GetTOXType()->GetTypeName() != sNewName) { - lcl_ReAssignTOXType(pSectionFormat->GetDoc(), + lcl_ReAssignTOXType(*pSectionFormat->GetDoc(), rTOXBase, sNewName); } } @@ -1332,7 +1332,7 @@ SwXDocumentIndex::attach(const uno::Reference< text::XTextRange > & xTextRange) if ((TOX_USER == pTOXType->GetType()) && m_pImpl->m_pProps->GetTypeName() != pTOXType->GetTypeName()) { - lcl_ReAssignTOXType(pDoc, rTOXBase, m_pImpl->m_pProps->GetTypeName()); + lcl_ReAssignTOXType(*pDoc, rTOXBase, m_pImpl->m_pProps->GetTypeName()); } //TODO: apply Section attributes (columns and background) SwTOXBaseSection *const pTOX = |