diff options
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmllib_imexp/xmllib_export.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index 97764e4292c2..f7a3b17ddc46 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -62,8 +62,7 @@ exportLibraryContainer( { LibDescriptor& rLib = pLibArray->mpLibs[i]; - XMLElement* pLibElement = new XMLElement( XMLNS_LIBRARY_PREFIX ":library" ); - Reference< xml::sax::XAttributeList > xLibElementAttribs = static_cast< xml::sax::XAttributeList* >( pLibElement ); + rtl::Reference<XMLElement> pLibElement(new XMLElement( XMLNS_LIBRARY_PREFIX ":library" )); pLibElement->addAttribute( XMLNS_LIBRARY_PREFIX ":name", rLib.aName ); @@ -119,13 +118,12 @@ exportLibrary( for( const auto& rElementName : rLib.aElementNames ) { - XMLElement* pElement = new XMLElement( XMLNS_LIBRARY_PREFIX ":element" ); - Reference< xml::sax::XAttributeList > xElementAttribs = static_cast< xml::sax::XAttributeList* >( pElement ); + rtl::Reference<XMLElement> pElement(new XMLElement( XMLNS_LIBRARY_PREFIX ":element" )); pElement->addAttribute( XMLNS_LIBRARY_PREFIX ":name", rElementName ); - pLibElement->addSubElement( pElement ); + pLibElement->addSubElement( pElement.get() ); } pLibElement->dump( xOut.get() ); |