diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-13 20:00:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-14 10:27:34 +0200 |
commit | d1038da54d02f39019b47cffcbf5f94b8cfbcbce (patch) | |
tree | b217e1d93369c0b1e869b08acb15ffbaca0715ce /io/source/stm/omark.cxx | |
parent | 332e805dad96c5a06b1b8aeea159d17f4abb302a (diff) |
io: create instances with uno constructors
See tdf#74608 for motivation.
Change-Id: Ic5942f00147e4024ffc3d5880cf3c7462bcc14de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98678
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io/source/stm/omark.cxx')
-rw-r--r-- | io/source/stm/omark.cxx | 60 |
1 files changed, 13 insertions, 47 deletions
diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx index 0c7a821423f4..411f6412c830 100644 --- a/io/source/stm/omark.cxx +++ b/io/source/stm/omark.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/io/XConnectable.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/weak.hxx> #include <cppuhelper/implbase.hxx> @@ -47,7 +48,6 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -#include <services.hxx> #include "streamhelper.hxx" namespace io_stm { @@ -345,7 +345,7 @@ void OMarkableOutputStream::checkMarksAndFlush() // XServiceInfo OUString OMarkableOutputStream::getImplementationName() { - return OMarkableOutputStream_getImplementationName(); + return "com.sun.star.comp.io.stm.MarkableOutputStream"; } // XServiceInfo @@ -357,32 +357,14 @@ sal_Bool OMarkableOutputStream::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > OMarkableOutputStream::getSupportedServiceNames() { - return OMarkableOutputStream_getSupportedServiceNames(); -} - -/*------------------------ -* -* external binding -* -*------------------------*/ -Reference< XInterface > OMarkableOutputStream_CreateInstance( - SAL_UNUSED_PARAMETER const Reference < XComponentContext > & ) -{ - OMarkableOutputStream *p = new OMarkableOutputStream( ); - - return Reference < XInterface > ( static_cast<OWeakObject *>(p) ); -} - -OUString OMarkableOutputStream_getImplementationName() -{ - return "com.sun.star.comp.io.stm.MarkableOutputStream"; + return { "com.sun.star.io.MarkableOutputStream" }; } -Sequence<OUString> OMarkableOutputStream_getSupportedServiceNames() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +io_OMarkableOutputStream_get_implementation( + css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - Sequence<OUString> aRet { "com.sun.star.io.MarkableOutputStream" }; - - return aRet; + return cppu::acquire(new OMarkableOutputStream()); } @@ -758,7 +740,7 @@ void OMarkableInputStream::checkMarksAndFlush() // XServiceInfo OUString OMarkableInputStream::getImplementationName() { - return OMarkableInputStream_getImplementationName(); + return "com.sun.star.comp.io.stm.MarkableInputStream"; } // XServiceInfo @@ -770,30 +752,14 @@ sal_Bool OMarkableInputStream::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > OMarkableInputStream::getSupportedServiceNames() { - return OMarkableInputStream_getSupportedServiceNames(); -} - -/*------------------------ -* -* external binding -* -*------------------------*/ -Reference < XInterface > OMarkableInputStream_CreateInstance( - SAL_UNUSED_PARAMETER const Reference < XComponentContext > & ) -{ - OMarkableInputStream *p = new OMarkableInputStream( ); - return Reference< XInterface > ( static_cast<OWeakObject *>(p) ); -} - -OUString OMarkableInputStream_getImplementationName() -{ - return "com.sun.star.comp.io.stm.MarkableInputStream"; + return { "com.sun.star.io.MarkableInputStream" }; } -Sequence<OUString> OMarkableInputStream_getSupportedServiceNames() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +io_OMarkableInputStream_get_implementation( + css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - Sequence<OUString> aRet { "com.sun.star.io.MarkableInputStream" }; - return aRet; + return cppu::acquire(new OMarkableInputStream()); } } |