summaryrefslogtreecommitdiffstats
path: root/stoc
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-18 10:51:50 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-18 17:02:40 +0100
commit73eca35b0a8e01a7be2ce1775d1937154b5efb9e (patch)
treef0a3cf3ccdf3283b06ac068d464acde29a31257d /stoc
parentfwk: Use constructor feature for ModuleAcceleratorConfiguration. (diff)
downloadcore-73eca35b0a8e01a7be2ce1775d1937154b5efb9e.tar.gz
core-73eca35b0a8e01a7be2ce1775d1937154b5efb9e.zip
Unify ctor functions for component implementations.
There is no need to use different styles for writing the same thing. It also makes it easier in future to use search & replace. But of course, there are also some more complicated functions. Change-Id: I773da20378af0e0d5a27689d3903df7063fb8ac0
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/defaultregistry/defaultregistry.cxx6
-rw-r--r--stoc/source/implementationregistration/implreg.cxx8
-rw-r--r--stoc/source/loader/dllcomponentloader.cxx6
-rw-r--r--stoc/source/security/access_controller.cxx7
-rw-r--r--stoc/source/security/file_policy.cxx10
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx16
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx5
7 files changed, 25 insertions, 33 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index ca66017a9e87..c1c07e17079e 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <registry/registry.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -1354,10 +1355,9 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new NestedRegistryImpl));
+ rtl::Reference<NestedRegistryImpl> x(new NestedRegistryImpl);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 7b7a13cca5ef..e5daf98392f8 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -30,9 +30,9 @@
#include <uno/mapping.hxx>
#include <osl/thread.h>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
#include <osl/process.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -1821,11 +1821,9 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(
- new ImplementationRegistration(context)));
+ rtl::Reference<ImplementationRegistration> x(new ImplementationRegistration(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index b8e196ab3d0f..14fc172cd4a6 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -24,6 +24,7 @@
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <osl/module.h>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <uno/environment.h>
#include <uno/mapping.hxx>
@@ -169,10 +170,9 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new DllComponentLoader(context)));
+ rtl::Reference<DllComponentLoader> x(new DllComponentLoader(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 9edb8c4edef3..2e6c84bac924 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -26,8 +26,8 @@
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/string.hxx>
#include <uno/current_context.h>
#include <uno/lbnames.h>
@@ -984,10 +984,9 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new AccessController(context)));
+ rtl::Reference<AccessController> x(new AccessController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 47d1ae602a3e..4cd5e8c000ab 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -23,7 +23,7 @@
#include <osl/diagnose.h>
#include <osl/file.h>
#include <rtl/byteseq.hxx>
-#include <rtl/string.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/access_control.hxx>
@@ -42,7 +42,6 @@
#define IMPL_NAME "com.sun.star.security.comp.stoc.FilePolicy"
using namespace ::osl;
-using namespace ::rtl;
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -157,7 +156,7 @@ class PolicyReader
oslFileHandle m_file;
sal_Int32 m_linepos;
- ByteSequence m_line;
+ rtl::ByteSequence m_line;
sal_Int32 m_pos;
sal_Unicode m_back;
@@ -546,10 +545,9 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FilePolicy(context)));
+ rtl::Reference<FilePolicy> x(new FilePolicy(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 42531052a39c..1dd406ec89e0 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -19,6 +19,7 @@
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <boost/unordered_map.hpp>
@@ -1675,10 +1676,9 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new OServiceManager(context)));
+ rtl::Reference<OServiceManager> x(new OServiceManager(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1686,10 +1686,9 @@ com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context)));
+ rtl::Reference<ORegistryServiceManager> x(new ORegistryServiceManager(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1697,10 +1696,9 @@ com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new OServiceManagerWrapper(context)));
+ rtl::Reference<OServiceManagerWrapper> x(new OServiceManagerWrapper(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 97fe443a9762..96230e17ab97 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1128,10 +1128,9 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SimpleRegistry));
+ rtl::Reference<SimpleRegistry> x(new SimpleRegistry);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */