diff options
author | Rene Engelhard <rene@openoffice.org> | 2010-04-13 17:55:14 +0200 |
---|---|---|
committer | Rene Engelhard <rene@openoffice.org> | 2010-04-13 17:55:14 +0200 |
commit | 66702acdab3307145724afd18737ae79aa22607f (patch) | |
tree | e4daa4c5c4a4cc7b62fa7685cdb1d2cd1fefcdaf /cui/source/options | |
parent | 13a7dda680909ce9558ba6c141b887feb04feb66 (diff) |
nspluginglobal: disable "Mozilla Plug-In" page in options when we have the plugin registered globally
Diffstat (limited to 'cui/source/options')
-rw-r--r-- | cui/source/options/treeopt.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index f1651b0bd1dd..b63d9afc647e 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -129,6 +129,13 @@ #include <svx/drawitem.hxx> #include <rtl/uri.hxx> +#ifdef LINUX +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#endif + using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -2195,6 +2202,28 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) continue; #endif +#ifdef LINUX + // Disable Mozilla Plug-in tab-page on Linux if we find a + // globally installed plugin + if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) { + struct stat sb; + char *p; + bool bHaveSystemWidePlugin = false; + char mozpaths[]="/usr/lib/mozilla/plugins/libnpsoplugin.so:/usr/lib/firefox/plugins/libnpsoplugin.so:/usr/lib/mozilla-firefox/plugins/libnpsoplugin.so:/usr/lib/iceweasel/plugins/libnpsoplugin.so:/usr/lib/iceape/plugins/libnpsoplugin.so:/usr/lib/browser-plugins/libnpsoplugin.so:/usr/lib64/browser-plugins/libnpsoplugin.so"; + + p = strtok(mozpaths, ":"); + while (p != NULL) { + if (stat(p, &sb) != -1) { + bHaveSystemWidePlugin = true; + break; + } + p = strtok(NULL, ":"); + } + + if (bHaveSystemWidePlugin == true) + continue; + } +#endif AddTabPage( nPageId, rInetArray.GetString(i), nGroup ); } } |