summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2012-08-27 23:56:18 +0000
committerAriel Constenla-Haile <arielch@apache.org>2012-08-27 23:56:18 +0000
commit0a731aa083647216a65df8f78c909fb8995cb3a0 (patch)
treeec0bf3fee3dadc049f3f3c2f0d9dc9328e90a009 /cui
parenta4d6bd1f44adb7ece8e6f928c60239d875867f96 (diff)
#i120518# - Remove the "Browser Plug-in" tab page
Notes
Notes: reject: self-inflicted feature removal
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optinet2.cxx193
-rwxr-xr-xcui/source/options/optinet2.hrc5
-rw-r--r--cui/source/options/optinet2.hxx23
-rw-r--r--cui/source/options/optinet2.src28
-rw-r--r--cui/source/options/treeopt.cxx31
-rw-r--r--cui/source/options/treeopt.src1
6 files changed, 0 insertions, 281 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index c2618d69b122..0ce2cc604ff7 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1505,199 +1505,6 @@ void SvxSecurityTabPage::Reset( const SfxItemSet& )
}
}
-//added by jmeng begin
-MozPluginTabPage::MozPluginTabPage(Window* pParent, const SfxItemSet& rSet)
- : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_INET_MOZPLUGIN ), rSet ),
- aMSWordGB ( this, CUI_RES( GB_MOZPLUGIN ) ),
- aWBasicCodeCB ( this, CUI_RES( CB_MOZPLUGIN_CODE ) )
-{
- FreeResource();
-}
-
-MozPluginTabPage::~MozPluginTabPage()
-{
-}
-
-SfxTabPage* MozPluginTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return new MozPluginTabPage( pParent, rAttrSet );
-}
-sal_Bool MozPluginTabPage::FillItemSet( SfxItemSet& )
-{
- sal_Bool hasInstall = isInstalled();
- sal_Bool hasChecked = aWBasicCodeCB.IsChecked();
- if(hasInstall && (!hasChecked)){
- //try to uninstall
- uninstallPlugin();
- }
- else if((!hasInstall) && hasChecked){
- //try to install
- installPlugin();
- }
- else{
- // do nothing
- }
- return sal_True;
-}
-void MozPluginTabPage::Reset( const SfxItemSet& )
-{
- aWBasicCodeCB.Check( isInstalled());
- aWBasicCodeCB.SaveValue();
-}
-
-#ifdef WNT
-extern "C" {
- int lc_isInstalled(const char* realFilePath);
- int lc_installPlugin(const char* realFilePath);
- int lc_uninstallPlugin(const char* realFilePath);
-}
-#endif
-
-#define NPP_PATH_MAX 2048
-inline bool getDllURL(rtl::OString * path)
-{
- OSL_ASSERT(path != NULL);
- ::rtl::OUString dirPath/*dllPath, */;
- if (osl_getExecutableFile(&dirPath.pData) != osl_Process_E_None) {
- return false;
- }
- dirPath = dirPath.copy(0, dirPath.lastIndexOf('/'));
-// osl::FileBase::getAbsoluteFileURL(dirPath, libPath, dllPath);
- ::rtl::OUString sysDirPath;
- osl::FileBase::getSystemPathFromFileURL(dirPath, sysDirPath);
- *path = OUStringToOString(sysDirPath, RTL_TEXTENCODING_ASCII_US);
- return true;
-}
-
-sal_Bool MozPluginTabPage::isInstalled()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char lnkReferFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
-
- struct stat sBuf;
- if (0 > lstat(lnkFilePath, &sBuf))
- return false;
- if (!S_ISLNK(sBuf.st_mode))
- return false;
- if (0 >= readlink(lnkFilePath, lnkReferFilePath, NPP_PATH_MAX))
- return false;
- // If the link is relative, then we regard it as non-standard
- if (lnkReferFilePath[0] != '/')
- return false;
-
- // get the real file path
- char realFilePath[NPP_PATH_MAX] = {0};
- ::rtl::OString tempString;
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- strcat(realFilePath, "/libnpsoplugin" SAL_DLLEXTENSION);
-
- if (0 != strcmp(lnkReferFilePath, realFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- // get the value from registry
- sal_Bool ret = true;
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)){
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if(! lc_isInstalled(realFilePath))
- ret =true;
- else
- ret = false;
- return ret;
-#endif
-}
-
-sal_Bool MozPluginTabPage::installPlugin()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
- remove(lnkFilePath);
-
- // create the dirs if necessary
- struct stat buf;
- char tmpDir[NPP_PATH_MAX] = {0};
- sprintf(tmpDir, "%s/.mozilla", pHome);
- if (0 > stat(lnkFilePath, &buf))
- {
- mkdir(tmpDir, 0755);
- strcat(tmpDir, "/plugins");
- mkdir(tmpDir, 0755);
- }
-
- // get the real file path
- char realFilePath[NPP_PATH_MAX] = {0};
- ::rtl::OString tempString;
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- strcat(realFilePath, "/libnpsoplugin" SAL_DLLEXTENSION);
-
- // create the link
- if (0 != symlink(realFilePath, lnkFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if( !lc_installPlugin(realFilePath))
- return true;
- else
- return false;
-#endif
-}
-
-sal_Bool MozPluginTabPage::uninstallPlugin()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
-
- if(0 > remove(lnkFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if(!lc_uninstallPlugin(realFilePath))
- return true;
- else
- return false;
-#endif
-}
-//added by jmeng end
-
/* -------------------------------------------------------------------------*/
class MailerProgramCfg_Impl : public utl::ConfigItem
diff --git a/cui/source/options/optinet2.hrc b/cui/source/options/optinet2.hrc
index b9643c065b7b..784f096e0a16 100755
--- a/cui/source/options/optinet2.hrc
+++ b/cui/source/options/optinet2.hrc
@@ -156,11 +156,6 @@
#define PB_MAILERURL 5
#define STR_DEFAULT_FILENAME 6
-// plugin
-#define GB_MOZPLUGIN 1
-#define CB_MOZPLUGIN_CODE 2
-
-
#endif // #ifndef _SVX_OPTINET_HRC
// ******************************************************************* EOF
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 8b13c44bf3e7..e49e504616a9 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -273,29 +273,6 @@ public:
virtual void Reset( const SfxItemSet& rSet );
};
-//added by jmeng begin
-class MozPluginTabPage : public SfxTabPage
-{
- FixedLine aMSWordGB;
- CheckBox aWBasicCodeCB;
-
- sal_Bool isInstalled(void);
- sal_Bool installPlugin(void);
- sal_Bool uninstallPlugin(void);
-
- MozPluginTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~MozPluginTabPage();
-
-public:
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet );
-
- virtual sal_Bool FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-};
-//added by jmeng end
#endif
/* -----------------------------20.06.01 16:32--------------------------------
diff --git a/cui/source/options/optinet2.src b/cui/source/options/optinet2.src
index d8f6de6ade49..c1af998776cd 100644
--- a/cui/source/options/optinet2.src
+++ b/cui/source/options/optinet2.src
@@ -33,34 +33,6 @@
/* */
/************************************************************************/
-// added by jmeng begin
-
-TabPage RID_SVXPAGE_INET_MOZPLUGIN
-{
- HelpID = "cui:TabPage:RID_SVXPAGE_INET_MOZPLUGIN";
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- FixedLine GB_MOZPLUGIN
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text[ en-US ] = "Browser Plug-in";
- };
- CheckBox CB_MOZPLUGIN_CODE
- {
- HelpID = "cui:CheckBox:RID_SVXPAGE_INET_MOZPLUGIN:CB_MOZPLUGIN_CODE";
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Display documents in browser" ;
- };
-};
-
-//added by jmeng end
-
TabPage RID_SVXPAGE_INET_PROXY
{
HelpId = HID_OPTIONS_PROXY ;
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 7153c9c181b3..074e5d5f6c2e 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -363,9 +363,6 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break;
case RID_SVXPAGE_SSO: fnCreate = GetSSOCreator(); break;
case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break;
- //added by jmeng begin
- case RID_SVXPAGE_INET_MOZPLUGIN: fnCreate = &MozPluginTabPage::Create; break;
- //added by jmeng end
case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
@@ -413,7 +410,6 @@ static OptionsMapping_Impl __READONLY_DATA OptionsMap_Impl[] =
{ "Internet", "Proxy", RID_SVXPAGE_INET_PROXY },
{ "Internet", "Search", RID_SVXPAGE_INET_SEARCH },
{ "Internet", "Email", RID_SVXPAGE_INET_MAIL },
- { "Internet", "MozillaPlugin", RID_SVXPAGE_INET_MOZPLUGIN },
{ "LoadSave", NULL, SID_FILTER_DLG },
{ "LoadSave", "General", RID_SFXPAGE_SAVE },
{ "LoadSave", "VBAProperties", SID_OPTFILTER_MSOFFICE },
@@ -2178,33 +2174,6 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
if ( nPageId == RID_SVXPAGE_INET_MAIL )
continue;
#endif
-#if defined MACOSX
- // Disable Mozilla Plug-in tab-page on Mac
- 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 );
}
}
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 0032727ba25c..d43b4c970ad0 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -182,7 +182,6 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
< "Proxy" ; RID_SVXPAGE_INET_PROXY; > ;
< "Search" ; RID_SVXPAGE_INET_SEARCH; > ;
< "E-mail" ; RID_SVXPAGE_INET_MAIL; > ;
- < "Browser Plug-in" ; RID_SVXPAGE_INET_MOZPLUGIN; > ;
};
//modified by jmeng end
};