summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorYeliz Taneroğlu <yeliztaneroglu@gmail.com>2016-04-11 13:06:11 +0300
committerMatúš Kukan <matus.kukan@gmail.com>2016-07-09 12:15:50 +0200
commit5f37f56088eae48508336d68100b68cca407668a (patch)
tree0e7f0496869d4cc3e415426abba0bdb2976d74f7 /comphelper
parent5a6ab81651a98dd726ab7d40101dc81f62895fd4 (diff)
tdf#74608 Constructor function for MemoryStream
Change-Id: I5b0667c4c2808913cde686afa7315ef2319b4d49
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/inc/comphelper_services.hxx1
-rw-r--r--comphelper/source/misc/comphelper_services.cxx1
-rw-r--r--comphelper/source/streaming/memorystream.cxx30
-rw-r--r--comphelper/util/comphelp.component3
4 files changed, 8 insertions, 27 deletions
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 9d356c17af2d..cfb720119d89 100644
--- a/comphelper/source/inc/comphelper_services.hxx
+++ b/comphelper/source/inc/comphelper_services.hxx
@@ -23,7 +23,6 @@
#include <sal/config.h>
void createRegistryInfo_Map();
-void createRegistryInfo_UNOMemoryStream();
#endif
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index 23d8e7f77ed5..cd5fa8dce72c 100644
--- a/comphelper/source/misc/comphelper_services.cxx
+++ b/comphelper/source/misc/comphelper_services.cxx
@@ -34,7 +34,6 @@ namespace comphelper { namespace module
public:
doInitialize()
{
- createRegistryInfo_UNOMemoryStream();
createRegistryInfo_Map();
}
};
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx
index 4e9eb64c1479..7b378964f81f 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -22,6 +22,7 @@
#include "comphelper_module.hxx"
#include "comphelper_services.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekableInputStream.hpp>
#include <com/sun/star/io/XTruncate.hpp>
@@ -72,11 +73,6 @@ public:
// XTruncate
virtual void SAL_CALL truncate() throw (css::io::IOException, css::uno::RuntimeException, std::exception) override;
- // XServiceInfo - static versions (used for component registration)
- static OUString SAL_CALL getImplementationName_static();
- static Sequence< OUString > SAL_CALL getSupportedServiceNames_static();
- static Reference< XInterface > SAL_CALL Create( const Reference< css::uno::XComponentContext >& );
-
private:
std::vector< sal_Int8 > maData;
sal_Int32 mnCursor;
@@ -212,28 +208,14 @@ void SAL_CALL UNOMemoryStream::truncate() throw (IOException, RuntimeException,
mnCursor = 0;
}
-OUString SAL_CALL UNOMemoryStream::getImplementationName_static()
-{
- return OUString("com.sun.star.comp.MemoryStream");
-}
-
-Sequence< OUString > SAL_CALL UNOMemoryStream::getSupportedServiceNames_static()
-{
- Sequence< OUString > aSeq { getImplementationName_static() };
- return aSeq;
-}
-
-Reference< XInterface > SAL_CALL UNOMemoryStream::Create(
- SAL_UNUSED_PARAMETER const Reference< XComponentContext >& )
-{
- return static_cast<OWeakObject*>(new UNOMemoryStream());
-}
-
} // namespace comphelper
-void createRegistryInfo_UNOMemoryStream()
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_MemoryStream(
+ css::uno::XComponentContext *,
+ css::uno::Sequence<css::uno::Any> const &)
{
- static ::comphelper::module::OAutoRegistration< ::comphelper::UNOMemoryStream > aAutoRegistration;
+ return cppu::acquire(new ::comphelper::UNOMemoryStream());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index 0fbf81a09898..c953f52fe044 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -31,7 +31,8 @@
constructor="NamedPropertyValuesContainer_get_implementation">
<service name="com.sun.star.document.NamedPropertyValues"/>
</implementation>
- <implementation name="com.sun.star.comp.MemoryStream">
+ <implementation name="com.sun.star.comp.MemoryStream"
+ constructor="com_sun_star_comp_MemoryStream">
<service name="com.sun.star.comp.MemoryStream"/>
</implementation>
<implementation name="com.sun.star.comp.SequenceInputStreamService"