diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-16 15:23:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-17 08:25:47 +0200 |
commit | ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch) | |
tree | 2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /sw/source/core/unocore | |
parent | da5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff) |
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer
Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd
Reviewed-on: https://gerrit.libreoffice.org/61837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/unocore/unorefmk.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 52 |
4 files changed, 34 insertions, 34 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 81a3b1453eee..bfde7f014f88 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2040,7 +2040,7 @@ SwXTextField::getAnchor() std::shared_ptr< SwPaM > pPamForTextField; SwTextField::GetPamForTextField(*pTextField, pPamForTextField); - if (pPamForTextField.get() == nullptr) + if (pPamForTextField == nullptr) return nullptr; // If this is a postit field, then return the range of its annotation mark if it has one. diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 83bd9f22c850..6594a6d00d96 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -306,7 +306,7 @@ SwUnoCursorHelper::SetPageDesc( pNewDesc.reset(new SwFormatPageDesc( *static_cast<const SwFormatPageDesc*>(pItem))); } - if (!pNewDesc.get()) + if (!pNewDesc) { pNewDesc.reset(new SwFormatPageDesc()); } @@ -324,7 +324,7 @@ SwUnoCursorHelper::SetPageDesc( { throw lang::IllegalArgumentException(); } - pNewDesc.get()->RegisterToPageDesc( *pPageDesc ); + pNewDesc->RegisterToPageDesc(*pPageDesc); bPut = true; } if(!bPut) @@ -425,7 +425,7 @@ lcl_setDropcapCharStyle(SwPaM const & rPam, SfxItemSet & rItemSet, { pDrop.reset(new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem))); } - if (!pDrop.get()) + if (!pDrop) { pDrop.reset(new SwFormatDrop); } @@ -450,7 +450,7 @@ lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue) { pRuby.reset(new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem))); } - if (!pRuby.get()) + if (!pRuby) { pRuby.reset(new SwFormatRuby(OUString())); } @@ -1906,7 +1906,7 @@ SwUnoCursorHelper::GetPropertyStates( } else { - if (!pSet.get()) + if (!pSet) { switch ( eCaller ) { diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 12608d77cb15..ac7d5d88f423 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -714,7 +714,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, uno::Reference<rdf::XMetadatable> xMeta(rMeta.GetXMeta()); if (xMeta.is()) { - if (pPortions.get()) // set cache in the XMeta to the given portions + if (pPortions) // set cache in the XMeta to the given portions { const uno::Reference<lang::XUnoTunnel> xUT(xMeta, uno::UNO_QUERY); SwXMeta *const pXMeta( @@ -1218,7 +1218,7 @@ SwXMeta::createEnumeration() SwPaM aPam(*pTextNode, nMetaStart); - if (!m_pImpl->m_pTextPortions.get()) + if (!m_pImpl->m_pTextPortions) { return new SwXTextPortionEnumeration( aPam, GetParentText(), nMetaStart, nMetaEnd); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index e7a2ca50481e..bbbac6aedbba 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -365,35 +365,35 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) RES_COL, RES_COL, RES_FTN_AT_TXTEND, RES_FRAMEDIR, RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER>{}); - if (m_pImpl->m_pProps->m_pBrushItem.get()) + if (m_pImpl->m_pProps->m_pBrushItem) { aSet.Put(*m_pImpl->m_pProps->m_pBrushItem); } - if (m_pImpl->m_pProps->m_pColItem.get()) + if (m_pImpl->m_pProps->m_pColItem) { aSet.Put(*m_pImpl->m_pProps->m_pColItem); } - if (m_pImpl->m_pProps->m_pFootnoteItem.get()) + if (m_pImpl->m_pProps->m_pFootnoteItem) { aSet.Put(*m_pImpl->m_pProps->m_pFootnoteItem); } - if (m_pImpl->m_pProps->m_pEndItem.get()) + if (m_pImpl->m_pProps->m_pEndItem) { aSet.Put(*m_pImpl->m_pProps->m_pEndItem); } - if (m_pImpl->m_pProps->m_pXMLAttr.get()) + if (m_pImpl->m_pProps->m_pXMLAttr) { aSet.Put(*m_pImpl->m_pProps->m_pXMLAttr); } - if (m_pImpl->m_pProps->m_pNoBalanceItem.get()) + if (m_pImpl->m_pProps->m_pNoBalanceItem) { aSet.Put(*m_pImpl->m_pProps->m_pNoBalanceItem); } - if (m_pImpl->m_pProps->m_pFrameDirItem.get()) + if (m_pImpl->m_pProps->m_pFrameDirItem) { aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem); } - if (m_pImpl->m_pProps->m_pLRSpaceItem.get()) + if (m_pImpl->m_pProps->m_pLRSpaceItem) { aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem); } @@ -828,7 +828,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( SfxPoolItem* pPutItem = nullptr; if (RES_COL == pEntry->nWID) { - if (!m_pProps->m_pColItem.get()) + if (!m_pProps->m_pColItem) { m_pProps->m_pColItem.reset(new SwFormatCol); } @@ -836,7 +836,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_BACKGROUND == pEntry->nWID) { - if (!m_pProps->m_pBrushItem.get()) + if (!m_pProps->m_pBrushItem) { m_pProps->m_pBrushItem.reset( new SvxBrushItem(RES_BACKGROUND)); @@ -845,7 +845,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pFootnoteItem.get()) + if (!m_pProps->m_pFootnoteItem) { m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd); } @@ -853,7 +853,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_END_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pEndItem.get()) + if (!m_pProps->m_pEndItem) { m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd); } @@ -861,7 +861,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - if (!m_pProps->m_pXMLAttr.get()) + if (!m_pProps->m_pXMLAttr) { m_pProps->m_pXMLAttr.reset( new SvXMLAttrContainerItem( @@ -871,7 +871,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_COLUMNBALANCE== pEntry->nWID) { - if (!m_pProps->m_pNoBalanceItem.get()) + if (!m_pProps->m_pNoBalanceItem) { m_pProps->m_pNoBalanceItem.reset( new SwFormatNoBalancedColumns(true)); @@ -880,7 +880,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_FRAMEDIR == pEntry->nWID) { - if (!m_pProps->m_pFrameDirItem.get()) + if (!m_pProps->m_pFrameDirItem) { m_pProps->m_pFrameDirItem.reset( new SvxFrameDirectionItem( @@ -890,7 +890,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_LR_SPACE == pEntry->nWID) { - if (!m_pProps->m_pLRSpaceItem.get()) + if (!m_pProps->m_pLRSpaceItem) { m_pProps->m_pLRSpaceItem.reset( new SvxLRSpaceItem( RES_LR_SPACE )); @@ -1169,7 +1169,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( const SfxPoolItem* pQueryItem = nullptr; if (RES_COL == pEntry->nWID) { - if (!m_pProps->m_pColItem.get()) + if (!m_pProps->m_pColItem) { m_pProps->m_pColItem.reset(new SwFormatCol); } @@ -1177,7 +1177,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_BACKGROUND == pEntry->nWID) { - if (!m_pProps->m_pBrushItem.get()) + if (!m_pProps->m_pBrushItem) { m_pProps->m_pBrushItem.reset( new SvxBrushItem(RES_BACKGROUND)); @@ -1186,7 +1186,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pFootnoteItem.get()) + if (!m_pProps->m_pFootnoteItem) { m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd); } @@ -1194,7 +1194,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_END_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pEndItem.get()) + if (!m_pProps->m_pEndItem) { m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd); } @@ -1202,7 +1202,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - if (!m_pProps->m_pXMLAttr.get()) + if (!m_pProps->m_pXMLAttr) { m_pProps->m_pXMLAttr.reset( new SvXMLAttrContainerItem); @@ -1211,7 +1211,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_COLUMNBALANCE== pEntry->nWID) { - if (!m_pProps->m_pNoBalanceItem.get()) + if (!m_pProps->m_pNoBalanceItem) { m_pProps->m_pNoBalanceItem.reset( new SwFormatNoBalancedColumns); @@ -1220,7 +1220,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_FRAMEDIR == pEntry->nWID) { - if (!m_pProps->m_pFrameDirItem.get()) + if (!m_pProps->m_pFrameDirItem) { m_pProps->m_pFrameDirItem.reset( new SvxFrameDirectionItem( @@ -1230,7 +1230,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_LR_SPACE == pEntry->nWID) { - if (!m_pProps->m_pLRSpaceItem.get()) + if (!m_pProps->m_pLRSpaceItem) { m_pProps->m_pLRSpaceItem.reset( new SvxLRSpaceItem( RES_LR_SPACE )); @@ -1402,7 +1402,7 @@ SwXTextSection::getPropertyStates( { if (RES_COL == pEntry->nWID) { - if (!m_pImpl->m_pProps->m_pColItem.get()) + if (!m_pImpl->m_pProps->m_pColItem) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; } @@ -1413,7 +1413,7 @@ SwXTextSection::getPropertyStates( } else { - if (!m_pImpl->m_pProps->m_pBrushItem.get()) + if (!m_pImpl->m_pProps->m_pBrushItem) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; } |