diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-02 18:41:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-03 11:37:34 +0200 |
commit | 4aa464f4634faa62499e6ff5737a647dc80d68cc (patch) | |
tree | f562a5d1b60e075afc9b017813adac747a990243 /xmloff | |
parent | 4060230ca5124f7bdd658f2aa5ee5527375edb86 (diff) |
no need to use unique_ptr for this map in XMLRedlineExport
map is already a node based data structure, so the values will stay
in the same place in memory
Change-Id: Id555367e9a3e44f60295b8296aadabb9c1681e6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139271
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLRedlineExport.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/text/XMLRedlineExport.hxx | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index eb8f8d68ad65..aa9b364fedb4 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -129,10 +129,10 @@ void XMLRedlineExport::ExportChangesList( if (aFind == aChangeMap.end()) return; - ChangesVectorType* pChangesList = aFind->second.get(); + ChangesVectorType& rChangesList = aFind->second; // export only if changes are found - if (pChangesList->empty()) + if (rChangesList.empty()) return; // changes container element @@ -141,7 +141,7 @@ void XMLRedlineExport::ExportChangesList( true, true); // iterate over changes list - for (auto const& change : *pChangesList) + for (auto const& change : rChangesList) { ExportChangedRegion(change); } @@ -158,12 +158,11 @@ void XMLRedlineExport::SetCurrentXText( ChangesMapType::iterator aIter = aChangeMap.find(rText); if (aIter == aChangeMap.end()) { - ChangesVectorType* pList = new ChangesVectorType; - aChangeMap[rText].reset( pList ); - pCurrentChangesList = pList; + auto rv = aChangeMap.emplace(std::piecewise_construct, std::forward_as_tuple(rText), std::forward_as_tuple()); + pCurrentChangesList = &rv.first->second; } else - pCurrentChangesList = aIter->second.get(); + pCurrentChangesList = &aIter->second; } else { diff --git a/xmloff/source/text/XMLRedlineExport.hxx b/xmloff/source/text/XMLRedlineExport.hxx index 5eee02a5db39..9031aacdbd20 100644 --- a/xmloff/source/text/XMLRedlineExport.hxx +++ b/xmloff/source/text/XMLRedlineExport.hxx @@ -42,7 +42,7 @@ typedef ::std::vector< // store a list of redline properties for each XText typedef ::std::map< css::uno::Reference< css::text::XText>, - std::unique_ptr<ChangesVectorType> > ChangesMapType; + ChangesVectorType > ChangesMapType; /** |