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 /xmloff/source | |
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 'xmloff/source')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLImport.cxx | 19 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterImportPropMapper.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/impastpl.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/text/XMLPropertyBackpatcher.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 26 | ||||
-rw-r--r-- | xmloff/source/text/txtimppr.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 28 |
10 files changed, 62 insertions, 78 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 0fe3f44b9d8e..7c8aa03b302b 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3496,13 +3496,12 @@ void SchXMLExportHelper_Impl::exportText( const OUString& rText ) // class SchXMLExport -SchXMLExport::SchXMLExport( - const Reference< uno::XComponentContext >& xContext, - OUString const & implementationName, SvXMLExportFlags nExportFlags ) -: SvXMLExport( util::MeasureUnit::CM, xContext, implementationName, - ::xmloff::token::XML_CHART, nExportFlags ), - maAutoStylePool( new SchXMLAutoStylePoolP(*this) ), - maExportHelper( new SchXMLExportHelper(*this, *maAutoStylePool.get()) ) +SchXMLExport::SchXMLExport(const Reference<uno::XComponentContext>& xContext, + OUString const& implementationName, SvXMLExportFlags nExportFlags) + : SvXMLExport(util::MeasureUnit::CM, xContext, implementationName, ::xmloff::token::XML_CHART, + nExportFlags) + , maAutoStylePool(new SchXMLAutoStylePoolP(*this)) + , maExportHelper(new SchXMLExportHelper(*this, *maAutoStylePool)) { if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) GetNamespaceMap_().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 766c5983beab..57b2a8c73b12 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -521,7 +521,7 @@ SvXMLImportContext *SchXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix ( IsXMLToken( rLocalName, XML_DOCUMENT_STYLES) || IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT) )) { - pContext = new SchXMLDocContext( *maImportHelper.get(), *this, nPrefix, rLocalName ); + pContext = new SchXMLDocContext(*maImportHelper, *this, nPrefix, rLocalName); } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && ( IsXMLToken(rLocalName, XML_DOCUMENT) || (IsXMLToken(rLocalName, XML_DOCUMENT_META) @@ -532,9 +532,8 @@ SvXMLImportContext *SchXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix // mst@: right now, this seems to be not supported, so it is untested if (!xDPS.is()) { pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META)) - ? SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList) - : new SchXMLDocContext( *maImportHelper.get(), *this, - nPrefix, rLocalName ); + ? SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList) + : new SchXMLDocContext(*maImportHelper, *this, nPrefix, rLocalName); } } else { pContext = SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList); @@ -557,13 +556,11 @@ SvXMLImportContext *SchXMLImport::CreateFastContext( sal_Int32 nElement, GetModel(), uno::UNO_QUERY); // mst@: right now, this seems to be not supported, so it is untested if (xDPS.is()) { - pContext = (nElement == XML_ELEMENT( OFFICE, XML_DOCUMENT_META )) - ? new SvXMLMetaDocumentContext(*this, - xDPS->getDocumentProperties()) - // flat OpenDocument file format - : new SchXMLFlatDocContext_Impl( - *maImportHelper.get(), *this, nElement, - xDPS->getDocumentProperties()); + pContext = (nElement == XML_ELEMENT(OFFICE, XML_DOCUMENT_META)) + ? new SvXMLMetaDocumentContext(*this, xDPS->getDocumentProperties()) + // flat OpenDocument file format + : new SchXMLFlatDocContext_Impl(*maImportHelper, *this, nElement, + xDPS->getDocumentProperties()); } } break; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 42e14d56bdab..8a918aeeff00 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1751,7 +1751,7 @@ XMLPageExport* SvXMLExport::CreatePageExport() SchXMLExportHelper* SvXMLExport::CreateChartExport() { - return new SchXMLExportHelper(*this,*GetAutoStylePool().get()); + return new SchXMLExportHelper(*this, *GetAutoStylePool()); } XMLFontAutoStylePool* SvXMLExport::CreateFontAutoStylePool() @@ -2428,7 +2428,7 @@ SvXMLExport::AddAttributesRDFa( return; // no xml:id => no RDFa } - if (!mpImpl->mpRDFaHelper.get()) + if (!mpImpl->mpRDFaHelper) { mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaExportHelper(*this) ); } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d2186d706bde..57826fc6546e 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -304,7 +304,7 @@ public: sal_uInt16 getGeneratorVersion( const SvXMLImport& rImport ) { - if ( !mpDocumentInfo.get() ) + if (!mpDocumentInfo) { mpDocumentInfo.reset( new DocumentInfo( rImport ) ); } @@ -568,7 +568,7 @@ void SAL_CALL SvXMLImport::endDocument() GetTextImport()->MapCrossRefHeadingFieldsHorribly(); - if (mpImpl->mpRDFaHelper.get()) + if (mpImpl->mpRDFaHelper) { const uno::Reference<rdf::XRepositorySupplier> xRS(mxModel, uno::UNO_QUERY); @@ -2005,7 +2005,7 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc, ::xmloff::RDFaImportHelper & SvXMLImport::GetRDFaImportHelper() { - if (!mpImpl->mpRDFaHelper.get()) + if (!mpImpl->mpRDFaHelper) { mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*this) ); } @@ -2184,8 +2184,8 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp { for(const auto& aNamespaceDefine : m_aNamespaceDefines) { - OUString& rPrefix = aNamespaceDefine.get()->m_aPrefix; - OUString& rNamespaceURI = aNamespaceDefine.get()->m_aNamespaceURI; + OUString& rPrefix = aNamespaceDefine->m_aPrefix; + OUString& rNamespaceURI = aNamespaceDefine->m_aNamespaceURI; OUString sDecl; if ( rPrefix.isEmpty() ) sDecl = "xmlns"; diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 422a7b5de18b..beff02ecc549 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -380,15 +380,15 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r for (sal_uInt16 i = 0; i < 4; i++) { - if (pNewMargins[i].get()) + if (pNewMargins[i]) { rProperties.push_back(*pNewMargins[i]); } - if (pNewHeaderMargins[i].get()) + if (pNewHeaderMargins[i]) { rProperties.push_back(*pNewHeaderMargins[i]); } - if (pNewFooterMargins[i].get()) + if (pNewFooterMargins[i]) { rProperties.push_back(*pNewFooterMargins[i]); } diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index ae227e7d2920..177fadee8de8 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -734,14 +734,10 @@ void SvXMLAutoStylePoolP_Impl::exportXML( else sName = rFamily.maStrFamilyName; - pAntiImpl->exportStyleAttributes( - GetExport().GetAttrList(), - nFamily, - aExpStyles[i].mpProperties->GetProperties(), - *rFamily.mxMapper.get() - , GetExport().GetMM100UnitConverter(), - GetExport().GetNamespaceMap() - ); + pAntiImpl->exportStyleAttributes(GetExport().GetAttrList(), nFamily, + aExpStyles[i].mpProperties->GetProperties(), + *rFamily.mxMapper, GetExport().GetMM100UnitConverter(), + GetExport().GetNamespaceMap()); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sName, @@ -772,14 +768,10 @@ void SvXMLAutoStylePoolP_Impl::exportXML( aExpStyles[i].mpProperties->GetProperties(), nStart, nEnd, SvXmlExportFlags::IGN_WS, bExtensionNamespace ); - pAntiImpl->exportStyleContent( - GetExport().GetDocHandler(), - nFamily, - aExpStyles[i].mpProperties->GetProperties(), - *rFamily.mxMapper.get(), - GetExport().GetMM100UnitConverter(), - GetExport().GetNamespaceMap() - ); + pAntiImpl->exportStyleContent(GetExport().GetDocHandler(), nFamily, + aExpStyles[i].mpProperties->GetProperties(), + *rFamily.mxMapper, GetExport().GetMM100UnitConverter(), + GetExport().GetNamespaceMap()); } } } diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx index 52b900acf808..a456283b2afc 100644 --- a/xmloff/source/text/XMLPropertyBackpatcher.cxx +++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx @@ -158,7 +158,7 @@ static OUString GetSequenceNumber() XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP() { - if (!m_xBackpatcherImpl->m_pFootnoteBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pFootnoteBackpatcher) { m_xBackpatcherImpl->m_pFootnoteBackpatcher.reset( new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber())); @@ -168,7 +168,7 @@ XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP() XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP() { - if (!m_xBackpatcherImpl->m_pSequenceIdBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pSequenceIdBackpatcher) { m_xBackpatcherImpl->m_pSequenceIdBackpatcher.reset( new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber())); @@ -178,7 +178,7 @@ XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP() XMLPropertyBackpatcher<OUString>& XMLTextImportHelper::GetSequenceNameBP() { - if (!m_xBackpatcherImpl->m_pSequenceNameBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pSequenceNameBackpatcher) { m_xBackpatcherImpl->m_pSequenceNameBackpatcher.reset( new XMLPropertyBackpatcher<OUString>("SourceName")); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 9ed8b7d0115a..7ed81b9e6f2a 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -752,7 +752,7 @@ XMLTextListsHelper & XMLTextImportHelper::GetTextListHelper() const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap() { - if (!m_xImpl->m_xTextElemTokenMap.get()) + if (!m_xImpl->m_xTextElemTokenMap) { m_xImpl->m_xTextElemTokenMap.reset( new SvXMLTokenMap( aTextElemTokenMap )); @@ -762,7 +762,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap() { - if (!m_xImpl->m_xTextPElemTokenMap.get()) + if (!m_xImpl->m_xTextPElemTokenMap) { m_xImpl->m_xTextPElemTokenMap.reset( new SvXMLTokenMap( aTextPElemTokenMap )); @@ -772,7 +772,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap() { - if (!m_xImpl->m_xTextPAttrTokenMap.get()) + if (!m_xImpl->m_xTextPAttrTokenMap) { m_xImpl->m_xTextPAttrTokenMap.reset( new SvXMLTokenMap( aTextPAttrTokenMap )); @@ -782,7 +782,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap() { - if (!m_xImpl->m_xTextFrameAttrTokenMap.get()) + if (!m_xImpl->m_xTextFrameAttrTokenMap) { m_xImpl->m_xTextFrameAttrTokenMap.reset( new SvXMLTokenMap( aTextFrameAttrTokenMap )); @@ -792,7 +792,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap() { - if (!m_xImpl->m_xTextContourAttrTokenMap.get()) + if (!m_xImpl->m_xTextContourAttrTokenMap) { m_xImpl->m_xTextContourAttrTokenMap.reset( new SvXMLTokenMap( aTextContourAttrTokenMap )); @@ -802,7 +802,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() { - if (!m_xImpl->m_xTextHyperlinkAttrTokenMap.get()) + if (!m_xImpl->m_xTextHyperlinkAttrTokenMap) { m_xImpl->m_xTextHyperlinkAttrTokenMap.reset( new SvXMLTokenMap( aTextHyperlinkAttrTokenMap )); @@ -812,7 +812,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() { - if (!m_xImpl->m_xTextMasterPageElemTokenMap.get()) + if (!m_xImpl->m_xTextMasterPageElemTokenMap) { m_xImpl->m_xTextMasterPageElemTokenMap.reset( new SvXMLTokenMap( aTextMasterPageElemTokenMap )); @@ -822,7 +822,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap() { - if (!m_xImpl->m_xTextFieldAttrTokenMap.get()) + if (!m_xImpl->m_xTextFieldAttrTokenMap) { m_xImpl->m_xTextFieldAttrTokenMap.reset( new SvXMLTokenMap( aTextFieldAttrTokenMap )); @@ -2545,7 +2545,7 @@ void XMLTextImportHelper::PopListContext() const SvXMLTokenMap& XMLTextImportHelper::GetTextNumberedParagraphAttrTokenMap() { - if (!m_xImpl->m_xTextNumberedParagraphAttrTokenMap.get()) + if (!m_xImpl->m_xTextNumberedParagraphAttrTokenMap) { m_xImpl->m_xTextNumberedParagraphAttrTokenMap.reset( new SvXMLTokenMap( aTextNumberedParagraphAttrTokenMap ) ); @@ -2555,7 +2555,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextNumberedParagraphAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap() { - if (!m_xImpl->m_xTextListBlockAttrTokenMap.get()) + if (!m_xImpl->m_xTextListBlockAttrTokenMap) { m_xImpl->m_xTextListBlockAttrTokenMap.reset( new SvXMLTokenMap( aTextListBlockAttrTokenMap ) ); @@ -2565,7 +2565,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap() { - if (!m_xImpl->m_xTextListBlockElemTokenMap.get()) + if (!m_xImpl->m_xTextListBlockElemTokenMap) { m_xImpl->m_xTextListBlockElemTokenMap.reset( new SvXMLTokenMap( aTextListBlockElemTokenMap ) ); @@ -2575,7 +2575,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap() SvI18NMap& XMLTextImportHelper::GetRenameMap() { - if (!m_xImpl->m_xRenameMap.get()) + if (!m_xImpl->m_xRenameMap) { m_xImpl->m_xRenameMap.reset( new SvI18NMap ); } @@ -2702,7 +2702,7 @@ void XMLTextImportHelper::ConnectFrameChains( } else { - if (!m_xImpl->m_xPrevFrmNames.get()) + if (!m_xImpl->m_xPrevFrmNames) { m_xImpl->m_xPrevFrmNames.reset( new std::vector<OUString> ); m_xImpl->m_xNextFrmNames.reset( new std::vector<OUString> ); diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 700af7aa44fc..519fdf3099d4 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -756,11 +756,11 @@ void XMLTextImportPropertyMapper::finished( for (sal_uInt16 i=0; i<4; i++) { - if (pNewParaMargins[i].get()) + if (pNewParaMargins[i]) { rProperties.push_back(*pNewParaMargins[i]); } - if (pNewMargins[i].get()) + if (pNewMargins[i]) { rProperties.push_back(*pNewMargins[i]); } diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 54bc90497958..9134fe01cffb 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1560,7 +1560,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( } else { - pContext = new XMLUrlFieldImportContext( rImport, *rImport.GetTextImport().get(), nPrefix, rLocalName ); + pContext = new XMLUrlFieldImportContext(rImport, *rImport.GetTextImport(), nPrefix, + rLocalName); //whitespace handling like other fields rIgnoreLeadingSpace = false; @@ -1584,9 +1585,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( } else { - pContext = new XMLFootnoteImportContext( rImport, - *rImport.GetTextImport().get(), - nPrefix, rLocalName ); + pContext = new XMLFootnoteImportContext(rImport, *rImport.GetTextImport(), nPrefix, + rLocalName); } rIgnoreLeadingSpace = false; break; @@ -1595,19 +1595,17 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( case XML_TOK_TEXT_BOOKMARK: case XML_TOK_TEXT_BOOKMARK_START: case XML_TOK_TEXT_BOOKMARK_END: - pContext = new XMLTextMarkImportContext( rImport, - *rImport.GetTextImport().get(), - rHints.GetCrossRefHeadingBookmark(), - nPrefix, rLocalName ); + pContext = new XMLTextMarkImportContext(rImport, *rImport.GetTextImport(), + rHints.GetCrossRefHeadingBookmark(), nPrefix, + rLocalName); break; case XML_TOK_TEXT_FIELDMARK: case XML_TOK_TEXT_FIELDMARK_START: case XML_TOK_TEXT_FIELDMARK_END: - pContext = new XMLTextMarkImportContext( rImport, - *rImport.GetTextImport().get(), - rHints.GetCrossRefHeadingBookmark(), - nPrefix, rLocalName ); + pContext = new XMLTextMarkImportContext(rImport, *rImport.GetTextImport(), + rHints.GetCrossRefHeadingBookmark(), nPrefix, + rLocalName); break; case XML_TOK_TEXT_REFERENCE_START: @@ -1708,10 +1706,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( default: // none of the above? then it's probably a text field! - pContext = - XMLTextFieldImportContext::CreateTextFieldImportContext( - rImport, *rImport.GetTextImport().get(), nPrefix, rLocalName, - nToken); + pContext = XMLTextFieldImportContext::CreateTextFieldImportContext( + rImport, *rImport.GetTextImport(), nPrefix, rLocalName, nToken); // #108784# import draw elements (except control shapes in headers) if( pContext == nullptr && !( rImport.GetTextImport()->IsInHeaderFooter() && |