summaryrefslogtreecommitdiff
path: root/xmloff/source/core/xmlimp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/core/xmlimp.cxx')
-rw-r--r--xmloff/source/core/xmlimp.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c47ad94ceffa..4a8241e4ea69 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -765,7 +765,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
maNamespaceAttrList->Clear();
maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList );
- processNSAttributes( maNamespaceAttrList.get() );
+ std::unique_ptr<SvXMLNamespaceMap> pRewindMap = processNSAttributes( maNamespaceAttrList.get() );
SvXMLImportContextRef xContext;
const bool bRootContext = maContexts.empty();
@@ -828,6 +828,10 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
if ( !xContext )
xContext.set( new SvXMLImportContext( *this ) );
+ // Remember old namespace map.
+ if( pRewindMap )
+ xContext->PutRewindMap(std::move(pRewindMap));
+
// Call a startElement at the new context.
xContext->startFastElement( Element, Attribs );
@@ -917,8 +921,13 @@ void SAL_CALL SvXMLImport::endFastElement (sal_Int32 Element)
return;
}
SvXMLImportContextRef xContext = std::move(maContexts.top());
+ // Get a namespace map to rewind.
+ std::unique_ptr<SvXMLNamespaceMap> pRewindMap = xContext->TakeRewindMap();
maContexts.pop();
xContext->endFastElement( Element );
+ // Rewind a namespace map.
+ if (pRewindMap)
+ mpNamespaceMap = std::move(pRewindMap);
}
void SAL_CALL SvXMLImport::endUnknownElement (const OUString & rPrefix, const OUString & rLocalName)