diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-11-30 18:29:37 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-11-30 22:32:46 +0100 |
commit | f7a5335ef50f4a9775703a038006dfb983a50a15 (patch) | |
tree | 979d14b4145c5b1cf2809b5d3eab32ff4a705ef7 /xmloff/source/core | |
parent | ebb34571c19c5ac939fbf5aed2ab66ee18e298dc (diff) |
xmloff: turn SvXMLImportContext into a no-op base class
Fix the non-obvious and potentially dangerous recursion that is
implicit in xmloff's context code.
SvXMLImportContext::CreateChildContext() now always creates a
SvXMLImportContext, does not delegate to SvXMLImport.
Rename CreateContext to CreateDocumentContext, to make its purpose of
creating only the top-level context more obvious.
With the previous changes to CreateContext overrides in sw,
reportdesign and dbaccess, this hopefully shouldn't break anything.
Change-Id: I9e147bf6297bbac9e8470454881da73f6e39db0a
Diffstat (limited to 'xmloff/source/core')
-rw-r--r-- | xmloff/source/core/xmlictxt.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index e1805057dcdd..a00539afce6b 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -48,10 +48,10 @@ SvXMLImportContext::~SvXMLImportContext() } SvXMLImportContextRef SvXMLImportContext::CreateChildContext( sal_uInt16 nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList >& xAttrList ) + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& ) { - return mrImport.CreateContext( nPrefix, rLocalName, xAttrList ); + return new SvXMLImportContext(mrImport, nPrefix, rLocalName); } void SvXMLImportContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& ) diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index f96940aeb575..676d6be7d071 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -308,7 +308,7 @@ public: ::comphelper::UnoInterfaceToUniqueIdentifierMapper maInterfaceToIdentifierMapper; }; -SvXMLImportContext *SvXMLImport::CreateContext( sal_uInt16 nPrefix, +SvXMLImportContext *SvXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -719,7 +719,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, } else { - xContext.set(CreateContext( nPrefix, aLocalName, xAttrList )); + xContext.set(CreateDocumentContext(nPrefix, aLocalName, xAttrList)); if( (nPrefix & XML_NAMESPACE_UNKNOWN_FLAG) != 0 && dynamic_cast< const SvXMLImportContext*>(xContext.get()) != nullptr ) { |