[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 12 07:00:46 UTC 2018
sc/source/filter/xml/XMLStylesExportHelper.cxx | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
New commits:
commit c72b9281d5a2b199143d56c58f8ddabf466968a2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Sep 11 15:21:39 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 09:00:22 2018 +0200
loplugin:useuniqueptr in ScMyValidationsContainer::WriteMessage
Change-Id: I72a699834244c6996b5021f7d110028aa747bbf7
Reviewed-on: https://gerrit.libreoffice.org/60353
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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)
More information about the Libreoffice-commits
mailing list