[Libreoffice-commits] core.git: scp2/inc scp2/source

Mike Kaganski mike.kaganski at collabora.com
Tue Oct 18 08:40:17 UTC 2016


 scp2/inc/macros.inc                          |   45 +++++++++++++++++++++++++++
 scp2/source/calc/registryitem_calc.scp       |    3 +
 scp2/source/draw/registryitem_draw.scp       |    2 +
 scp2/source/impress/registryitem_impress.scp |    3 +
 scp2/source/ooo/registryitem_ooo.scp         |    3 +
 scp2/source/writer/registryitem_writer.scp   |    4 +-
 6 files changed, 58 insertions(+), 2 deletions(-)

New commits:
commit fdd8686987ca4ee693f5f194c8eb482daa69cfef
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Oct 18 16:02:46 2016 +1000

    tdf#100837: Register new URI handlers with installer
    
    This patch registers vnd.libreoffice.command unconditionally,
    and also registerd ms-word, ms-excel, ms-visio and ms-powerpoint
    handlers according to SELECT_WORD, SELECT_EXCEL, SELECT_VISIO, and
    SELECT_POWERPOINT properties (that are set in FileTypeDialog).
    
    This allows to use these URIs in e.g. SharePoint WebDAV integration
    
    Change-Id: I3231a15196858da77f1784a47f86f1729a6044bb
    Reviewed-on: https://gerrit.libreoffice.org/29988
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/scp2/inc/macros.inc b/scp2/inc/macros.inc
index 30f6760..4de35db 100644
--- a/scp2/inc/macros.inc
+++ b/scp2/inc/macros.inc
@@ -544,5 +544,50 @@ File gid_File_Extra_GallFiles##id \
     Name = STRING(CONCAT3(Gallery/Files/,id,.filelist)); \
 End
 
+#define REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,cond) \
+RegistryItem CONCAT2(gid_Regitem_,protid) \
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
+    ModuleID = modid; \
+    Subkey = STRING(protocol); \
+    Value = "URL:" STRING(protocol) " Protocol"; \
+    cond \
+End \
+RegistryItem CONCAT3(gid_Regitem_,protid,_URL_Protocol) \
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
+    ModuleID = modid; \
+    Subkey = STRING(protocol); \
+    Name = "URL Protocol"; \
+End \
+RegistryItem CONCAT3(gid_Regitem_,protid,_UseOriginalUrlEncoding) \
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
+    ModuleID = modid; \
+    Subkey = STRING(protocol); \
+    Name = "UseOriginalUrlEncoding"; \
+    Value = "#1"; \
+End \
+RegistryItem CONCAT3(gid_Regitem_,protid,_DefaultIcon) \
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
+    ModuleID = modid; \
+    Subkey = STRING(CONCAT2(protocol,\DefaultIcon)); \
+    Value = "<progpath>\program\soffice.bin,0"; \
+End \
+RegistryItem CONCAT3(gid_Regitem_,protid,_shell_open_command) \
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
+    ModuleID = modid; \
+    Subkey = STRING(CONCAT2(protocol,\shell\open\command)); \
+    Value = "\"<progpath>\program\soffice.exe\" \"%1\""; \
+End
+
+#define REG_COND(cond) \
+    ComponentCondition = STRING(CONCAT2(cond,=1));
+
+#define REG_EMPTY_COND
+
+#define REGISTER_URI_HANDLER(protocol,protid,modid) \
+    REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,REG_EMPTY_COND)
+
+#define CONDITIONAL_REGISTER_URI_HANDLER(protocol,protid,modid,cond) \
+    CONDITIONAL_MODULE_ENTRY(protid,modid) \
+    REGISTER_URI_HANDLER_IMPL(protocol,protid,gid_Module_Root_Reg_##protid,REG_COND(cond))
 
 #endif // MACROS_INC
diff --git a/scp2/source/calc/registryitem_calc.scp b/scp2/source/calc/registryitem_calc.scp
index 96c10d7..7259226 100644
--- a/scp2/source/calc/registryitem_calc.scp
+++ b/scp2/source/calc/registryitem_calc.scp
@@ -1257,3 +1257,6 @@ CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION( Xltm, gid_Module_Prg_Calc_MSO_Reg, x
 
 CONDITIONAL_REGISTER_DOC_EXTENSION( Uos, gid_Module_Prg_Calc_Other_Reg, uos, UOS, UNIFORM_OFFICE_FORMAT_SPREADSHEET, 3, scalc.exe, open, Calc )
 CONDITIONAL_REGISTER_DOC_EXTENSION( Wb2, gid_Module_Prg_Calc_Other_Reg, wb2, WB2, QUATTROPRO_SPREADSHEET, 3, scalc.exe, open, Calc )
+
+// registering ms-excel URI scheme handler
+CONDITIONAL_REGISTER_URI_HANDLER( ms-excel, ms_excel, gid_Module_Prg_Calc_MSO_Reg, SELECT_EXCEL )
diff --git a/scp2/source/draw/registryitem_draw.scp b/scp2/source/draw/registryitem_draw.scp
index 4323024..94e3543 100644
--- a/scp2/source/draw/registryitem_draw.scp
+++ b/scp2/source/draw/registryitem_draw.scp
@@ -1102,3 +1102,5 @@ CONDITIONAL_REGISTER_DOC_EXTENSION( Xbm,  gid_Module_Prg_Draw_Other_Reg, xbm,  X
 CONDITIONAL_REGISTER_DOC_EXTENSION( Xpm,  gid_Module_Prg_Draw_Other_Reg, xpm,  XPM,  X_PIXMAP, 5, sdraw.exe, open, Draw )
 CONDITIONAL_REGISTER_DOC_EXTENSION( PCD,  gid_Module_Prg_Draw_Other_Reg, pcd,  PCD,  KODAK_PHOTO_CD_IMAGE, 5, sdraw.exe, open, Draw )
 
+// registering ms-visio URI scheme handler
+CONDITIONAL_REGISTER_URI_HANDLER( ms-visio, ms_visio, gid_Module_Prg_Draw_MSO_Reg, SELECT_VISIO )
diff --git a/scp2/source/impress/registryitem_impress.scp b/scp2/source/impress/registryitem_impress.scp
index 23f3fda..76370ff 100644
--- a/scp2/source/impress/registryitem_impress.scp
+++ b/scp2/source/impress/registryitem_impress.scp
@@ -1123,3 +1123,6 @@ CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION( Potm, gid_Module_Prg_Impress_MSO_Reg
 
 CONDITIONAL_REGISTER_DOC_EXTENSION( Uop, gid_Module_Prg_Impress_Other_Reg, uop, UOP, UNIFORM_OFFICE_FORMAT_PRESENTATION, 7, simpress.exe, open, Impress )
 CONDITIONAL_REGISTER_DOC_EXTENSION( Cgm, gid_Module_Prg_Impress_Other_Reg, cgm, CGM, COMPUTER_GRAPHICS_METAFILE, 7, simpress.exe, open, Impress )
+
+// registering ms-powerpoint URI scheme handler
+CONDITIONAL_REGISTER_URI_HANDLER( ms-powerpoint, ms_powerpoint, gid_Module_Prg_Impress_MSO_Reg, SELECT_POWERPOINT )
diff --git a/scp2/source/ooo/registryitem_ooo.scp b/scp2/source/ooo/registryitem_ooo.scp
index 033b3c1..f6c0e49 100644
--- a/scp2/source/ooo/registryitem_ooo.scp
+++ b/scp2/source/ooo/registryitem_ooo.scp
@@ -676,3 +676,6 @@ RegistryItem gid_Regitem_Software_RegisteredApplications
     Value = "SOFTWARE\%MANUFACTURER\%PRODUCTNAME\%PRODUCTVERSION\Capabilities";
 	Styles = ();
 End
+
+// registering vnd.libreoffice.command URI scheme handler
+REGISTER_URI_HANDLER( vnd.libreoffice.command, vnd_libreoffice_command, gid_Module_Root )
diff --git a/scp2/source/writer/registryitem_writer.scp b/scp2/source/writer/registryitem_writer.scp
index a1db1ef..61498b4 100644
--- a/scp2/source/writer/registryitem_writer.scp
+++ b/scp2/source/writer/registryitem_writer.scp
@@ -1719,7 +1719,6 @@ RegistryItem gid_Regitem_Software_Microsoft_Windows_Currentversion_Apppaths_Swri
     Value = "<progpath>";
 End
 
-
 // registering the property handler for the supported file types
 
 REGISTER_PROPERTY_HANDLER_FOR_EXTENSION( odt )
@@ -1747,4 +1746,5 @@ CONDITIONAL_REGISTER_DOC_EXTENSION( Uot,  gid_Module_Prg_Wrt_Other_Reg, uot,  UO
 CONDITIONAL_REGISTER_DOC_EXTENSION( Lwp,  gid_Module_Prg_Wrt_Other_Reg, lwp,  LWP,  WORDPRO_DOCUMENT, 1, swriter.exe, open, Writer )
 CONDITIONAL_REGISTER_DOC_EXTENSION( 602,  gid_Module_Prg_Wrt_Other_Reg, 602,  602,  T602_TEXT_FILE, 1, swriter.exe, open, Writer )
 
-
+// registering ms-word URI scheme handler
+CONDITIONAL_REGISTER_URI_HANDLER( ms-word, ms_word, gid_Module_Prg_Wrt_MSO_Reg, SELECT_WORD )


More information about the Libreoffice-commits mailing list