summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-23 18:23:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-03 15:55:04 +0200
commit9b07288138228af56e58f50dc6ba50865b52fdfb (patch)
tree2bde7ca61824f7266c70a404be6049fba26d8c98 /xmloff
parenteb0e7f62587d957c8d7a86d1c8170e5cd7a7e029 (diff)
fdo#46808, Adapt xml::dom::DocumentBuilder UNO service to new style
Change-Id: I577fbc7f990be9ec1f7b7eea53218b7daaccb2a1
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/DomBuilderContext.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx
index 51b60cf02ba7..a8ce3bea1ea5 100644
--- a/xmloff/source/core/DomBuilderContext.cxx
+++ b/xmloff/source/core/DomBuilderContext.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/xml/dom/XAttr.hpp>
-#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
+#include <com/sun/star/xml/dom/DocumentBuilder.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XElement.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
@@ -50,10 +50,12 @@
using com::sun::star::lang::XMultiServiceFactory;
+using com::sun::star::uno::XComponentContext;
using com::sun::star::uno::Reference;
using com::sun::star::uno::Sequence;
using com::sun::star::uno::UNO_QUERY;
using com::sun::star::uno::UNO_QUERY_THROW;
+using com::sun::star::xml::dom::DocumentBuilder;
using com::sun::star::xml::dom::XAttr;
using com::sun::star::xml::dom::XDocument;
using com::sun::star::xml::dom::XDocumentBuilder;
@@ -191,17 +193,12 @@ void DomBuilderContext::Characters( const OUString& rCharacters )
// helper function implementations
//
-const sal_Char sDocumentBuilder[] = "com.sun.star.xml.dom.DocumentBuilder";
-
Reference<XNode> lcl_createDomInstance()
{
- Reference<XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
- DBG_ASSERT( xFactory.is(), "can't get service factory" );
+ Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
+ DBG_ASSERT( xContext.is(), "can't get service factory" );
- Reference<XDocumentBuilder> xBuilder(
- xFactory->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( sDocumentBuilder ) ) ),
- UNO_QUERY_THROW );
+ Reference<XDocumentBuilder> xBuilder( DocumentBuilder::create(xContext) );
return Reference<XNode>( xBuilder->newDocument(), UNO_QUERY_THROW );
}