Kaydet (Commit) 5f37f560 authored tarafından Yeliz Taneroğlu's avatar Yeliz Taneroğlu Kaydeden (comit) Matúš Kukan

tdf#74608 Constructor function for MemoryStream

Change-Id: I5b0667c4c2808913cde686afa7315ef2319b4d49
üst 5a6ab816
......@@ -23,7 +23,6 @@
#include <sal/config.h>
void createRegistryInfo_Map();
void createRegistryInfo_UNOMemoryStream();
#endif
......
......@@ -34,7 +34,6 @@ namespace comphelper { namespace module
public:
doInitialize()
{
createRegistryInfo_UNOMemoryStream();
createRegistryInfo_Map();
}
};
......
......@@ -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: */
......@@ -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"
......
......@@ -101,6 +101,7 @@ core_constructor_list = [
"com_sun_star_comp_chart2_ChartDocumentWrapper_get_implementation",
"com_sun_star_comp_chart2_ChartFrameLoader_get_implementation",
# comphelper/util/comphelp.component
"com_sun_star_comp_MemoryStream",
"com_sun_star_comp_logging_SimpleLogRing",
"com_sun_star_comp_task_OfficeRestartManager",
"IndexedPropertyValuesContainer_get_implementation",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment