diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-11 15:21:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 09:00:22 +0200 |
commit | c72b9281d5a2b199143d56c58f8ddabf466968a2 (patch) | |
tree | 3b6e65dde1b451cc6b574753ae4c16350d31825a /sc | |
parent | 867cfc57d8bcca1e1c9ea8e63595b618c55fc840 (diff) |
loplugin:useuniqueptr in ScMyValidationsContainer::WriteMessage
Change-Id: I72a699834244c6996b5021f7d110028aa747bbf7
Reviewed-on: https://gerrit.libreoffice.org/60353
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLStylesExportHelper.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 4a1c140d15a5..67dea682459e 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -306,11 +306,11 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport, rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TRUE); else rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, XML_FALSE); - SvXMLElementExport* pMessage(nullptr); + std::unique_ptr<SvXMLElementExport> pMessage; if (bIsHelpMessage) - pMessage = new SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_HELP_MESSAGE, true, true); + pMessage.reset(new SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_HELP_MESSAGE, true, true)); else - pMessage = new SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_ERROR_MESSAGE, true, true); + pMessage.reset(new SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_ERROR_MESSAGE, true, true)); if (!sOUMessage.isEmpty()) { sal_Int32 i(0); @@ -335,7 +335,6 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport, rExport.GetTextParagraphExport()->exportCharacterData(sTemp.makeStringAndClear(), bPrevCharWasSpace); } } - delete pMessage; } void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) |