summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-12-16 10:46:34 +0000
committerKurt Zenker <kz@openoffice.org>2004-12-16 10:46:34 +0000
commit45cea9c2ecf256d7c93a5ad50d18c7b65866d619 (patch)
treec71e41a388ed5b44b00550b4ff88a00fed9b482f /jvmfwk
parent9e200fb3175e83c9a8783c79218b514b3131d562 (diff)
INTEGRATION: CWS jl15 (1.2.20); FILE MERGED
2004/11/24 12:43:33 jl 1.2.20.1: #i37225#
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx43
1 files changed, 41 insertions, 2 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index 24aac093cbac..6d5e9b3af99b 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: vendorlist.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: hr $ $Date: 2004-07-23 11:53:22 $
+ * last change: $Author: kz $ $Date: 2004-12-16 11:46:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,11 +62,19 @@
#include "vendorlist.hxx"
#include "sunjre.hxx"
#include "otherjre.hxx"
+#include "osl/thread.h"
+#include <stdio.h>
+using namespace com::sun::star::uno;
+using namespace rtl;
namespace jfw_plugin
{
+/* Note: The vendor strings must be UTF-8. For example, if
+ the string contains an a umlaut then it must be expressed
+ by "\xXX\xXX"
+ */
BEGIN_VENDOR_MAP()
VENDOR_MAP_ENTRY("Sun Microsystems Inc.", SunInfo)
VENDOR_MAP_ENTRY("IBM Corporation", OtherInfo)
@@ -75,4 +83,35 @@ BEGIN_VENDOR_MAP()
END_VENDOR_MAP()
+Sequence<OUString> getVendorNames()
+{
+ const size_t count = sizeof(gVendorMap) / sizeof (VendorSupportMapEntry) - 1;
+ OUString arNames[count];
+ for ( sal_Int32 pos = 0; pos < count; ++pos )
+ {
+ OString sVendor(gVendorMap[pos].sVendorName);
+ arNames[pos] = OStringToOUString(sVendor, RTL_TEXTENCODING_UTF8);
+ }
+ return Sequence<OUString>(arNames, count);
+}
+
+bool isVendorSupported(const rtl::OUString& sVendor)
+{
+ Sequence<OUString> seqNames = getVendorNames();
+ const OUString * arNames = seqNames.getConstArray();
+ sal_Int32 count = seqNames.getLength();
+
+ for (int i = 0; i < count; i++)
+ {
+ if (sVendor.equals(arNames[i]))
+ return true;
+ }
+#if OSL_DEBUG_LEVEL >= 2
+ OString sVendorName = OUStringToOString(sVendor, osl_getThreadTextEncoding());
+ fprintf(stderr, "[Java frameworksunjavaplugin.so]sunjavaplugin does not support vendor: %s.\n",
+ sVendorName.getStr());
+#endif
+ return false;
+}
+
}