summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-30 12:01:04 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:14 +0200
commitf53517a5b08f9dddd61f5f0aa697222529d15e28 (patch)
tree3ac63c826351ef87ae5082bb98defa0a15890993 /desktop
parentfa3c9a9072ae05ae6d03014eb55ad5f7d895d1fe (diff)
fdo#46808, convert xml::xpath::XPathAPI to new-style service
Change-Id: I54bb0eb08d687e7d54c42601c826c580a7a17ebb
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx10
-rw-r--r--desktop/source/deployment/registry/dp_backenddb.cxx14
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx7
3 files changed, 7 insertions, 24 deletions
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 75429e1423d4..dc7193fe4bcc 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -43,7 +43,7 @@
#include "com/sun/star/xml/dom/XNode.hpp"
#include "com/sun/star/xml/dom/XNodeList.hpp"
#include "com/sun/star/xml/dom/DocumentBuilder.hpp"
-#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "com/sun/star/xml/xpath/XPathAPI.hpp"
#include "com/sun/star/ucb/InteractiveIOException.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
@@ -349,14 +349,8 @@ DescriptionInfoset::DescriptionInfoset(
m_context(context),
m_element(element)
{
- css::uno::Reference< css::lang::XMultiComponentFactory > manager(
- context->getServiceManager(), css::uno::UNO_QUERY_THROW);
if (m_element.is()) {
- m_xpath = css::uno::Reference< css::xml::xpath::XXPathAPI >(
- manager->createInstanceWithContext(
- "com.sun.star.xml.xpath.XPathAPI",
- context),
- css::uno::UNO_QUERY_THROW);
+ m_xpath = css::xml::xpath::XPathAPI::create(context);
m_xpath->registerNS("desc", element->getNamespaceURI());
m_xpath->registerNS("xlink", "http://www.w3.org/1999/xlink");
}
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx
index 140084457b3b..152a8f025279 100644
--- a/desktop/source/deployment/registry/dp_backenddb.cxx
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -25,7 +25,7 @@
#include "osl/file.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/xml/dom/DocumentBuilder.hpp"
-#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "com/sun/star/xml/xpath/XPathAPI.hpp"
#include "com/sun/star/io/XActiveDataSource.hpp"
#include "com/sun/star/io/XActiveDataControl.hpp"
#include "dp_ucb.h"
@@ -111,17 +111,9 @@ Reference<css::xml::xpath::XXPathAPI> BackendDb::getXPathAPI()
{
if (!m_xpathApi.is())
{
- m_xpathApi = Reference< css::xml::xpath::XXPathAPI >(
- m_xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.xml.xpath.XPathAPI",
- m_xContext), css::uno::UNO_QUERY);
+ m_xpathApi = css::xml::xpath::XPathAPI::create( m_xContext );
- if (!m_xpathApi.is())
- throw css::uno::RuntimeException(
- " Could not create service com.sun.star.xml.xpath.XPathAPI", 0);
-
- m_xpathApi->registerNS(
- getNSPrefix(), getDbNSName());
+ m_xpathApi->registerNS( getNSPrefix(), getDbNSName() );
}
return m_xpathApi;
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 023c4800cca4..a8f1f419cf20 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/NameClash.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
+#include <com/sun/star/xml/xpath/XPathAPI.hpp>
#include <com/sun/star/xml/dom/DocumentBuilder.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/deployment/ExtensionManager.hpp>
@@ -228,10 +228,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript
uno::Reference< xml::dom::XElement > xRoot = xDoc->getDocumentElement();
if ( xRoot.is() && xRoot->getTagName() == "description" )
{
- uno::Reference< xml::xpath::XXPathAPI > xPath(
- m_ctx->getServiceManager()->createInstanceWithContext( "com.sun.star.xml.xpath.XPathAPI",
- m_ctx),
- uno::UNO_QUERY);
+ uno::Reference< xml::xpath::XXPathAPI > xPath = xml::xpath::XPathAPI::create(m_ctx);
xPath->registerNS("desc", xRoot->getNamespaceURI());
xPath->registerNS("xlink", "http://www.w3.org/1999/xlink");