summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-10 15:07:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-10 17:39:56 +0100
commit271cd24927cdff55dc80bc19fb3bd5764624a79e (patch)
treec36b0b35bdaff36b30a3a74c35a7e3bd496b3d99 /odk
parent5d042ce18555a7397b46746844cdbd62cc96f5f3 (diff)
odk: simplify deprecated XTypeProvider.getImplementationId
Change-Id: I48b3206bf9c2186c991637b58120285c8c0ee00a
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx29
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java13
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java6
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java12
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java2
5 files changed, 7 insertions, 55 deletions
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
index ab8234873359..1c07b9f5396a 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
@@ -35,8 +35,6 @@
#include <osl/interlck.h>
#include <osl/mutex.hxx>
-#include <rtl/uuid.h>
-#include <rtl/instance.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -173,34 +171,11 @@ Sequence< Type > MyService1Impl::getTypes()
seq[ 2 ] = ::cppu::UnoType< Reference< ::my_module::XSomething > >::get();
return seq;
}
-namespace
-{
- // class to create an unique id
- class UniqueIdInit
- {
- private:
- ::com::sun::star::uno::Sequence< sal_Int8 > m_aSeq;
- public:
- UniqueIdInit() : m_aSeq(16)
- {
- rtl_createUuid( (sal_uInt8*)m_aSeq.getArray(), 0, sal_True );
- }
- const ::com::sun::star::uno::Sequence< sal_Int8 >& getSeq() const { return m_aSeq; }
- };
- //A multi-thread safe UniqueIdInit singleton wrapper
- class theService1ImplImplementationId
- : public rtl::Static< UniqueIdInit,
- theService1ImplImplementationId >
- {
- };
-}
+
Sequence< sal_Int8 > MyService1Impl::getImplementationId()
throw (RuntimeException)
{
- //create a singleton that generates a unique id on
- //first initialization and returns the same one
- //on subsequent calls.
- return theService1ImplImplementationId::get().getSeq();
+ return css::uno::Sequence<sal_Int8>();
}
// XSomething implementation
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java
index 006cdceedb2c..7c397cc1b5e6 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java
@@ -43,7 +43,6 @@ import com.sun.star.uno.Type;
public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB {
static final String __serviceName= "com.sun.star.test.SomethingB";
- static byte[] _implementationId;
private XComponentContext context;
private Object[] args;
@@ -68,16 +67,8 @@ public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB
return retValue;
}
//XTypeProvider
- synchronized public byte[] getImplementationId( ) {
- if (_implementationId == null) {
- _implementationId= new byte[16];
- int hash = hashCode();
- _implementationId[0] = (byte)(hash & 0xff);
- _implementationId[1] = (byte)((hash >>> 8) & 0xff);
- _implementationId[2] = (byte)((hash >>> 16) & 0xff);
- _implementationId[3] = (byte)((hash >>>24) & 0xff);
- }
- return _implementationId;
+ public byte[] getImplementationId( ) {
+ return new byte[0];
}
//XServiceInfo
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
index 2d5356b11236..44fe05699188 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
@@ -52,12 +52,6 @@ public class ImageShrink extends WeakBase
com.sun.star.uno.XComponentContext xComponentContext = null;
-
- // maintain a static implementation id for all instances of ImageShrink
- // initialized by the first call to getImplementationId()
- static byte[] _implementationId;
-
-
// hold the service name in a private static member variable of the class
protected static final String __serviceName = "org.openoffice.test.ImageShrink";
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index 49f31facabba..e408843ed8ae 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
@@ -209,16 +209,8 @@ public class DialogComponent {
return retValue;
}
//XTypeProvider
- synchronized public byte[] getImplementationId( ) {
- if (_implementationId == null) {
- _implementationId= new byte[16];
- int hash = hashCode();
- _implementationId[0] = (byte)(hash & 0xff);
- _implementationId[1] = (byte)((hash >>> 8) & 0xff);
- _implementationId[2] = (byte)((hash >>> 16) & 0xff);
- _implementationId[3] = (byte)((hash >>>24) & 0xff);
- }
- return _implementationId;
+ public byte[] getImplementationId( ) {
+ return new byte[0];
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
index b7c23161709e..942c97a6802c 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
@@ -71,7 +71,7 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
// --- XTypeProvider ---
public byte[] getImplementationId() {
- return Integer.toString(this.hashCode()).getBytes();
+ return new byte[0];
}
// --- XServiceName ---