Kaydet (Commit) fa47856e authored tarafından Michael Stahl's avatar Michael Stahl

xmloff: fix leak in XMLPropertySetMapperEntry_Impl

The XMLNamedBoolPropertyHdl should be owned by
OControlPropertyHandlerFactory like all the other handlers created in
that function.

Thanks to Julien Nabet for pointing out the problem.

Change-Id: Id474b2fdb84ca74f686d0c888fbedbee623c31bb
Reviewed-on: https://gerrit.libreoffice.org/52666Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 63229c51
......@@ -30,6 +30,7 @@
#include <rtl/ustring.hxx>
#include <xmloff/xmlexppr.hxx>
#include <xmloff/XMLConstantsPropertyHandler.hxx>
#include <xmloff/NamedBoolPropertyHdl.hxx>
template<typename EnumT> struct SvXMLEnumMapEntry;
class Color;
......@@ -119,6 +120,7 @@ namespace xmloff
mutable std::unique_ptr<OFontWidthHandler> m_pFontWidthHandler;
mutable std::unique_ptr<XMLConstantsPropertyHandler> m_pFontEmphasisHandler;
mutable std::unique_ptr<XMLConstantsPropertyHandler> m_pFontReliefHandler;
mutable std::unique_ptr<XMLNamedBoolPropertyHdl> m_pTextLineModeHandler;
public:
OControlPropertyHandlerFactory();
......
......@@ -99,9 +99,13 @@ namespace xmloff
pHandler = m_pFontReliefHandler.get();
break;
case XML_TYPE_TEXT_LINE_MODE:
pHandler = new XMLNamedBoolPropertyHdl(
::xmloff::token::XML_SKIP_WHITE_SPACE,
::xmloff::token::XML_CONTINUOUS);
if (!m_pTextLineModeHandler)
{
m_pTextLineModeHandler = o3tl::make_unique<XMLNamedBoolPropertyHdl>(
::xmloff::token::XML_SKIP_WHITE_SPACE,
::xmloff::token::XML_CONTINUOUS);
}
pHandler = m_pTextLineModeHandler.get();
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment