From 85141c9175af90511e3cb5c134dfbbc63961cd39 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 29 Jul 2021 11:13:28 +0200 Subject: no need for this map to be optional an empty map is a very small object Change-Id: I9153c3dfbbdb8f6781cbba2c8067d4cac5372578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119667 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/writer/writer.cxx | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'sw/source/filter/writer') diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 88538e6c46e0..f775293554d9 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -65,7 +65,7 @@ struct Writer_Impl { SvStream * m_pStream; - std::optional< std::map > xFileNameMap; + std::map maFileNameMap; std::vector aFontRemoveLst; SwBookmarkNodeTable aBkmkNodePos; @@ -312,19 +312,12 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm ) INetProtocol::VndSunStarWebdav >= aTargetUrl.GetProtocol() ) ) return bRet; - if (m_pImpl->xFileNameMap) + // has the file been moved? + std::map::iterator it = m_pImpl->maFileNameMap.find( rFileNm ); + if ( it != m_pImpl->maFileNameMap.end() ) { - // has the file been moved? - std::map::iterator it = m_pImpl->xFileNameMap->find( rFileNm ); - if ( it != m_pImpl->xFileNameMap->end() ) - { - rFileNm = it->second; - return true; - } - } - else - { - m_pImpl->xFileNameMap.emplace(); + rFileNm = it->second; + return true; } OUString aSrc = rFileNm; @@ -342,7 +335,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm ) if( bRet ) { - m_pImpl->xFileNameMap->insert( std::make_pair( aSrc, aDest ) ); + m_pImpl->maFileNameMap.insert( std::make_pair( aSrc, aDest ) ); rFileNm = aDest; } -- cgit -3.2'>distro/collabora/cd-5.3-3.2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2020-05-04[cp] Optionally bundle even more Google Noto fontsAndras Timar