sc/source/filter/xml/xmlcondformat.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 8c89cfe3cdf6595d5f3bb87ecc45b9f450195aac Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Sat Dec 2 20:33:38 2017 +0200 Don't leak formats that get merged ea55492a6e55290d92a59324b3cb31ed958981ab follow-up Change-Id: Ib94a5a2c2ef6ebc7552c67975683dc18a9a5a744 Reviewed-on: https://gerrit.libreoffice.org/45723 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index 08e8dbf827b5..1d2cab79dd76 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -223,7 +223,7 @@ void SAL_CALL ScXMLConditionalFormatContext::endFastElement( sal_Int32 /*nElemen ScDocument* pDoc = GetScImport().GetDocument(); SCTAB nTab = GetScImport().GetTables().GetCurrentSheet(); - ScConditionalFormat* pFormat = mxFormat.release(); + std::unique_ptr<ScConditionalFormat> pFormat(std::move(mxFormat)); bool bEligibleForCache = true; bool bSingleRelativeReference = false; @@ -337,17 +337,17 @@ void SAL_CALL ScXMLConditionalFormatContext::endFastElement( sal_Int32 /*nElemen nIndexOfOldest = (&aCacheEntry - &mrParent.maCache.front()); } } - mrParent.maCache[nIndexOfOldest].mpFormat = pFormat; + mrParent.maCache[nIndexOfOldest].mpFormat = pFormat.get(); mrParent.maCache[nIndexOfOldest].mbSingleRelativeReference = bSingleRelativeReference; mrParent.maCache[nIndexOfOldest].mpTokens.reset(pTokens); mrParent.maCache[nIndexOfOldest].mnAge = 0; } - sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab); + sal_uLong nIndex = pDoc->AddCondFormat(pFormat.get(), nTab); (void) nIndex; // Avoid 'unused variable' warning when assert() expands to empty assert(pFormat->GetKey() == nIndex); - mrParent.mvCondFormatData.push_back( { pFormat, nTab } ); + mrParent.mvCondFormatData.push_back( { pFormat.release(), nTab } ); } ScXMLConditionalFormatContext::~ScXMLConditionalFormatContext() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits