Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3785

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/85/3785/1

fdo#54087 refactor/fix browser plugin detection on Windows

Former code did not find the Firefox plugin, if it was
registered under HKEY_CURRENT_USER. Therefore the checkbox state was not
preserved in Tools - Options - Internet - Browser Plug-in.

Change-Id: I9ae2a7dae1501500d7ea7cb42517605219450af3
---
M cui/source/dialogs/winpluginlib.cxx
1 file changed, 5 insertions(+), 26 deletions(-)



diff --git a/cui/source/dialogs/winpluginlib.cxx b/cui/source/dialogs/winpluginlib.cxx
index 237e33b..b34d3be 100644
--- a/cui/source/dialogs/winpluginlib.cxx
+++ b/cui/source/dialogs/winpluginlib.cxx
@@ -42,36 +42,17 @@
 extern "C" {
 int lc_isInstalled(const  char* realFilePath)
 {
-    HKEY hKeySoftware;
-    HKEY hMozillaPlugins;
-    HKEY hStarOffice;
+    HKEY hLibreOffice;
     char sSoPath[SO_PATH_SIZE];
     char sPluginPath[SO_PATH_SIZE];
 
     LONG ret;
-    ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,  "SOFTWARE",  0,  KEY_READ, &hKeySoftware);
+    ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,  
"SOFTWARE\\MozillaPlugins\\@sun.com/npsopluginmi;version=1.0",  0,  KEY_READ, &hLibreOffice);
     if(ret != ERROR_SUCCESS){
-        ret = RegOpenKeyEx(HKEY_CURRENT_USER,  "SOFTWARE",  0,  KEY_READ, &hKeySoftware);
+        ret = RegOpenKeyEx(HKEY_CURRENT_USER,  
"SOFTWARE\\MozillaPlugins\\@sun.com/npsopluginmi;version=1.0",  0,  KEY_READ, &hLibreOffice);
         if(ret != ERROR_SUCCESS){
             return -1;
         }
-    }
-    ret = RegOpenKeyEx(hKeySoftware,  "MozillaPlugins",  0,  KEY_READ, &hMozillaPlugins);
-    if(ret != ERROR_SUCCESS){
-        RegCloseKey(hKeySoftware);
-        if( ret == ERROR_FILE_NOT_FOUND)
-            return 1;
-        else
-            return -1;
-    }
-    ret = RegOpenKeyEx(hMozillaPlugins,  "@sun.com/npsopluginmi;version=1.0",  0,  KEY_READ, 
&hStarOffice);
-    if(ret != ERROR_SUCCESS){
-        RegCloseKey(hKeySoftware);
-        RegCloseKey(hMozillaPlugins);
-        if( ret == ERROR_FILE_NOT_FOUND)
-            return 1;
-        else
-            return -1;
     }
 
     if((realFilePath == NULL) || (strlen(realFilePath) == 0) || (strlen(realFilePath) >= 
SO_PATH_SIZE))
@@ -85,7 +66,7 @@
     if(ret == 0){
         DWORD  dType = REG_SZ;
         DWORD  dSize = SO_PATH_SIZE;
-        ret = RegQueryValueEx (hStarOffice, "Path", NULL,  &dType , (LPBYTE) sPluginPath, &dSize);
+        ret = RegQueryValueEx (hLibreOffice, "Path", NULL,  &dType , (LPBYTE) sPluginPath, &dSize);
         if(ret == ERROR_SUCCESS){
             if(strcmp(sPluginPath, sSoPath) == 0)
                 ret = 0;
@@ -97,9 +78,7 @@
     }
     else
         ret = -1;
-    RegCloseKey(hStarOffice);
-    RegCloseKey(hMozillaPlugins);
-    RegCloseKey(hKeySoftware);
+    RegCloseKey(hLibreOffice);
     return ret;
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/3785
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ae2a7dae1501500d7ea7cb42517605219450af3
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Andras Timar <atimar@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.