summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 11:13:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 18:32:53 +0200
commit85141c9175af90511e3cb5c134dfbbc63961cd39 (patch)
treebb94ed9af86860cd7f40feefe26b23efabc453a7
parent0be7fdfa86208d74ccbd1289ebc9f2cd03c8ae84 (diff)
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 <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/filter/writer/writer.cxx21
1 files changed, 7 insertions, 14 deletions
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<OUString, OUString> > xFileNameMap;
+ std::map<OUString, OUString> maFileNameMap;
std::vector<const SvxFontItem*> 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<OUString, OUString>::iterator it = m_pImpl->maFileNameMap.find( rFileNm );
+ if ( it != m_pImpl->maFileNameMap.end() )
{
- // has the file been moved?
- std::map<OUString, OUString>::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;
}