summaryrefslogtreecommitdiff
path: root/sw/source/filter/writer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 15:35:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-29 19:23:44 +0200
commit66438a0ad5a3c6d2792f4c6c04c2d2405b5679cb (patch)
tree29eb826ce08a4e4f691b8306d9af968396e7b56c /sw/source/filter/writer
parent397ba047c941eb7d77a15a8de72e20ace4744da1 (diff)
std::unique_ptr->std::optional
Change-Id: Ie09ede2ce21c206ca158a5a89d50143cdde45e3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116381 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/writer')
-rw-r--r--sw/source/filter/writer/writer.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 8076b23a5bb5..88538e6c46e0 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::unique_ptr< std::map<OUString, OUString> > pFileNameMap;
+ std::optional< std::map<OUString, OUString> > xFileNameMap;
std::vector<const SvxFontItem*> aFontRemoveLst;
SwBookmarkNodeTable aBkmkNodePos;
@@ -312,11 +312,11 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm )
INetProtocol::VndSunStarWebdav >= aTargetUrl.GetProtocol() ) )
return bRet;
- if (m_pImpl->pFileNameMap)
+ if (m_pImpl->xFileNameMap)
{
// has the file been moved?
- std::map<OUString, OUString>::iterator it = m_pImpl->pFileNameMap->find( rFileNm );
- if ( it != m_pImpl->pFileNameMap->end() )
+ std::map<OUString, OUString>::iterator it = m_pImpl->xFileNameMap->find( rFileNm );
+ if ( it != m_pImpl->xFileNameMap->end() )
{
rFileNm = it->second;
return true;
@@ -324,7 +324,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm )
}
else
{
- m_pImpl->pFileNameMap.reset( new std::map<OUString, OUString> );
+ m_pImpl->xFileNameMap.emplace();
}
OUString aSrc = rFileNm;
@@ -342,7 +342,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm )
if( bRet )
{
- m_pImpl->pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
+ m_pImpl->xFileNameMap->insert( std::make_pair( aSrc, aDest ) );
rFileNm = aDest;
}