diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-08-18 09:18:01 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2019-08-18 10:17:29 +0200 |
commit | a8df5fbaa478fd7f01b2f04a82b4eb63d0dbcc15 (patch) | |
tree | c1f532901061184d634f0ad408b749cc6fb60f0c /unoxml | |
parent | e0826f8e18b5ad8f8743a4aa2fb78bffda2524f8 (diff) |
Simplify code in unoxml about initializations
Change-Id: I7bc1d82d70f26b1cb7289b87a52e1f59fb740817
Reviewed-on: https://gerrit.libreoffice.org/77655
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/dom/documentbuilder.cxx | 15 | ||||
-rw-r--r-- | unoxml/source/dom/saxbuilder.cxx | 15 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 15 |
3 files changed, 6 insertions, 39 deletions
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 3b5082ae8774..5a03cf0bcf2d 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -102,24 +102,13 @@ namespace DOM return static_cast< XDocumentBuilder* >(new CDocumentBuilder); } - static const char aImplementationName[] = "com.sun.star.comp.xml.dom.DocumentBuilder"; - static const char* aSupportedServiceNames[] = { - "com.sun.star.xml.dom.DocumentBuilder", - nullptr - }; - OUString CDocumentBuilder::_getImplementationName() { - return aImplementationName; + return "com.sun.star.comp.xml.dom.DocumentBuilder"; } Sequence<OUString> CDocumentBuilder::_getSupportedServiceNames() { - Sequence<OUString> aSequence; - for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) { - aSequence.realloc(i+1); - aSequence[i] = OUString::createFromAscii(aSupportedServiceNames[i]); - } - return aSequence; + return { "com.sun.star.xml.dom.DocumentBuilder" }; } Sequence< OUString > SAL_CALL CDocumentBuilder::getSupportedServiceNames() diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 00db5396da64..688ec9c215cc 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -38,12 +38,6 @@ namespace DOM return static_cast< XSAXDocumentBuilder* >(new CSAXDocumentBuilder(rSMgr)); } - static const char aImplementationName[] = "com.sun.star.comp.xml.dom.SAXDocumentBuilder"; - static const char* aSupportedServiceNames[] = { - "com.sun.star.xml.dom.SAXDocumentBuilder", - nullptr - }; - CSAXDocumentBuilder::CSAXDocumentBuilder(const Reference< XMultiServiceFactory >& mgr) : m_aServiceManager(mgr) , m_aState( SAXDocumentBuilderState_READY) @@ -51,16 +45,11 @@ namespace DOM OUString CSAXDocumentBuilder::_getImplementationName() { - return aImplementationName; + return "com.sun.star.comp.xml.dom.SAXDocumentBuilder"; } Sequence<OUString> CSAXDocumentBuilder::_getSupportedServiceNames() { - Sequence<OUString> aSequence; - for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) { - aSequence.realloc(i+1); - aSequence[i] = OUString::createFromAscii(aSupportedServiceNames[i]); - } - return aSequence; + return { "com.sun.star.xml.dom.SAXDocumentBuilder" }; } Sequence< OUString > SAL_CALL CSAXDocumentBuilder::getSupportedServiceNames() diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 334cd19f18cd..491be8cab0b7 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -59,25 +59,14 @@ namespace XPath { } - static const char aImplementationName[] = "com.sun.star.comp.xml.xpath.XPathAPI"; - static const char* aSupportedServiceNames[] = { - "com.sun.star.xml.xpath.XPathAPI", - nullptr - }; - OUString CXPathAPI::_getImplementationName() { - return aImplementationName; + return "com.sun.star.comp.xml.xpath.XPathAPI"; } Sequence<OUString> CXPathAPI::_getSupportedServiceNames() { - Sequence<OUString> aSequence; - for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) { - aSequence.realloc(i+1); - aSequence[i] = OUString::createFromAscii(aSupportedServiceNames[i]); - } - return aSequence; + return { "com.sun.star.xml.xpath.XPathAPI" }; } Sequence< OUString > SAL_CALL CXPathAPI::getSupportedServiceNames() |