[Libreoffice-commits] .: Branch 'feature/gbuild_extensions' - 22 commits - Module_tail_build.mk Repository.mk RepositoryExternal.mk RepositoryFixes.mk RepositoryModule_ooo.mk extensions/AllLangResTarget_abp.mk extensions/AllLangResTarget_bib.mk extensions/AllLangResTarget_dbp.mk extensions/Configuration_updchk.mk extensions/CppunitTest_extensions_test_update.mk extensions/Executable_nsplugin.mk extensions/Executable_pluginapp.bin.mk extensions/Library_OOoSpotlightImporter.mk extensions/Library_abp.mk extensions/Library_bib.mk extensions/Library_dbp.mk extensions/Library_ldapbe2.mk extensions/Library_log.mk extensions/Library_npsoplugin.mk extensions/Library_oleautobridge.mk extensions/Library_oleautobridge2.mk extensions/Library_pcr.mk extensions/Library_pl.mk extensions/Library_res.mk extensions/Library_so_activex.mk extensions/Library_so_activex_x64.mk extensions/Library_updchk.mk extensions/Library_xmx.mk extensions/Module_extensions.mk extensions/Package_bib.mk extensions/Package_pcr. mk extensions/WinResTarget_activex.mk extensions/WinResTarget_npsoplugin.mk extensions/Zip_mdibundle.mk extensions/inc extensions/prj extensions/source extensions/util postprocess/packcomponents postprocess/prj scp2/source solenv/gbuild tail_build/prj

Michael Stahl mst at kemper.freedesktop.org
Sat Dec 17 17:26:23 PST 2011


 Module_tail_build.mk                                     |    1 
 Repository.mk                                            |   36 
 RepositoryExternal.mk                                    |   22 
 RepositoryFixes.mk                                       |    2 
 RepositoryModule_ooo.mk                                  |    1 
 extensions/AllLangResTarget_abp.mk                       |   48 
 extensions/AllLangResTarget_bib.mk                       |   53 
 extensions/AllLangResTarget_dbp.mk                       |   50 
 extensions/Configuration_updchk.mk                       |    9 
 extensions/CppunitTest_extensions_test_update.mk         |   16 
 extensions/Executable_nsplugin.mk                        |   88 +
 extensions/Executable_pluginapp.bin.mk                   |   99 +
 extensions/Library_OOoSpotlightImporter.mk               |   52 
 extensions/Library_abp.mk                                |   91 +
 extensions/Library_bib.mk                                |   75 
 extensions/Library_dbp.mk                                |   77 +
 extensions/Library_ldapbe2.mk                            |   86 +
 extensions/Library_log.mk                                |   64 
 extensions/Library_npsoplugin.mk                         |   93 +
 extensions/Library_oleautobridge.mk                      |   14 
 extensions/Library_oleautobridge2.mk                     |   41 
 extensions/Library_pcr.mk                                |   92 -
 extensions/Library_pl.mk                                 |  160 ++
 extensions/Library_res.mk                                |   56 
 extensions/Library_so_activex.mk                         |   92 +
 extensions/Library_so_activex_x64.mk                     |   89 +
 extensions/Library_updchk.mk                             |    7 
 extensions/Library_xmx.mk                                |   54 
 extensions/Module_extensions.mk                          |   76 
 extensions/Package_bib.mk                                |   35 
 extensions/Package_pcr.mk                                |   35 
 extensions/WinResTarget_activex.mk                       |   46 
 extensions/WinResTarget_npsoplugin.mk                    |   35 
 extensions/Zip_mdibundle.mk                              |   38 
 extensions/inc/makefile.mk                               |   39 
 extensions/prj/build.lst                                 |   25 
 extensions/prj/d.lst                                     |   55 
 extensions/source/abpilot/exports.dxp                    |    1 
 extensions/source/abpilot/makefile.mk                    |  115 -
 extensions/source/activex/README.txt                     |   33 
 extensions/source/activex/SOActionsApproval.cxx          |   32 
 extensions/source/activex/SOActionsApproval.h            |   83 +
 extensions/source/activex/SOActionsApproval.rgs          |   24 
 extensions/source/activex/SOActiveX.cxx                  | 1153 +++++++++++++++
 extensions/source/activex/SOActiveX.h                    |  178 ++
 extensions/source/activex/SOActiveX.rgs                  |   33 
 extensions/source/activex/SOComWindowPeer.cxx            |   31 
 extensions/source/activex/SOComWindowPeer.h              |  136 +
 extensions/source/activex/SOComWindowPeer.rgs            |   23 
 extensions/source/activex/SODispatchInterceptor.cxx      |  225 ++
 extensions/source/activex/SODispatchInterceptor.h        |  158 ++
 extensions/source/activex/SODispatchInterceptor.rgs      |   23 
 extensions/source/activex/StdAfx2.cxx                    |   21 
 extensions/source/activex/StdAfx2.h                      |   45 
 extensions/source/activex/com_uno_helper.h               |   26 
 extensions/source/activex/example.html                   |   26 
 extensions/source/activex/main/README.txt                |   33 
 extensions/source/activex/main/SOActionsApproval.cpp     |   32 
 extensions/source/activex/main/SOActionsApproval.h       |   83 -
 extensions/source/activex/main/SOActionsApproval.rgs     |   24 
 extensions/source/activex/main/SOActiveX.cpp             | 1153 ---------------
 extensions/source/activex/main/SOActiveX.h               |  178 --
 extensions/source/activex/main/SOActiveX.rgs             |   33 
 extensions/source/activex/main/SOComWindowPeer.cpp       |   31 
 extensions/source/activex/main/SOComWindowPeer.h         |  136 -
 extensions/source/activex/main/SOComWindowPeer.rgs       |   23 
 extensions/source/activex/main/SODispatchInterceptor.cpp |  225 --
 extensions/source/activex/main/SODispatchInterceptor.h   |  158 --
 extensions/source/activex/main/SODispatchInterceptor.rgs |   23 
 extensions/source/activex/main/StdAfx2.cpp               |   21 
 extensions/source/activex/main/StdAfx2.h                 |   45 
 extensions/source/activex/main/com_uno_helper.h          |   26 
 extensions/source/activex/main/example.html              |   26 
 extensions/source/activex/main/makefile.mk               |  157 --
 extensions/source/activex/main/resource.h                |   28 
 extensions/source/activex/main/so_activex.cpp            |  685 --------
 extensions/source/activex/main/so_activex.def            |   13 
 extensions/source/activex/main/so_activex.rc             |  113 -
 extensions/source/activex/msidl/makefile.mk              |   62 
 extensions/source/activex/msidl/so_activex.idl           |  210 --
 extensions/source/activex/resource.h                     |   28 
 extensions/source/activex/so_activex.cxx                 |  685 ++++++++
 extensions/source/activex/so_activex.def                 |   13 
 extensions/source/activex/so_activex.idl                 |  210 ++
 extensions/source/activex/so_activex.rc                  |  111 +
 extensions/source/bibliography/makefile.mk               |   98 -
 extensions/source/config/ldap/exports.dxp                |    1 
 extensions/source/config/ldap/makefile.mk                |  105 -
 extensions/source/dbpilots/makefile.mk                   |  111 -
 extensions/source/logging/makefile.mk                    |   84 -
 extensions/source/macosx/spotlight/makefile.mk           |   99 -
 extensions/source/nsplugin/source/exports.dxp            |   16 
 extensions/source/nsplugin/source/exports_wnt.dxp        |   18 
 extensions/source/nsplugin/source/makefile.mk            |  164 --
 extensions/source/nsplugin/source/npshell.cxx            |   28 
 extensions/source/nsplugin/source/nsplugin.rc            |   30 
 extensions/source/plugin/aqua/makefile.mk                |   63 
 extensions/source/plugin/aqua/sysplug.cxx                |  812 ----------
 extensions/source/plugin/aqua/sysplug.mm                 |  812 ++++++++++
 extensions/source/plugin/base/makefile.mk                |   65 
 extensions/source/plugin/pl.component                    |   37 
 extensions/source/plugin/unx/makefile.mk                 |  104 -
 extensions/source/plugin/util/makefile.mk                |  109 -
 extensions/source/plugin/util/makefile.pmk               |   48 
 extensions/source/plugin/util/pl.component               |   37 
 extensions/source/plugin/win/makefile.mk                 |   58 
 extensions/source/resource/exports.dxp                   |    1 
 extensions/source/resource/makefile.mk                   |   86 -
 extensions/source/update/check/transform.pl              |   61 
 extensions/source/update/check/updatecheck.hxx           |   36 
 extensions/source/update/check/updateprotocol.hxx        |    2 
 extensions/source/xmlextract/makefile.mk                 |   73 
 extensions/util/makefile.mk                              |   39 
 extensions/util/makefile.pmk                             |   29 
 extensions/util/target.pmk                               |   35 
 postprocess/packcomponents/makefile.mk                   |   17 
 postprocess/prj/build.lst                                |    2 
 scp2/source/onlineupdate/file_onlineupdate.scp           |    2 
 solenv/gbuild/Library.mk                                 |    2 
 solenv/gbuild/LinkTarget.mk                              |   14 
 solenv/gbuild/platform/WNT_INTEL_GCC.mk                  |    2 
 solenv/gbuild/platform/WNT_INTEL_MSC.mk                  |   14 
 tail_build/prj/build.lst                                 |    2 
 123 files changed, 5976 insertions(+), 6223 deletions(-)

New commits:
commit f55b5ef370f6e477e2540636aa3b24f9b8de5a09
Author: Peter Foley <pefoley2 at verizon.net>
Date:   Sun Dec 18 02:10:12 2011 +0100

    extensions: add to tail_build

diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index 9b0dc4c..30c9e03 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
     dbaccess \
     desktop \
     eventattacher \
+    extensions \
     fileaccess \
     filter \
     forms \
diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst
index 50f4f60..af13689 100644
--- a/postprocess/prj/build.lst
+++ b/postprocess/prj/build.lst
@@ -1,4 +1,4 @@
-po      postprocess     ::      accessibility BINFILTER:binfilter configmgr CRASHREP:crashrep CT2N:ct2n dtrans embeddedobj embedserv EPM:epm DESKTOP:extensions extras DESKTOP:fpicker HELP:helpcontent2 io LIBRSVG:librsvg ODK:odk officecfg psprint_config remotebridges scaddins scp2 DESKTOP:setup_native sysui testtools ucb UnoControls ure wizards MORE_FONTS:more_fonts DICTIONARIES:dictionaries PYUNO:pyuno readlicense_oo DESKTOP:unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder LANGUAGETOOL:languagetool SDEXT:sdext MYSQLC:mysqlc NLPSOLVER:nlpsolver STLPORT:stlport LIBXSLT:libxslt smoketest tail_build NULL
+po      postprocess     ::      accessibility BINFILTER:binfilter configmgr CRASHREP:crashrep CT2N:ct2n dtrans embeddedobj embedserv EPM:epm extras DESKTOP:fpicker HELP:helpcontent2 io LIBRSVG:librsvg ODK:odk officecfg psprint_config remotebridges scaddins scp2 DESKTOP:setup_native sysui testtools ucb UnoControls ure wizards MORE_FONTS:more_fonts DICTIONARIES:dictionaries PYUNO:pyuno readlicense_oo DESKTOP:unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder LANGUAGETOOL:languagetool SDEXT:sdext MYSQLC:mysqlc NLPSOLVER:nlpsolver STLPORT:stlport LIBXSLT:libxslt smoketest tail_build NULL
 po	postprocess			    	usr1	-	all	po_mkout NULL
 po	postprocess\checkxml		nmake	-	all	po_checkxml NULL
 po	postprocess\packconfig		nmake	-	all	po_packconfig po_checkxml NULL
diff --git a/tail_build/prj/build.lst b/tail_build/prj/build.lst
index 19d0cc5..c32aef2 100644
--- a/tail_build/prj/build.lst
+++ b/tail_build/prj/build.lst
@@ -1,2 +1,2 @@
-tb      tail_build : APACHE_COMMONS:apache-commons BSH:beanshell BERKELEYDB:berkeleydb BOOST:boost HUNSPELL:hunspell HYPHEN:hyphen ICU:icu DESKTOP:l10ntools LIBCDR:libcdr LIBEXTTEXTCAT:libexttextcat LIBXML2:libxml2 LIBXMLSEC:libxmlsec LIBXSLT:libxslt LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd LIBVISIO:libvisio LPSOLVE:lpsolve MDDS:mdds MYTHES:mythes NEON:neon NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland SAXON:saxon TRANSLATIONS:translations XPDF:xpdf avmedia basegfx basic bridges canvas comphelper configmgr connectivity cppcanvas cppu cppuhelper DESKTOP:fpicker javaunohelper jurt jvmaccess offapi officecfg oovbaapi qadevOOo DESKTOP:rdbmaker readlicense_oo rhino ridljar sal sax sfx2 solenv soltools sot stoc svl svtools svx sysui test toolkit tools ucbhelper udkapi unoil unotools ure vcl xmlhelp xmloff xmlscript xsltml NULL
+tb      tail_build : APACHE_COMMONS:apache-commons BSH:beanshell BERKELEYDB:berkeleydb BOOST:boost CURL:curl HUNSPELL:hunspell HYPHEN:hyphen ICU:icu DESKTOP:l10ntools LIBCDR:libcdr LIBEXTTEXTCAT:libexttextcat LIBXML2:libxml2 LIBXMLSEC:libxmlsec LIBXSLT:libxslt LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd LIBVISIO:libvisio LPSOLVE:lpsolve MDDS:mdds MYTHES:mythes NEON:neon NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland SANE:sane SAXON:saxon TRANSLATIONS:translations TWAIN:twain XPDF:xpdf ZLIB:zlib avmedia basegfx basic bridges canvas comphelper connectivity cppcanvas cppu cppuhelper DESKTOP:fpicker javaunohelper jurt jvmaccess np_sdk offapi officecfg oovbaapi qadevOOo DESKTOP:rdbmaker readlicense_oo rhino ridljar sal sax sfx2 solenv soltools sot stoc svl svtools svx sysui test toolkit tools ucbhelper udkapi unoil unotools ure vcl xmlhelp xmloff xmlscript xsltml NULL
 tb tail_build\prj nmake - all tb_prj   NULL
commit c7210a27424f5f82e1c90b94c711fb9170ccffb3
Author: Peter Foley <pefoley2 at verizon.net>
Date:   Sun Dec 18 02:04:02 2011 +0100

    extensions: remove obsolete dmake stuff

diff --git a/RepositoryModule_ooo.mk b/RepositoryModule_ooo.mk
index 7a2d68d..6389d15 100644
--- a/RepositoryModule_ooo.mk
+++ b/RepositoryModule_ooo.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
     dtrans \
     editeng \
     eventattacher \
+	extensions \
     fileaccess \
     filter \
     forms \
diff --git a/extensions/inc/makefile.mk b/extensions/inc/makefile.mk
deleted file mode 100644
index 82d75be..0000000
--- a/extensions/inc/makefile.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=extensions
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE :  target.mk
diff --git a/extensions/prj/build.lst b/extensions/prj/build.lst
index df4ba36..06f2e2d 100644
--- a/extensions/prj/build.lst
+++ b/extensions/prj/build.lst
@@ -1,9 +1,4 @@
 ex  extensions :  officecfg  TRANSLATIONS:translations DESKTOP:rdbmaker svx SANE:sane TWAIN:twain np_sdk offapi stoc ZLIB:zlib CURL:curl LIBXSLT:libxslt CPPUNIT:cppunit NULL
-
-ex  extensions                                  usr1    -   all ex_mkout NULL
-ex  extensions\inc                              nmake   -   all ex_inc NULL
-ex  extensions\inc\ucbhelper                    get     -   all ex_incucbh ex_inc NULL
-ex  extensions\util                             nmake   -   all ex_util NULL
 ex  extensions\prj                              nmake   -   all ex_prj NULL
 
 # Fails at the moment
diff --git a/extensions/prj/d.lst b/extensions/prj/d.lst
index 01025ae..e69de29 100644
--- a/extensions/prj/d.lst
+++ b/extensions/prj/d.lst
@@ -1,55 +0,0 @@
-mkdir: %COMMON_DEST%\bin\hid
-mkdir: %_DEST%\xml\uiconfig
-mkdir: %_DEST%\xml\uiconfig\modules
-mkdir: %_DEST%\xml\uiconfig\modules\sbibliography
-mkdir: %_DEST%\xml\uiconfig\modules\sbibliography\menubar
-mkdir: %_DEST%\bin\odf4ms
-mkdir: %_DEST%\bin\so
-
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin\hid\*.hid
-..\%__SRC%\bin\*.dll %_DEST%\bin\*.dll
-..\%__SRC%\lib\lib*.so %_DEST%\lib
-..\%__SRC%\lib\ldapbe2.uno.so %_DEST%\lib\ldapbe2.uno.so
-..\%__SRC%\lib\updchk.uno.so %_DEST%\lib\updchk.uno.so
-..\%__SRC%\lib\updatefeed.uno.so %_DEST%\lib\updatefeed.uno.so
-..\%__SRC%\bin\oleautobridge2.uno.dll %_DEST%\bin\odf4ms\oleautobridge.uno.dll
-..\%__SRC%\lib\*.dylib %_DEST%\lib\*.dylib
-..\%__SRC%\bin\pluginapp.bin %_DEST%\bin\pluginapp.bin
-..\%__SRC%\bin\*.res %_DEST%\bin\*.res
-..\%__SRC%\bin\nsplugin.exe %_DEST%\bin\nsplugin.exe
-..\%__SRC%\bin\nsplugin %_DEST%\bin\nsplugin
-..\%__SRC%\bin\npsoplugin.dll %_DEST%\bin\npsoplugin.dll
-..\%__SRC%\bin\npsoplugin_so.dll %_DEST%\bin\so\npsoplugin.dll
-..\%__SRC%\bin\x64\so_activex.dll %_DEST%\bin\so_activex_x64.dll
-..\%__SRC%\bin\mdibundle.zip %_DEST%\bin\mdibundle.zip
-..\%__SRC%\misc\oleautobridge.component %_DEST%\xml\oleautobridge.component
-
-..\source\bibliography\uiconfig\sbibliography\menubar\*.xml %_DEST%\xml\uiconfig\modules\sbibliography\menubar\*.xml
-
-..\source\propctrlr\pcr.xml %_DEST%\xml\pcr.xml
-
-mkdir: %_DEST%\xml\registry\spool
-mkdir: %_DEST%\xml\registry\spool\org
-mkdir: %_DEST%\xml\registry\spool\org\openoffice
-mkdir: %_DEST%\xml\registry\spool\org\openoffice\Office\Addons
-mkdir: %_DEST%\xml\registry\spool\org\openoffice\Office\Jobs
-mkdir: %_DEST%\xml\registry\spool\org\openoffice\Office\Logging
-
-..\%__SRC%\misc\registry\spool\org\openoffice\Office\Addons\*.xcu %_DEST%\xml\registry\spool\org\openoffice\Office\Addons
-..\%__SRC%\misc\registry\spool\org\openoffice\Office\Jobs\*.xcu %_DEST%\xml\registry\spool\org\openoffice\Office\Jobs
-..\%__SRC%\misc\registry\spool\org\openoffice\Office\Logging\*.xcu %_DEST%\xml\registry\spool\org\openoffice\Office\Logging
-
-..\%__SRC%\bin\*.oxt %_DEST%\pck\*
-..\%__SRC%\misc\abp.component %_DEST%\xml\abp.component
-..\%__SRC%\misc\bib.component %_DEST%\xml\bib.component
-..\%__SRC%\misc\dbp.component %_DEST%\xml\dbp.component
-..\%__SRC%\misc\ldapbe2.component %_DEST%\xml\ldapbe2.component
-..\%__SRC%\misc\log.component %_DEST%\xml\log.component
-..\%__SRC%\misc\pcr.component %_DEST%\xml\pcr.component
-..\%__SRC%\misc\pl.component %_DEST%\xml\pl.component
-..\%__SRC%\misc\res.component %_DEST%\xml\res.component
-..\%__SRC%\misc\scn.component %_DEST%\xml\scn.component
-..\%__SRC%\misc\updatefeed.component %_DEST%\xml\updatefeed.component
-..\%__SRC%\misc\updchk.component %_DEST%\xml\updchk.component
-..\%__SRC%\misc\updchk.uno.component %_DEST%\xml\updchk.uno.component
-..\%__SRC%\misc\xmx.component %_DEST%\xml\xmx.component
diff --git a/extensions/util/makefile.mk b/extensions/util/makefile.mk
deleted file mode 100644
index af6b1ec..0000000
--- a/extensions/util/makefile.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-PRJNAME=extensions
-TARGET=ext
-GEN_HID=TRUE
-GEN_HID_OTHER=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE :	settings.mk
-
-.INCLUDE : target.mk
-
diff --git a/extensions/util/makefile.pmk b/extensions/util/makefile.pmk
deleted file mode 100644
index b80a9c7..0000000
--- a/extensions/util/makefile.pmk
+++ /dev/null
@@ -1,29 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-.INCLUDE :  settings.mk
-
diff --git a/extensions/util/target.pmk b/extensions/util/target.pmk
deleted file mode 100644
index c7c1de9..0000000
--- a/extensions/util/target.pmk
+++ /dev/null
@@ -1,35 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-ALLSLO: $(SLOFILES)
-
-SOSHL: $(SHL1TARGETN)
-
-WHOLEPRJ:
-    cd $(PRJ)$/prj
-    make debug linkinc prjpch compinc
-    @echo "READY"
-
commit eb2939e19075f9c4cd79cf468b1c4b6200623db9
Author: Peter Foley <pefoley2 at verizon.net>
Date:   Sun Dec 18 01:46:03 2011 +0100

    gbuild: MSVC: add support for building x64 libraries
    
    The committer wants to state that he has no opinion on the content of
    this commit due to total ignorance of the problem area.

diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 82daae1..0de2876 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -120,6 +120,7 @@ $(eval $(foreach method,\
 	add_asmobject \
 	add_asmobjects \
 	add_exception_objects \
+	add_x64_generated_exception_objects \
 	add_noexception_objects \
 	add_generated_cobjects \
 	add_generated_cxxobjects \
@@ -139,6 +140,7 @@ $(eval $(foreach method,\
 	set_include \
 	add_ldflags \
 	set_ldflags \
+	set_x64 \
 	add_libs \
 	set_library_path_flags \
 	add_api \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index c094bb4..94fcca6 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -416,6 +416,7 @@ $(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_h
 #   on clean.
 # - TARGETTYPE is the type of linktarget as some platforms need very different
 #   command to link different targettypes.
+# - LIBRARY_X64 is only relevent for building a x64 library on windows.
 #
 # Since most variables are set on the linktarget and not on the object, the
 # object learns about these setting via GNU makes scoping of target variables.
@@ -465,6 +466,7 @@ $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS :=
 $(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
 $(call gb_LinkTarget_get_target,$(1)) : LIBS :=
 $(call gb_LinkTarget_get_target,$(1)) : TARGETTYPE :=
+$(call gb_LinkTarget_get_target,$(1)) : LIBRARY_X64 :=
 $(call gb_LinkTarget_get_headers_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : PDBFILE :=
 $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
@@ -489,6 +491,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS
 $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
 $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
 $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 :=
 $(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS :=
 endif
 
@@ -869,6 +872,12 @@ define gb_LinkTarget_add_exception_objects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_exception_object,$(1),$(obj)))
 endef
 
+#only useful for building x64 libraries on windows
+define gb_LinkTarget_add_x64_generated_exception_objects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_generated_exception_object,$(1),$(obj)))
+$(foreach obj,$(2),$(eval $(call gb_GenCxxObject_get_target,$(obj)) : CXXOBJECT_X64 := YES))
+endef
+
 define gb_LinkTarget_add_generated_cobjects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3)))
 endef
@@ -890,6 +899,11 @@ $(call gb_LinkTarget_get_target,$(1)) \
 $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(2)
 endef
 
+define gb_LinkTarget_set_x64
+$(call gb_LinkTarget_get_target,$(1)) \
+$(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(2)
+endef
+
 define gb_LinkTarget_set_dlltarget
 $(call gb_LinkTarget_get_clean_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2)
diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
index 45c9609..1e068ff 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -75,9 +75,7 @@ gb_RCDEFS := \
 gb_RCFLAGS := \
 	 -V
 
-# FIXME: When porting to Windows64, we should use only:
-# /c /Cp
-gb_AFLAGS := /c /Cp /coff /safeseh
+gb_AFLAGS := /c /Cp
 
 gb_CFLAGS := \
 	-Gd \
@@ -207,7 +205,6 @@ gb_LinkTarget_NOEXCEPTIONFLAGS := \
 	-DEXCEPTIONS_OFF \
 
 gb_LinkTarget_LDFLAGS := \
-	-MACHINE:IX86 \
 	-MANIFEST \
 	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
 
@@ -302,13 +299,14 @@ define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs_native,\
 	mkdir -p $(dir $(1)) $(dir $(4)) && \
-	$(gb_CXX) \
+	$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \
 		$(DEFS) \
 		$(T_CXXFLAGS) \
 		-Fd$(PDBFILE) \
 		$(gb_COMPILERDEPFLAGS) \
 		-I$(realpath $(dir $(3))) \
 		$(INCLUDE_STL) $(INCLUDE) \
+		$(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \
 		-c $(realpath $(3)) \
 		-Fo$(1)) $(call gb_create_deps,$(1),$(4),$(realpath $(3)))
 endef
@@ -353,11 +351,13 @@ $(call gb_Helper_abbreviate_dirs_native,\
 		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
 		$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \
 		$(NATIVERES))) && \
-	$(gb_LINK) \
+	$(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \
 		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
 		$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
 		$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
 		$(if $(filter YES,$(TARGETGUI)), -SUBSYSTEM:WINDOWS, -SUBSYSTEM:CONSOLE) \
+		$(if $(filter YES,$(LIBRARY_X64)), -MACHINE:X64, -MACHINE:IX86) \
+		$(if $(filter YES,$(LIBRARY_X64)), -LIBPATH:$(COMPATH)/lib/amd64 -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64,) \
 		$(T_LDFLAGS) \
 		$(if $(gb_PRODUCT),,-NODEFAULTLIB) \
 		@$${RESPONSEFILE} \
@@ -377,7 +377,6 @@ gb_Windows_PE_TARGETTYPEFLAGS := \
     -opt:noref \
     -incremental:no \
     -debug \
-    -safeseh \
 	-nxcompat \
 	-dynamicbase \
 
commit c439bc7a4aa0a4e01e0d01e09c5869619240c040
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Dec 18 01:42:41 2011 +0100

    extensions: tweak activex makefiles

diff --git a/extensions/Library_so_activex.mk b/extensions/Library_so_activex.mk
index 732b271..f4d0d2f 100644
--- a/extensions/Library_so_activex.mk
+++ b/extensions/Library_so_activex.mk
@@ -37,6 +37,12 @@ $(WORKDIR)/CustomTarget/so_activex/so_activex.tlb: $(SRCDIR)/extensions/source/a
 	midl.exe -out $(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/so_activex) -Oicf $(call gb_Helper_convert_native,$<) \
 	$(foreach i,$(SOLARINC_FOR_BUILD), $(patsubst -I,/I,$(i)))
 
+$(call gb_Library_get_clean_target,so_activex) : extensions_activex_idlclean
+
+.PHONY: extensions_activex_idlclean
+extensions_activex_idlclean:
+	rm -rf $(WORKDIR)/CustomTarget/so_activex
+
 $(eval $(call gb_Library_set_include,so_activex,\
 	$$(INCLUDE) \
 	-I$(WORKDIR)/CustomTarget/so_activex \
@@ -83,9 +89,4 @@ $(eval $(call gb_Library_add_libs,so_activex,\
 ))
 endif
 
-$(call gb_Library_get_clean_target,so_activex): idlclean
-
-idlclean:
-	rm -rf $(WORKDIR)/CustomTarget/so_activex
-
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/extensions/Library_so_activex_x64.mk b/extensions/Library_so_activex_x64.mk
index eab054d..f7cfa0b 100644
--- a/extensions/Library_so_activex_x64.mk
+++ b/extensions/Library_so_activex_x64.mk
@@ -48,17 +48,18 @@ $(eval $(call gb_Library_add_api,so_activex_x64,\
 
 $(eval $(call gb_Library_add_nativeres,so_activex_x64,activex_res))
 
-$(WORKDIR)/extensions/source/activex/%.cxx: $(SRCDIR)/extensions/source/activex/%.cxx
+$(WORKDIR)/CustomTarget/extensions/source/activex/%.cxx : \
+		$(SRCDIR)/extensions/source/activex/%.cxx
 	mkdir -p $(dir $@)
 	cp $< $@
 
 $(eval $(call gb_Library_add_x64_generated_exception_objects,so_activex_x64,\
-	extensions/source/activex/so_activex \
-	extensions/source/activex/SOActiveX \
-	extensions/source/activex/SOComWindowPeer \
-	extensions/source/activex/SODispatchInterceptor \
-	extensions/source/activex/SOActionsApproval \
-	extensions/source/activex/StdAfx2 \
+	CustomTarget/extensions/source/activex/so_activex \
+	CustomTarget/extensions/source/activex/SOActiveX \
+	CustomTarget/extensions/source/activex/SOComWindowPeer \
+	CustomTarget/extensions/source/activex/SODispatchInterceptor \
+	CustomTarget/extensions/source/activex/SOActionsApproval \
+	CustomTarget/extensions/source/activex/StdAfx2 \
 ))
 
 $(eval $(call gb_Library_add_ldflags,so_activex_x64,\
@@ -85,6 +86,4 @@ $(eval $(call gb_Library_add_libs,so_activex_x64,\
 ))
 endif
 
-$(call gb_Library_get_clean_target,so_activex_x64): idlclean
-
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
commit 1841baf54f053c54969d0164185e2366f9efb3fd
Author: Peter Foley <pefoley2 at verizon.net>
Date:   Sun Dec 18 01:28:13 2011 +0100

    extensions: convert activex to gbuild

diff --git a/Repository.mk b/Repository.mk
index e7169f9..4f2e8e6 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -328,6 +328,8 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
 	dnd \
 	dtrans \
 	ftransl \
+	so_activex \
+	so_activex_x64 \
 	sysdtrans \
 ))
 endif
diff --git a/extensions/Library_so_activex.mk b/extensions/Library_so_activex.mk
new file mode 100644
index 0000000..732b271
--- /dev/null
+++ b/extensions/Library_so_activex.mk
@@ -0,0 +1,91 @@
+# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# 	Peter Foley <pefoley2 at verizon.net>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+
+$(eval $(call gb_Library_Library,so_activex))
+
+$(SRCDIR)/extensions/source/activex/so_activex.cxx: $(WORKDIR)/CustomTarget/so_activex/so_activex.tlb
+
+$(WORKDIR)/CustomTarget/so_activex/so_activex.tlb: $(SRCDIR)/extensions/source/activex/so_activex.idl
+	mkdir -p $(WORKDIR)/CustomTarget/so_activex
+	midl.exe -out $(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/so_activex) -Oicf $(call gb_Helper_convert_native,$<) \
+	$(foreach i,$(SOLARINC_FOR_BUILD), $(patsubst -I,/I,$(i)))
+
+$(eval $(call gb_Library_set_include,so_activex,\
+	$$(INCLUDE) \
+	-I$(WORKDIR)/CustomTarget/so_activex \
+	$(foreach i,$(ATL_INCLUDE), -I$(i)) \
+))
+
+$(eval $(call gb_Library_add_api,so_activex,\
+	offapi \
+	udkapi \
+))
+
+$(eval $(call gb_Library_add_nativeres,so_activex,activex_res))
+
+$(eval $(call gb_Library_add_exception_objects,so_activex,\
+	extensions/source/activex/so_activex \
+	extensions/source/activex/SOActiveX \
+	extensions/source/activex/SOComWindowPeer \
+	extensions/source/activex/SODispatchInterceptor \
+	extensions/source/activex/SOActionsApproval \
+	extensions/source/activex/StdAfx2 \
+))
+
+$(eval $(call gb_Library_add_ldflags,so_activex,\
+	/DEF:$(call gb_Helper_convert_native,$(SRCDIR)/extensions/source/activex/so_activex.def) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,so_activex,\
+	uuid \
+	advapi32 \
+	ole32 \
+	oleaut32 \
+	gdi32 \
+	urlmon \
+	shlwapi \
+))
+
+ifneq ($(USE_DEBUG_RUNTIME),)
+$(eval $(call gb_Library_add_libs,so_activex,\
+	$(ATL_LIB)/atlsd.lib \
+))
+else
+$(eval $(call gb_Library_add_libs,so_activex,\
+	$(ATL_LIB)/atls.lib \
+))
+endif
+
+$(call gb_Library_get_clean_target,so_activex): idlclean
+
+idlclean:
+	rm -rf $(WORKDIR)/CustomTarget/so_activex
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/extensions/Library_so_activex_x64.mk b/extensions/Library_so_activex_x64.mk
new file mode 100644
index 0000000..eab054d
--- /dev/null
+++ b/extensions/Library_so_activex_x64.mk
@@ -0,0 +1,90 @@
+# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# 	Peter Foley <pefoley2 at verizon.net>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+
+$(eval $(call gb_Library_Library,so_activex_x64))
+
+$(eval $(call gb_Library_set_x64,so_activex_x64,YES))
+
+$(SRCDIR)/extensions/source/activex/so_activex.cxx: $(WORKDIR)/CustomTarget/so_activex/so_activex.tlb
+
+$(eval $(call gb_Library_set_include,so_activex_x64,\
+	$$(INCLUDE) \
+	-I$(realpath $(SRCDIR)/extensions/source/activex) \
+	-I$(WORKDIR)/CustomTarget/so_activex \
+	$(foreach i,$(ATL_INCLUDE), -I$(i)) \
+))
+
+$(eval $(call gb_Library_add_api,so_activex_x64,\
+	offapi \
+	udkapi \
+))
+
+$(eval $(call gb_Library_add_nativeres,so_activex_x64,activex_res))
+
+$(WORKDIR)/extensions/source/activex/%.cxx: $(SRCDIR)/extensions/source/activex/%.cxx
+	mkdir -p $(dir $@)
+	cp $< $@
+
+$(eval $(call gb_Library_add_x64_generated_exception_objects,so_activex_x64,\
+	extensions/source/activex/so_activex \
+	extensions/source/activex/SOActiveX \
+	extensions/source/activex/SOComWindowPeer \
+	extensions/source/activex/SODispatchInterceptor \
+	extensions/source/activex/SOActionsApproval \
+	extensions/source/activex/StdAfx2 \
+))
+
+$(eval $(call gb_Library_add_ldflags,so_activex_x64,\
+	/DEF:$(call gb_Helper_convert_native,$(SRCDIR)/extensions/source/activex/so_activex.def) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,so_activex_x64,\
+	uuid \
+	advapi32 \
+	ole32 \
+	oleaut32 \
+	gdi32 \
+	urlmon \
+	shlwapi \
+))
+
+ifneq ($(USE_DEBUG_RUNTIME),)
+$(eval $(call gb_Library_add_libs,so_activex_x64,\
+	$(ATL_LIB)/amd64/atlsd.lib \
+))
+else
+$(eval $(call gb_Library_add_libs,so_activex_x64,\
+	$(ATL_LIB)/amd64/atls.lib \
+))
+endif
+
+$(call gb_Library_get_clean_target,so_activex_x64): idlclean
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk
index 6865f53..348b95e 100644
--- a/extensions/Module_extensions.mk
+++ b/extensions/Module_extensions.mk
@@ -13,6 +13,7 @@
 #
 # Major Contributor(s):
 # Copyright (C) 2011 Jan Holesovsky <kendy at suse.cz> (initial developer)
+# Copyright (C) 2011 Peter Foley <pefoley2 at verizon.net>
 #
 # All Rights Reserved.
 #
@@ -51,13 +52,30 @@ $(eval $(call gb_Module_add_targets,extensions,\
 ))
 
 ifeq ($(OS),WNT)
+
+ifeq ($(COM),MSC)
+ifneq ($(DISABLE_ACTIVEX),TRUE)
+$(eval $(call gb_Module_add_targets,extensions,\
+	WinResTarget_activex \
+	Library_so_activex \
+))
+
+ifeq ($(BUILD_X64),TRUE)
+$(eval $(call gb_Module_add_targets,extensions,\
+	Library_so_activex_x64 \
+))
+endif # BUILD_X64
+endif # DISABLE_ACTIVEX
+endif # COM=MSC
+
 ifeq ($(DISABLE_ATL),)
 $(eval $(call gb_Module_add_targets,extensions,\
 	Library_oleautobridge \
 	Library_oleautobridge2 \
 ))
-endif
-endif
+endif # DISABLE_ATL
+
+endif # WNT
 
 ifneq ($(WITH_MOZILLA),NO)
 
diff --git a/extensions/WinResTarget_activex.mk b/extensions/WinResTarget_activex.mk
new file mode 100644
index 0000000..0487bc2
--- /dev/null
+++ b/extensions/WinResTarget_activex.mk
@@ -0,0 +1,46 @@
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# 	Peter Foley <pefoley2 at verizon.net>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+
+$(eval $(call gb_WinResTarget_WinResTarget,activex_res))
+
+ifneq ($(PRODUCT),)
+$(eval $(call gb_WinResTarget_set_defs,activex_res,\
+	$$(DEFS) \
+	-DPRODUCT \
+))
+endif
+
+$(eval $(call gb_WinResTarget_add_file,activex_res,extensions/source/activex/so_activex))
+
+$(SRCDIR)/extensions/source/activex/so_activex.rc: $(WORKDIR)/CustomTarget/so_activex/so_activex.tlb
+
+$(eval $(call gb_WinResTarget_set_defs,activex_res,\
+	$$(DEFS) \
+	-DMISC=$(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/so_activex) \
+))
diff --git a/extensions/prj/build.lst b/extensions/prj/build.lst
index 0e7e855..df4ba36 100644
--- a/extensions/prj/build.lst
+++ b/extensions/prj/build.lst
@@ -3,8 +3,6 @@ ex  extensions :  officecfg  TRANSLATIONS:translations DESKTOP:rdbmaker svx SANE
 ex  extensions                                  usr1    -   all ex_mkout NULL
 ex  extensions\inc                              nmake   -   all ex_inc NULL
 ex  extensions\inc\ucbhelper                    get     -   all ex_incucbh ex_inc NULL
-ex  extensions\source\activex\msidl             nmake   -   w   ex_axmsidl ex_inc NULL
-ex  extensions\source\activex\main              nmake   -   w   ex_axmain ex_axmsidl.w ex_inc NULL
 ex  extensions\util                             nmake   -   all ex_util NULL
 ex  extensions\prj                              nmake   -   all ex_prj NULL
 
diff --git a/extensions/source/activex/README.txt b/extensions/source/activex/README.txt
new file mode 100644
index 0000000..9d64798
--- /dev/null
+++ b/extensions/source/activex/README.txt
@@ -0,0 +1,33 @@
+						Description.
+
+The StarOffice ActiveX control shows an example of access to UNO through COM technology.
+It requires a properly installed StarOffice version 6.0/6.1 or OpenOffice 1.0.
+This is a Lite ActiveX control so it can be used only in containers that
+allows to use such controls. 
+
+Pressing to any link to staroffice document should activate the control.
+So the document will be opened in ReadOnly mode.
+
+Also it can be activated with an <OBJECT> tag from a html-page. 
+Without any parameters for an object tag a new writer document will be
+opened for editing. Possible parameters are
+    src      - full URL to the file that should be edited/viewed;
+               it can contain "private:factory/..." URLs to open new documents
+			   for edit, for example "private:factory/swriter"
+    readonly - the default value is "true", in case it is set to any other
+               value the document is opened for editing
+              
+As any ActiveX control this one should be registered.
+To let MSIE register it itself the "CODEBASE" parameter
+for the "OBJECT" tag should be specified 
+with an URL to the library "so_activex.dll".
+The example of registration with "OBJECT" tag is in example.html.
+
+Also it can be done using regsvr32 application.
+To do it please write
+<Path to Windows installation>\System32\regsvr32 so_activex.dll
+
+To unregister the control please use /u option:
+<Path to Windows installation>\system32\regsvr32 so_activex.dll /u
+
+
diff --git a/extensions/source/activex/SOActionsApproval.cxx b/extensions/source/activex/SOActionsApproval.cxx
new file mode 100644
index 0000000..e0ce5c5
--- /dev/null
+++ b/extensions/source/activex/SOActionsApproval.cxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOActionsApproval.cpp : Implementation of CHelpApp and DLL registration.
+
+#include "stdafx2.h"
+
+#include "so_activex.h"
+#include "SOActionsApproval.h"
+#include <sal/macros.h>
+
+/////////////////////////////////////////////////////////////////////////////
+//
+
+STDMETHODIMP SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
+{
+    static const IID* arr[] =
+    {
+        &IID_ISOActionsApproval,
+    };
+
+    for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
+    {
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+        if (InlineIsEqualGUID(*arr[i],riid))
+#else
+        if (::ATL::InlineIsEqualGUID(*arr[i],riid))
+#endif
+            return S_OK;
+    }
+    return S_FALSE;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOActionsApproval.h b/extensions/source/activex/SOActionsApproval.h
new file mode 100644
index 0000000..a557031
--- /dev/null
+++ b/extensions/source/activex/SOActionsApproval.h
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOActionsApproval.h: Definition of the SOActionsApproval class
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined __SODOCUMENTEVENTLISTENER_H_
+#define __SODOCUMENTEVENTLISTENER_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h"       // main symbols
+#include <ExDispID.h>
+#include <ExDisp.h>
+#include <shlguid.h>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#undef _DEBUG
+#endif
+
+#include <atlctl.h>
+
+#include "so_activex.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// SOActionsApproval
+
+class SOActionsApproval :
+    public IDispatchImpl<ISOActionsApproval, &IID_ISOActionsApproval, &LIBID_SO_ACTIVEXLib>,
+    public ISupportErrorInfo,
+    public CComObjectRoot,
+    public CComCoClass<SOActionsApproval,&CLSID_SOActionsApproval>
+{
+public:
+    SOActionsApproval() {}
+    virtual ~SOActionsApproval() {}
+
+BEGIN_COM_MAP(SOActionsApproval)
+    COM_INTERFACE_ENTRY(IDispatch)
+    COM_INTERFACE_ENTRY(ISOActionsApproval)
+    COM_INTERFACE_ENTRY(ISupportErrorInfo)
+END_COM_MAP()
+DECLARE_NOT_AGGREGATABLE(SOActionsApproval)
+// Remove the comment from the line above if you don't want your object to
+// support aggregation.
+
+DECLARE_REGISTRY_RESOURCEID(IDR_SODOCUMENTEVENTLISTENER)
+
+// ISupportsErrorInfo
+    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
+
+// ISOActionsApproval
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE approveAction(
+            /* [in] */ long nActionID,
+            /* [retval][out] */ boolean *pbApproval)
+        {
+            // only PreventClose is approved
+            USES_CONVERSION;
+            *pbApproval = ( nActionID == 1 );
+
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
+            /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
+        {
+            *pVal = SafeArrayCreateVector( VT_BSTR, 0, 1 );
+
+            if( !*pVal )
+                return E_FAIL;
+
+            long ix = 0;
+            CComBSTR aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
+            SafeArrayPutElement( *pVal, &ix, aInterface );
+
+            return S_OK;
+        }
+};
+
+#endif // __SODOCUMENTEVENTLISTENER_H_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOActionsApproval.rgs b/extensions/source/activex/SOActionsApproval.rgs
new file mode 100644
index 0000000..5433208
--- /dev/null
+++ b/extensions/source/activex/SOActionsApproval.rgs
@@ -0,0 +1,24 @@
+HKCR
+{
+9F3697AC-7A18-4335-AF0A-65FAC2C35CC1
+	so_activex.SOActionsApproval.1 = s 'SOActionsApproval Class'
+	{
+		CLSID = s '{9F3697AC-7A18-4335-AF0A-65FAC2C35CC1}'
+	}
+	so_activex.SOActionsApproval = s 'SOActionsApproval Class'
+	{
+		CLSID = s '{9F3697AC-7A18-4335-AF0A-65FAC2C35CC1}'
+	}
+	NoRemove CLSID
+	{
+		ForceRemove {9F3697AC-7A18-4335-AF0A-65FAC2C35CC1} = s 'SOActionsApproval Class'
+		{
+			ProgID = s 'so_activex.SOActionsApproval.1'
+			VersionIndependentProgID = s 'so_activex.SOActionsApproval'
+			InprocServer32 = s '%MODULE%'
+			{
+				val ThreadingModel = s 'both'
+			}
+		}
+	}
+}
diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx
new file mode 100644
index 0000000..f95e427
--- /dev/null
+++ b/extensions/source/activex/SOActiveX.cxx
@@ -0,0 +1,1153 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOActiveX.cpp : Implementation of CSOActiveX
+
+#pragma warning (disable:4505)
+    // permanently suppress "unreferenced local function has been removed" warning
+
+#pragma warning (push,1)
+#pragma warning (disable:4265)
+
+#include "stdafx2.h"
+#include "so_activex.h"
+#include "SOActiveX.h"
+#include "SOComWindowPeer.h"
+#include "SODispatchInterceptor.h"
+#include "SOActionsApproval.h"
+
+#pragma warning (pop)
+
+#define STAROFFICE_WINDOWCLASS "SOParentWindow"
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+void OutputError_Impl( HWND hw, HRESULT ErrorCode )
+{
+    void* sMessage;
+    FormatMessageA(
+        FORMAT_MESSAGE_ALLOCATE_BUFFER |
+        FORMAT_MESSAGE_FROM_SYSTEM,
+        NULL,
+        ErrorCode,
+        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+        (LPTSTR) &sMessage,
+        0,
+        NULL
+    );
+    ::MessageBoxA( hw, (LPCTSTR)sMessage, NULL, MB_OK | MB_ICONINFORMATION );
+    LocalFree( sMessage );
+}
+
+HRESULT ExecuteFunc( IDispatch* idispUnoObject,
+                     OLECHAR* sFuncName,
+                     CComVariant* params,
+                     unsigned int count,
+                     CComVariant* pResult )
+{
+    if( !idispUnoObject )
+        return E_FAIL;
+
+    DISPID id;
+    HRESULT hr = idispUnoObject->GetIDsOfNames( IID_NULL, &sFuncName, 1, LOCALE_USER_DEFAULT, &id);
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    DISPPARAMS dispparams= { params, 0, count, 0};
+
+    // DEBUG
+    EXCEPINFO myInfo;
+    hr = idispUnoObject->Invoke( id, IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_METHOD,
+                    &dispparams, pResult, &myInfo, 0);
+
+    // for debugging purposes
+    // USES_CONVERSION;
+    // if ( !SUCCEEDED( hr ) )
+    //  ::MessageBox( NULL, OLE2A( myInfo.bstrDescription ), OLE2A( myInfo.bstrSource ), MB_OK | MB_ICONINFORMATION );
+
+    return hr;
+}
+
+HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
+                          OLECHAR* sFuncName,
+                          CComVariant* params,
+                          unsigned int count,
+                          CComPtr<IDispatch>& pdispResult )
+{
+    if( !idispUnoObject )
+        return E_FAIL;
+
+    CComVariant result;
+    HRESULT hr = ExecuteFunc( idispUnoObject, sFuncName, params, count, &result );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    if( result.vt != VT_DISPATCH || result.pdispVal == NULL )
+        return E_FAIL;
+
+    pdispResult = CComPtr<IDispatch>( result.pdispVal );
+
+    return S_OK;
+}
+
+HRESULT PutPropertiesToIDisp( IDispatch* pdispObject,
+                              OLECHAR** sMemberNames,
+                              CComVariant* pVariant,
+                              unsigned int count )
+{
+    for( unsigned int ind = 0; ind < count; ind++ )
+    {
+        DISPID id;
+        HRESULT hr = pdispObject->GetIDsOfNames( IID_NULL, &sMemberNames[ind], 1, LOCALE_USER_DEFAULT, &id );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        hr = CComDispatchDriver::PutProperty( pdispObject, id, &pVariant[ind] );
+        if( !SUCCEEDED( hr ) ) return hr;
+    }
+
+    return S_OK;
+}
+
+HRESULT GetPropertiesFromIDisp( IDispatch* pdispObject,
+                                OLECHAR** sMemberNames,
+                                CComVariant* pVariant,
+                                unsigned int count )
+{
+    for( unsigned int ind = 0; ind < count; ind++ )
+    {
+        DISPID id;
+        HRESULT hr = pdispObject->GetIDsOfNames( IID_NULL, &sMemberNames[ind], 1, LOCALE_USER_DEFAULT, &id );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        hr = CComDispatchDriver::GetProperty( pdispObject, id, &pVariant[ind] );
+        if( !SUCCEEDED( hr ) ) return hr;
+    }
+
+    return S_OK;
+}
+/////////////////////////////////////////////////////////////////////////////
+// CSOActiveX
+
+CSOActiveX::CSOActiveX()
+: mCookie(0)
+, mCurFileUrl( L"private:factory/swriter" )
+, mbLoad( FALSE )
+, mParentWin( NULL )
+, mOffWin( NULL )
+, mbViewOnly( TRUE )
+, mpDispatchInterceptor( NULL )
+, mnVersion( SO_NOT_DETECTED )
+, mbReadyForActivation( FALSE )
+, mbDrawLocked( FALSE )
+{
+    CLSID clsFactory = {0x82154420,0x0FBF,0x11d4,{0x83, 0x13,0x00,0x50,0x04,0x52,0x6A,0xB4}};
+    HRESULT hr = CoCreateInstance( clsFactory, NULL, CLSCTX_ALL, __uuidof(IDispatch), (void**)&mpDispFactory);
+    if( !SUCCEEDED( hr ) )
+        OutputError_Impl( NULL, hr );
+
+    mPWinClass.style            = CS_HREDRAW|CS_VREDRAW;
+    mPWinClass.lpfnWndProc      = ::DefWindowProc;
+    mPWinClass.cbClsExtra       = 0;
+    mPWinClass.cbWndExtra       = 0;
+    mPWinClass.hInstance        = (HINSTANCE) GetModuleHandle(NULL); //myInstance;
+    mPWinClass.hIcon            = NULL;
+    mPWinClass.hCursor          = NULL;
+    mPWinClass.hbrBackground    = (HBRUSH) COLOR_BACKGROUND;
+    mPWinClass.lpszMenuName     = NULL;
+    mPWinClass.lpszClassName    = STAROFFICE_WINDOWCLASS;
+
+    RegisterClass(&mPWinClass);
+}
+
+CSOActiveX::~CSOActiveX()
+{
+    Cleanup();
+
+}
+
+HRESULT CSOActiveX::Cleanup()
+{
+    CComVariant dummyResult;
+
+    if( mpDispatchInterceptor )
+    {
+        if( mpDispFrame )
+        {
+            // remove dispatch interceptor
+            CComQIPtr< IDispatch, &IID_IDispatch > pIDispDispInter( mpDispatchInterceptor );
+                CComVariant aVariant( pIDispDispInter );
+            ExecuteFunc( mpDispFrame,
+                         L"releaseDispatchProviderInterceptor",
+                         &aVariant,
+                         1,
+                         &dummyResult );
+        }
+
+        mpDispatchInterceptor->ClearParent();
+        mpDispatchInterceptor->Release();
+        mpDispatchInterceptor = NULL;
+    }
+
+    mpDispTempFile = CComPtr< IDispatch >();
+    mbReadyForActivation = FALSE;
+
+    if( mpInstanceLocker )
+    {
+        ExecuteFunc( mpInstanceLocker, L"dispose", NULL, 0, &dummyResult );
+        mpInstanceLocker = CComPtr< IDispatch >();
+    }
+
+    if( mpDispFrame )
+    {
+        BOOL bCloserActivated = FALSE;
+
+        CComPtr<IDispatch> pDispDocumentCloser;
+        CComVariant aDocCloser( L"com.sun.star.embed.DocumentCloser" );
+        HRESULT hr = GetIDispByFunc( mpDispFactory,
+                                     L"createInstance",
+                                     &aDocCloser,
+                                     1,
+                                     pDispDocumentCloser );
+        if ( SUCCEEDED( hr ) && pDispDocumentCloser )
+        {
+            SAFEARRAY FAR* pInitFrame = SafeArrayCreateVector( VT_VARIANT, 0, 1 );
+            long nInitInd = 0;
+            CComVariant pFrameVariant( mpDispFrame );
+            SafeArrayPutElement( pInitFrame, &nInitInd, &pFrameVariant );
+            CComVariant aVarInitFrame;
+            aVarInitFrame.vt = VT_ARRAY | VT_VARIANT; aVarInitFrame.parray = pInitFrame;
+            hr = ExecuteFunc( pDispDocumentCloser, L"initialize", &aVarInitFrame, 1, &dummyResult );
+            if( SUCCEEDED( hr ) )
+            {
+                // the following call will let the closing happen
+                hr = ExecuteFunc( pDispDocumentCloser, L"dispose", NULL, 0, &dummyResult );
+                bCloserActivated = SUCCEEDED( hr );
+            }
+        }
+
+        if ( !bCloserActivated )
+        {
+            CComVariant aPropVar;
+            aPropVar.vt = VT_BOOL; aPropVar.boolVal = VARIANT_TRUE;
+            if ( !SUCCEEDED( ExecuteFunc( mpDispFrame, L"close", &aPropVar, 1, &dummyResult ) ) )
+                ExecuteFunc( mpDispFrame, L"dispose", NULL, 0, &dummyResult );
+        }
+
+        mpDispFrame = CComPtr< IDispatch >();
+    }
+
+    if( ::IsWindow( mOffWin ) )
+        ::DestroyWindow( mOffWin );
+
+    TerminateOffice();
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::TerminateOffice()
+{
+    // create desktop
+    CComPtr<IDispatch> pdispDesktop;
+    CComVariant aDesktopServiceName( L"com.sun.star.frame.Desktop" );
+
+    HRESULT hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aDesktopServiceName, 1, pdispDesktop );
+    if( !pdispDesktop || !SUCCEEDED( hr ) ) return hr;
+
+    // create tree of frames
+    CComPtr<IDispatch> pdispChildren;
+    hr = GetIDispByFunc( pdispDesktop, L"getFrames", NULL, 0, pdispChildren );
+    if( !pdispChildren || !SUCCEEDED( hr ) ) return hr;
+
+    CComVariant aFrames;
+    CComVariant nFlag( 4 );
+    hr = ExecuteFunc( pdispChildren, L"queryFrames", &nFlag, 1, &aFrames );
+    if ( SUCCEEDED( hr ) )
+    {
+        if ( ( aFrames.vt == ( VT_ARRAY | VT_DISPATCH ) || aFrames.vt == ( VT_ARRAY | VT_VARIANT ) )
+          && ( !aFrames.parray || aFrames.parray->cDims == 1 && aFrames.parray->rgsabound[0].cElements == 0 ) )
+        {
+            // there is no frames open
+            // TODO: check whether the frames are hidden if they are open?
+            CComVariant dummyResult;
+            hr = ExecuteFunc( pdispDesktop, L"terminate", NULL, 0, &dummyResult );
+        }
+    }
+
+    return hr;
+}
+
+STDMETHODIMP CSOActiveX::InitNew ()
+{
+    mnVersion = GetVersionConnected();
+    mbLoad = TRUE;
+    return S_OK;
+}
+
+STDMETHODIMP CSOActiveX::Load ( LPSTREAM /*pStm*/ )
+{
+    mnVersion = GetVersionConnected();
+    mbLoad = TRUE;
+
+    // may be later?
+    // for now just ignore
+
+    return S_OK;
+}
+
+STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPERRORLOG /*pErrorLog*/ )
+{
+    mnVersion = GetVersionConnected();
+
+    IPropertyBag2* pPropBag2;
+    HRESULT hr = pPropBag->QueryInterface( IID_IPropertyBag2, (void**)&pPropBag2 );
+    //ATLASSERT( hr >= 0 );
+
+    if( !SUCCEEDED( hr ) )
+        return hr;
+
+    unsigned long aNum;
+    hr = pPropBag2->CountProperties( &aNum );
+    //ATLASSERT( hr >= 0 );
+    if( !SUCCEEDED( hr ) )
+        return hr;
+
+    PROPBAG2* aPropNames = new PROPBAG2[aNum];
+    unsigned long aReaded;
+
+    hr = pPropBag2->GetPropertyInfo( 0,
+                                     aNum,
+                                     aPropNames,
+                                     &aReaded );
+    //ATLASSERT( hr >= 0 );
+    if( !SUCCEEDED( hr ) )
+    {
+        delete[] aPropNames;
+        return hr;
+    }
+
+    CComVariant* aVal = new CComVariant[aNum];
+    HRESULT*     hvs = new HRESULT[aNum];
+    hr = pPropBag2->Read( aNum,
+                          aPropNames,
+                          NULL,
+                          aVal,
+                          hvs );
+    //ATLASSERT( hr >= 0 );
+    if( !SUCCEEDED( hr ) )
+    {
+        delete[] hvs;
+        delete[] aVal;
+        delete[] aPropNames;
+        return hr;
+    }
+
+    USES_CONVERSION;
+    for( unsigned long ind = 0; ind < aNum; ind++ )
+    {
+        // all information from the 'object' tag is in strings
+        if( aVal[ind].vt == VT_BSTR && !strcmp( OLE2T( aPropNames[ind].pstrName ), "src" ) )
+        {
+            mCurFileUrl = wcsdup( aVal[ind].bstrVal );
+        }
+        else if( aVal[ind].vt == VT_BSTR
+                && !strcmp( OLE2T( aPropNames[ind].pstrName ), "readonly" ) )
+        {
+            if( !strcmp( OLE2T( aVal[ind].bstrVal ), "true" ) )
+            {
+                // the default value
+                mbViewOnly = TRUE;
+            }
+            else
+            {
+                mbViewOnly = FALSE;
+            }
+        }
+    }
+
+    delete[] hvs;
+    delete[] aVal;
+    delete[] aPropNames;
+
+    if( !mpDispFactory )
+        return hr;
+
+    mbReadyForActivation = FALSE;
+    hr = CBindStatusCallback<CSOActiveX>::Download( this, &CSOActiveX::CallbackCreateXInputStream, mCurFileUrl, m_spClientSite, FALSE );
+    if ( hr == MK_S_ASYNCHRONOUS )
+        hr = S_OK;
+
+    if ( !SUCCEEDED( hr ) )
+    {
+        // trigger initialization without stream
+        mbLoad = TRUE;
+
+        Invalidate();
+        UpdateWindow();
+    }
+
+    return hr;
+}
+
+HRESULT CSOActiveX::GetUnoStruct( OLECHAR* sStructName, CComPtr<IDispatch>& pdispResult )
+{
+    CComVariant aComStruct( sStructName );
+    return GetIDispByFunc( mpDispFactory, L"Bridge_GetStruct", &aComStruct, 1, pdispResult );
+}
+
+HRESULT CSOActiveX::GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl )
+{
+    HRESULT hr = GetUnoStruct( L"com.sun.star.util.URL", pdispUrl );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    OLECHAR* sURLMemberName = L"Complete";
+    DISPID nURLID;
+    hr = pdispUrl->GetIDsOfNames( IID_NULL, &sURLMemberName, 1, LOCALE_USER_DEFAULT, &nURLID );
+    if( !SUCCEEDED( hr ) ) return hr;
+    CComVariant aComUrl( sUrl );
+    hr = CComDispatchDriver::PutProperty( pdispUrl, nURLID, &aComUrl );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComPtr<IDispatch> pdispTransformer;
+    CComVariant aServiceName( L"com.sun.star.util.URLTransformer" );
+    hr = GetIDispByFunc( mpDispFactory,
+                         L"createInstance",
+                         &aServiceName,
+                         1,
+                         pdispTransformer );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComVariant dummyResult;
+    CComVariant aParam[2];
+    aParam[1].ppdispVal = &pdispUrl;
+    aParam[1].vt = VT_DISPATCH | VT_BYREF;
+    aParam[0] = CComVariant( L"file:///" );
+
+    hr = ExecuteFunc( pdispTransformer, L"parseSmart", aParam, 2, &dummyResult );
+    if( !SUCCEEDED( hr ) || dummyResult.vt != VT_BOOL || !dummyResult.boolVal ) return hr;
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::SetLayoutManagerProps()
+{
+    if ( !mpDispFrame )
+        return E_FAIL;
+
+    CComVariant pVarLayoutMgr;
+    OLECHAR* sLMPropName = L"LayoutManager";
+    HRESULT hr = GetPropertiesFromIDisp( mpDispFrame, &sLMPropName, &pVarLayoutMgr, 1 );
+    if( pVarLayoutMgr.vt != VT_DISPATCH || pVarLayoutMgr.pdispVal == NULL )
+        return E_FAIL;
+
+      CComPtr<IDispatch> pdispLM( pVarLayoutMgr.pdispVal );
+
+
+    if( !SUCCEEDED( hr ) || !pdispLM )
+        return E_FAIL;
+
+    OLECHAR* sATName = L"AutomaticToolbars";
+    CComVariant pATProp;
+    pATProp.vt = VT_BOOL; pATProp.boolVal = VARIANT_FALSE ;
+    hr = PutPropertiesToIDisp( pdispLM, &sATName, &pATProp, 1 );
+
+    return hr;
+}
+
+HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
+{
+    if( !mpDispFactory )
+        return E_FAIL;
+
+    // create window handle holder
+    CComPtr< CComObject< SOComWindowPeer > > pPeerToSend = new CComObject<SOComWindowPeer>();
+    pPeerToSend->SetHWNDInternally( hwnd );
+    CComQIPtr< IDispatch, &IID_IDispatch > pIDispToSend( pPeerToSend );
+
+    // create rectangle structure
+    CComPtr<IDispatch> pdispRectangle;
+    HRESULT hr = GetUnoStruct( L"com.sun.star.awt.Rectangle", pdispRectangle );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    OLECHAR* sRectMemberNames[4] = { L"X",
+                                      L"Y",
+                                      L"Width",
+                                      L"Height" };
+    CComVariant pRectVariant[4];
+    pRectVariant[0] = pRectVariant[1] = pRectVariant[2] = pRectVariant[3] = CComVariant( 0 );
+
+    hr = PutPropertiesToIDisp( pdispRectangle, sRectMemberNames, pRectVariant, 4 );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create WindowDescriptor structure
+    CComPtr<IDispatch> pdispWinDescr;
+    hr = GetUnoStruct( L"com.sun.star.awt.WindowDescriptor", pdispWinDescr );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // fill in descriptor with info
+    OLECHAR* sDescriptorMemberNames[6] = { L"Type",
+                                 L"WindowServiceName",
+                                 L"ParentIndex",
+                                 L"Parent",
+                                 L"Bounds",
+                                 L"WindowAttributes" };
+    CComVariant pDescriptorVar[6];
+    pDescriptorVar[0] = CComVariant( 0 );
+    pDescriptorVar[1] = CComVariant( L"workwindow" );
+    pDescriptorVar[2] = CComVariant( 1 );
+    pDescriptorVar[3] = CComVariant( pIDispToSend );
+    pDescriptorVar[4] = CComVariant( pdispRectangle );
+    pDescriptorVar[5] = CComVariant( 33 );
+    hr = PutPropertiesToIDisp( pdispWinDescr, sDescriptorMemberNames, pDescriptorVar, 6 );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create XToolkit instance
+    CComPtr<IDispatch> pdispToolkit;
+    CComVariant aServiceName( L"com.sun.star.awt.Toolkit" );
+    hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aServiceName, 1, pdispToolkit );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create window with toolkit
+    CComVariant aWinDescr( pdispWinDescr );
+    hr = GetIDispByFunc( pdispToolkit, L"createWindow", &aWinDescr, 1, mpDispWin );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create frame
+    aServiceName = CComVariant( L"com.sun.star.frame.Task" );
+    hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aServiceName, 1, mpDispFrame );
+    if( !SUCCEEDED( hr ) || !mpDispFrame )
+    {
+        // the interface com.sun.star.frame.Task is removed in 6.1
+        // but the interface com.sun.star.frame.Frame has some bugs in 6.0
+        aServiceName = CComVariant( L"com.sun.star.frame.Frame" );
+        hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aServiceName, 1, mpDispFrame );
+        if( !SUCCEEDED( hr ) ) return hr;
+    }
+
+    // initialize frame
+    CComVariant dummyResult;
+    CComVariant aDispWin( mpDispWin );
+    hr = ExecuteFunc( mpDispFrame, L"initialize", &aDispWin, 1, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // set some properties to the layout manager, ignore errors for now
+    SetLayoutManagerProps();
+
+    // create desktop
+    CComPtr<IDispatch> pdispDesktop;
+    aServiceName = CComVariant( L"com.sun.star.frame.Desktop" );
+    hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aServiceName, 1, pdispDesktop );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create tree of frames
+    CComPtr<IDispatch> pdispChildren;
+    hr = GetIDispByFunc( pdispDesktop, L"getFrames", NULL, 0, pdispChildren );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // insert new frame into desctop hierarchy
+    CComVariant aDispFrame( mpDispFrame );
+    hr = ExecuteFunc( pdispChildren, L"append", &aDispFrame, 1, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // initialize window
+    CComVariant aTransparent( (long)0xFFFFFFFF );
+    hr = ExecuteFunc( mpDispWin, L"setBackground", &aTransparent, 1, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComVariant aTrue( TRUE );
+    hr = ExecuteFunc( mpDispWin, L"setVisible", &aTrue, 1, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComVariant aPosArgs[5];
+    aPosArgs[4] = CComVariant( 0 );
+    aPosArgs[3] = CComVariant( 0 );
+    aPosArgs[2] = CComVariant( width );
+    aPosArgs[1] = CComVariant( height );
+    aPosArgs[0] = CComVariant( 12 );
+    hr = ExecuteFunc( mpDispWin, L"setPosSize", aPosArgs, 5, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    // create frame locker if there is such service
+    aServiceName = CComVariant( L"com.sun.star.embed.InstanceLocker" );
+    hr = GetIDispByFunc( mpDispFactory, L"createInstance", &aServiceName, 1, mpInstanceLocker );
+    if( SUCCEEDED( hr ) && mpInstanceLocker )
+    {
+        SAFEARRAY FAR* pInitVals = SafeArrayCreateVector( VT_VARIANT, 0, 3 );
+
+        // the first sequence element
+        long nInitInd = 0;
+        CComVariant pFrameVariant( mpDispFrame );
+        SafeArrayPutElement( pInitVals, &nInitInd, &pFrameVariant );
+
+        // the second sequence element
+        nInitInd = 1;
+        CComVariant pStrArr( 1L );
+        SafeArrayPutElement( pInitVals, &nInitInd, &pStrArr );
+
+        // the third sequence element
+        nInitInd = 2;
+        CComPtr<IDispatch> pdispValueObj;
+        hr = GetIDispByFunc( mpDispFactory, L"Bridge_GetValueObject", NULL, 0, pdispValueObj );
+        if( !SUCCEEDED( hr ) || !pdispValueObj ) return hr;
+
+        CComVariant aValueArgs[2];
+        aValueArgs[1] = CComVariant( L"com.sun.star.embed.XActionsApproval" );
+        CComPtr< CComObject< SOActionsApproval > > pApproval( new CComObject<SOActionsApproval>() );
+        aValueArgs[0] = CComVariant ( pApproval );
+
+        hr = ExecuteFunc( pdispValueObj, L"Set", aValueArgs, 2, &dummyResult );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        CComVariant aValueObj( pdispValueObj );
+        SafeArrayPutElement( pInitVals, &nInitInd, &aValueObj );
+
+        // execute initialize()
+        CComVariant aVarInitVals;
+        aVarInitVals.vt = VT_ARRAY | VT_VARIANT; aVarInitVals.parray = pInitVals;
+        hr = ExecuteFunc( mpInstanceLocker, L"initialize", &aVarInitVals, 1, &dummyResult );
+        if( !SUCCEEDED( hr ) ) return hr;
+    }
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::CallLoadComponentFromURL1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL sArgVal )
+{
+    SAFEARRAY FAR* pPropVals = SafeArrayCreateVector( VT_DISPATCH, 0, 1 );
+    long ix = 0;
+    CComPtr<IDispatch> pdispPropVal;
+    HRESULT hr = GetUnoStruct( L"com.sun.star.beans.PropertyValue", pdispPropVal );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    OLECHAR*    sPropMemberNames[2] = { L"Name", L"Value" };
+    CComVariant pPropVar[2];
+    pPropVar[0] = CComVariant( sArgName );
+    pPropVar[1].vt = VT_BOOL; pPropVar[1].boolVal = sArgVal ? VARIANT_TRUE : VARIANT_FALSE ;
+    hr = PutPropertiesToIDisp( pdispPropVal, sPropMemberNames, pPropVar, 2 );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    SafeArrayPutElement( pPropVals, &ix, pdispPropVal );
+
+    CComVariant aDispArgs[4];
+    aDispArgs[3] = CComVariant( sUrl );
+    aDispArgs[2] = CComVariant( L"_self" );
+    aDispArgs[1] = CComVariant( 0 );
+    // aDispArgs[0] = CComVariant( pPropVals ); such constructor is not defined ??!
+    aDispArgs[0].vt = VT_ARRAY | VT_DISPATCH; aDispArgs[0].parray = pPropVals;
+
+    CComVariant dummyResult;
+    hr = ExecuteFunc( mpDispFrame, L"loadComponentFromURL", aDispArgs, 4, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::CallDispatchMethod( OLECHAR* sUrl,
+                                        CComVariant* aArgNames,
+                                        CComVariant* aArgVals,
+                                        unsigned int count )
+{
+    CComPtr<IDispatch> pdispURL;
+    HRESULT hr = GetUrlStruct( sUrl, pdispURL );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComPtr<IDispatch> pdispXDispatch;
+    CComVariant aArgs[3];
+    aArgs[2] = CComVariant( pdispURL );
+    aArgs[1] = CComVariant( L"" );
+    aArgs[0] = CComVariant( (int)0 );
+    hr = GetIDispByFunc( mpDispFrame,
+                         L"queryDispatch",
+                         aArgs,
+                         3,
+                         pdispXDispatch );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    SAFEARRAY FAR* pPropVals = SafeArrayCreateVector( VT_DISPATCH, 0, count );
+    for( long ix = 0; ix < (long)count; ix ++ )
+    {
+        CComPtr<IDispatch> pdispPropVal;
+        hr = GetUnoStruct( L"com.sun.star.beans.PropertyValue", pdispPropVal );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        OLECHAR*    sPropMemberNames[2] = { L"Name", L"Value" };
+        CComVariant pPropVar[2];
+        pPropVar[0] = aArgNames[ix];
+        pPropVar[1] = aArgVals[ix];
+        hr = PutPropertiesToIDisp( pdispPropVal, sPropMemberNames, pPropVar, 2 );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        SafeArrayPutElement( pPropVals, &ix, pdispPropVal );
+    }
+
+    CComVariant aDispArgs[2];
+    aDispArgs[1] = CComVariant( pdispURL );
+    // aDispArgs[0] = CComVariant( pPropVals ); such constructor is not defined ??!
+    aDispArgs[0].vt = VT_ARRAY | VT_DISPATCH; aDispArgs[0].parray = pPropVals;
+
+    CComVariant dummyResult;
+    hr = ExecuteFunc( pdispXDispatch, L"dispatch", aDispArgs, 2, &dummyResult );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    return S_OK;
+}
+
+void CSOActiveX::CallbackCreateXInputStream( CBindStatusCallback<CSOActiveX>* /*pbsc*/, BYTE* pBytes, DWORD dwSize )
+{
+    if ( mbReadyForActivation )
+        return;
+
+    BOOL bSuccess = FALSE;
+    BOOL bFinishDownload = FALSE;
+    if ( !pBytes )
+    {
+        // means the download is finished, dwSize contains hresult
+        bFinishDownload = TRUE;
+        if ( SUCCEEDED( dwSize ) )
+            bSuccess = TRUE;
+    }
+    else
+    {
+        HRESULT hr = S_OK;
+
+        if ( !mpDispTempFile )
+        {
+            CComVariant aServiceName( L"com.sun.star.io.TempFile" );
+            hr = GetIDispByFunc( mpDispFactory,
+                                 L"createInstance",
+                                 &aServiceName,
+                                 1,
+                                 mpDispTempFile );
+        }
+
+        if( SUCCEEDED( hr ) && mpDispTempFile )
+        {
+            SAFEARRAY FAR* pDataArray = SafeArrayCreateVector( VT_I1, 0, dwSize );
+
+            if ( pDataArray )
+            {
+                hr = SafeArrayLock( pDataArray );
+                if ( SUCCEEDED( hr ) )
+                {
+                    for( DWORD ix = 0; ix < dwSize; ix++ )
+                        ((BYTE*)(pDataArray->pvData))[ix] = pBytes[ix];
+                    hr = SafeArrayUnlock( pDataArray );
+                    if ( SUCCEEDED( hr ) )
+                    {
+                        CComVariant aArgs[1];
+                        aArgs[0].vt = VT_ARRAY | VT_I1; aArgs[0].parray = pDataArray;
+                        CComVariant dummyResult;
+                        hr = ExecuteFunc( mpDispTempFile, L"writeBytes", aArgs, 1, &dummyResult );
+                        if( SUCCEEDED( hr ) )
+                            bSuccess = TRUE;
+                    }
+                }
+            }
+        }
+    }
+
+    if ( !bSuccess )
+    {
+        // the download failed, let StarOffice download
+        bFinishDownload = TRUE;
+        mpDispTempFile = CComPtr< IDispatch >();
+    }
+
+    if ( bFinishDownload )
+    {
+        // trigger the loading now
+        mbLoad = TRUE;
+        mbReadyForActivation = TRUE;
+
+        Invalidate();
+        UpdateWindow();
+    }
+}
+
+HRESULT CSOActiveX::LoadURLToFrame( )
+{
+    CComVariant aArgNames[4] = { L"ReadOnly", L"ViewOnly", L"AsTemplate", L"InputStream" };
+    CComVariant aArgVals[4];
+    unsigned int nCount = 3; // the 4-th argument is used only if the stream can be retrieved
+
+    aArgVals[0].vt = VT_BOOL; aArgVals[0].boolVal = mbViewOnly ? VARIANT_TRUE : VARIANT_FALSE;
+    aArgVals[1].vt = VT_BOOL; aArgVals[1].boolVal = mbViewOnly ? VARIANT_TRUE : VARIANT_FALSE;
+    aArgVals[2].vt = VT_BOOL; aArgVals[2].boolVal = VARIANT_FALSE;
+
+    if ( mpDispTempFile )
+    {
+        aArgVals[3] = CComVariant( mpDispTempFile );
+        nCount = 4;
+    }
+
+    HRESULT hr = CallDispatchMethod( mCurFileUrl, aArgNames, aArgVals, nCount );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    CComVariant aBarName( L"MenuBarVisible" );
+    CComVariant aBarVis;
+    aBarVis.vt = VT_BOOL; aBarVis.boolVal = VARIANT_FALSE;
+    hr = CallDispatchMethod( L"slot:6661", &aBarName, &aBarVis, 1 );
+    // does not work for some documents, but it is no error
+    // if( !SUCCEEDED( hr ) ) return hr;
+
+    // try to get the model and set the presetation specific property, the setting will fail for other document formats
+    CComPtr<IDispatch> pdispController;
+    hr = GetIDispByFunc( mpDispFrame, L"getController", NULL, 0, pdispController );
+    if ( SUCCEEDED( hr ) && pdispController )
+    {
+        CComPtr<IDispatch> pdispModel;
+        hr = GetIDispByFunc( pdispController, L"getModel", NULL, 0, pdispModel );
+        if ( SUCCEEDED( hr ) && pdispModel )
+        {
+            CComPtr<IDispatch> pdispPres;
+            hr = GetIDispByFunc( pdispModel, L"getPresentation", NULL, 0, pdispPres );
+            if ( SUCCEEDED( hr ) && pdispPres )
+            {
+                // this is a presentation
+                // let the slide show be shown in the document window
+                OLECHAR* pPropName = L"IsFullScreen";
+                CComVariant pPresProp;
+                pPresProp.vt = VT_BOOL; pPresProp.boolVal = VARIANT_FALSE ;
+                hr = PutPropertiesToIDisp( pdispPres, &pPropName, &pPresProp, 1 );
+
+                // start the slide show
+                if ( SUCCEEDED( hr ) )
+                {
+                    CComVariant dummyResult;
+                    ExecuteFunc( pdispPres, L"Start", NULL, 0, &dummyResult );
+                }
+            }
+        }
+    }
+
+    // create dispatch interceptor
+    mpDispatchInterceptor = new CComObject< SODispatchInterceptor >();
+    mpDispatchInterceptor->AddRef();
+    mpDispatchInterceptor->SetParent( this );
+    CComQIPtr< IDispatch, &IID_IDispatch > pIDispDispInter( mpDispatchInterceptor );
+
+    // register dispatch interceptor in the frame
+        CComVariant aDispVariant( pIDispDispInter );
+    CComVariant dummyResult;
+    hr = ExecuteFunc( mpDispFrame,
+                      L"registerDispatchProviderInterceptor",
+                                          &aDispVariant,
+                      1,
+                      &dummyResult );
+
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    return S_OK;
+}
+
+SOVersion CSOActiveX::GetVersionConnected()
+{
+    SOVersion bResult = SO_NOT_DETECTED;
+    if( mpDispFactory )
+    {
+        // create ConfigurationProvider instance
+        CComPtr<IDispatch> pdispConfProv;
+        CComVariant aServiceName( L"com.sun.star.configuration.ConfigurationProvider" );
+        HRESULT hr = GetIDispByFunc( mpDispFactory,
+                             L"createInstance",
+                             &aServiceName,
+                             1,
+                             pdispConfProv );
+
+        if( SUCCEEDED( hr ) && pdispConfProv )
+        {
+            CComPtr<IDispatch> pdispConfAccess;
+
+            SAFEARRAY* pInitParams = SafeArrayCreateVector( VT_VARIANT, 0, 1 );
+
+            if( pInitParams )
+            {
+                long ix = 0;
+                CComVariant aConfPath( L"org.openoffice.Setup" );
+                SafeArrayPutElement( pInitParams, &ix, &aConfPath );
+
+                CComVariant aArgs[2];
+                aArgs[1] = CComVariant( L"com.sun.star.configuration.ConfigurationAccess" );
+                aArgs[0].vt = VT_ARRAY | VT_VARIANT; aArgs[0].parray = pInitParams;
+
+                hr = GetIDispByFunc( pdispConfProv,
+                                     L"createInstanceWithArguments",
+                                    aArgs,
+                                     2,
+                                     pdispConfAccess );
+
+                if( SUCCEEDED( hr ) && pdispConfAccess )
+                {
+                    CComVariant aOfficeName;
+
+                    CComVariant aProductName( L"Product/ooName" );
+                    hr = ExecuteFunc( pdispConfAccess,
+                                        L"getByHierarchicalName",
+                                        &aProductName,
+                                        1,
+                                        &aOfficeName );
+
+                    if( SUCCEEDED( hr ) && aOfficeName.vt == VT_BSTR )
+                    {
+                        CComVariant aOfficeVersion;
+
+                        CComVariant aProductVersion( L"Product/ooSetupVersion" );
+                        hr = ExecuteFunc( pdispConfAccess,
+                                            L"getByHierarchicalName",
+                                            &aProductVersion,
+                                            1,
+                                            &aOfficeVersion );
+
+                        if( SUCCEEDED( hr ) && aOfficeVersion.vt == VT_BSTR )
+                        {
+                            USES_CONVERSION;
+                            if( !strcmp( OLE2T( aOfficeName.bstrVal ), "StarOffice" ) )
+                            {
+                                if( !strncmp( OLE2T( aOfficeVersion.bstrVal ), "6.1", 3 ) )
+                                    bResult = SO_61;
+                                else if( !strncmp( OLE2T( aOfficeVersion.bstrVal ), "6.0", 3 ) )
+                                    bResult = SO_60;
+                                else if( !strncmp( OLE2T( aOfficeVersion.bstrVal ), "5.2", 3 ) )
+                                    bResult = SO_52;
+                                else
+                                    bResult = SO_UNKNOWN;
+                            }
+                            else // OpenOffice
+                            {
+                                if( !strncmp( OLE2T( aOfficeVersion.bstrVal ), "1.1", 3 ) )
+                                    bResult = OO_11;
+                                else if( !strncmp( OLE2T( aOfficeVersion.bstrVal ), "1.0", 3 ) )
+                                    bResult = OO_10;
+                                else
+                                    bResult = OO_UNKNOWN;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return bResult;
+}
+
+class LockingGuard
+{
+    BOOL& mbLocked;
+public:
+    LockingGuard( BOOL& bLocked )
+    : mbLocked( bLocked )
+    {
+        mbLocked = TRUE;
+    }
+
+    ~LockingGuard()
+    {
+        mbLocked = FALSE;
+    }
+};
+
+HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
+{
+    // This method is called only in main thread, no need to lock it
+
+    // Get read of reentrance problems
+    if ( mbDrawLocked )
+        return S_OK;
+    LockingGuard aGuard( mbDrawLocked );
+
+    if( m_spInPlaceSite && mCurFileUrl && mbReadyForActivation )
+    {
+        HWND hwnd;
+        HRESULT hr = m_spInPlaceSite->GetWindow( &hwnd );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        if( mParentWin != hwnd || !mOffWin )
+        {
+            if( mpDispFrame )
+            {
+                CComVariant dummyResult;
+                CComVariant aPropVar;
+                aPropVar.vt = VT_BOOL; aPropVar.boolVal = VARIANT_FALSE;
+                HRESULT hr = ExecuteFunc( mpDispFrame, L"close", &aPropVar, 1, &dummyResult );
+                (void)hr;
+                mpDispFrame = CComPtr<IDispatch>();
+            }
+
+            mParentWin = hwnd;
+            mOffWin = CreateWindow(
+                                STAROFFICE_WINDOWCLASS,
+                                "OfficeContainer",
+                                WS_CHILD | WS_CLIPCHILDREN | WS_BORDER,
+                                di.prcBounds->left,
+                                di.prcBounds->top,
+                                di.prcBounds->right - di.prcBounds->left,
+                                di.prcBounds->bottom - di.prcBounds->top,
+                                mParentWin,
+                                NULL,
+                                NULL,
+                                NULL );
+
+            ::ShowWindow( mOffWin, SW_SHOW );
+        }
+        else
+        {
+            RECT aRect;
+            ::GetWindowRect( mOffWin, &aRect );
+
+            if( aRect.left !=  di.prcBounds->left || aRect.top != di.prcBounds->top
+             || aRect.right != di.prcBounds->right || aRect.bottom != di.prcBounds->bottom )
+            {
+                // on this state the office window should exist already
+                ::SetWindowPos( mOffWin,
+                              HWND_TOP,
+                              di.prcBounds->left,
+                              di.prcBounds->top,
+                              di.prcBounds->right - di.prcBounds->left,
+                              di.prcBounds->bottom - di.prcBounds->top,
+                              SWP_NOZORDER );
+
+                CComVariant aPosArgs[5];
+                aPosArgs[4] = CComVariant( 0 );
+                aPosArgs[3] = CComVariant( 0 );
+                aPosArgs[2] = CComVariant( int(di.prcBounds->right - di.prcBounds->left) );
+                aPosArgs[1] = CComVariant( int(di.prcBounds->bottom - di.prcBounds->top) );
+                aPosArgs[0] = CComVariant( 12 );
+                CComVariant dummyResult;
+                hr = ExecuteFunc( mpDispWin, L"setPosSize", aPosArgs, 5, &dummyResult );
+                if( !SUCCEEDED( hr ) ) return hr;
+            }
+        }
+
+        if( !mnVersion )
+        {
+            OutputError_Impl( mOffWin, CS_E_INVALID_VERSION );
+            return E_FAIL;
+        }
+
+        if( ! mpDispFrame )
+        {
+            hr = CreateFrameOldWay( mOffWin,
+                            di.prcBounds->right - di.prcBounds->left,
+                            di.prcBounds->bottom - di.prcBounds->top );
+
+            if( !SUCCEEDED( hr ) )
+            {
+                // if the frame can not be opened do not try any more
+                mbReadyForActivation = FALSE;
+                OutputError_Impl( mOffWin, STG_E_ABNORMALAPIEXIT );
+                return hr;
+            }
+        }
+
+        if( mbLoad )
+        {
+            hr = LoadURLToFrame();
+            mbLoad = FALSE;
+
+            if( !SUCCEEDED( hr ) )
+            {
+                // if the document can not be opened do not try any more
+                mbReadyForActivation = FALSE;
+
+                OutputError_Impl( mOffWin, STG_E_ABNORMALAPIEXIT );
+
+                return hr;
+            }
+        }
+    }
+    else
+    {
+        // activate the fallback
+        CComControl<CSOActiveX>::OnDrawAdvanced( di );
+    }
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::OnDraw( ATL_DRAWINFO& di )
+{
+    // fallback that is activated by the parent class
+    if ( di.hdcDraw )
+        FillRect( di.hdcDraw, (RECT*)di.prcBounds, (HBRUSH)COLOR_BACKGROUND );
+
+    return S_OK;
+}
+
+STDMETHODIMP CSOActiveX::SetClientSite( IOleClientSite* aClientSite )
+{
+    HRESULT hr = IOleObjectImpl<CSOActiveX>::SetClientSite( aClientSite );
+
+    if( !aClientSite )
+    {
+        //ATLASSERT( mWebBrowser2 );
+        if( mWebBrowser2 )
+            AtlUnadvise( mWebBrowser2, DIID_DWebBrowserEvents2, mCookie );
+        return hr;
+    }
+
+    CComPtr<IOleContainer> aContainer;
+    m_spClientSite->GetContainer( &aContainer );
+//  ATLASSERT( aContainer );
+
+    if( SUCCEEDED( hr )  && aContainer )
+    {
+        CComQIPtr<IServiceProvider, &IID_IServiceProvider> aServiceProvider( aContainer );
+        //ATLASSERT( aServiceProvider );
+
+        if( aServiceProvider )
+        {
+            aServiceProvider->QueryService( SID_SInternetExplorer,
+                                            IID_IWebBrowser,
+                                            (void**)&mWebBrowser2 );
+//          ATLASSERT( mWebBrowser2 );
+            if( mWebBrowser2 )
+                AtlAdvise( mWebBrowser2, GetUnknown(), DIID_DWebBrowserEvents2, &mCookie );
+        }
+    }
+
+    return hr;
+}
+
+STDMETHODIMP CSOActiveX::Invoke(DISPID dispidMember,
+                                REFIID riid,
+                                LCID lcid,
+                                WORD wFlags,
+                                DISPPARAMS* pDispParams,
+                                VARIANT* pvarResult,
+                                EXCEPINFO* pExcepInfo,
+                                UINT* puArgErr)
+{
+    if (riid != IID_NULL)
+        return DISP_E_UNKNOWNINTERFACE;
+
+    if (!pDispParams)
+        return DISP_E_PARAMNOTOPTIONAL;
+
+    if ( dispidMember == DISPID_ONQUIT )
+        Cleanup();
+
+    IDispatchImpl<ISOActiveX, &IID_ISOActiveX,
+                  &LIBID_SO_ACTIVEXLib>::Invoke(
+             dispidMember, riid, lcid, wFlags, pDispParams,
+             pvarResult, pExcepInfo, puArgErr);
+
+    return S_OK;
+}
+
+HRESULT CSOActiveX::GetURL( const OLECHAR* url,
+                              const OLECHAR* target )
+{
+    CComVariant aEmpty1, aEmpty2, aEmpty3;
+    CComVariant aUrl( url );
+    CComVariant aTarget;
+    if ( target )
+        aTarget = CComVariant( target );
+
+    return mWebBrowser2->Navigate2( &aUrl,
+                                  &aEmpty1,
+                                  &aTarget,
+                                  &aEmpty2,
+                                  &aEmpty3 );
+}
+
+
+// ---------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOActiveX.h b/extensions/source/activex/SOActiveX.h
new file mode 100644
index 0000000..fea95d0
--- /dev/null
+++ b/extensions/source/activex/SOActiveX.h
@@ -0,0 +1,178 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOActiveX.h : Declaration of the CSOActiveX
+
+#ifndef __SOACTIVEX_H_
+#define __SOACTIVEX_H_
+
+#include "resource.h"       // main symbols
+
+#pragma warning (disable:4505)
+    // permanently suppress "unreferenced local function has been removed" warning
+
+#pragma warning (push,1)
+#pragma warning (disable:4265)
+
+#include <ExDispID.h>
+#include <ExDisp.h>
+#include <shlguid.h>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#undef _DEBUG
+#endif
+#include <atlctl.h>
+
+#include "so_activex.h"
+
+#pragma warning (pop)
+
+class SODispatchInterceptor;
+
+enum SOVersion {
+    SO_NOT_DETECTED = 0,
+    SO_52,
+    SO_60,
+    SO_61,
+    SO_UNKNOWN,
+    OO_10,
+    OO_11,
+    OO_UNKNOWN
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// CSOActiveX
+class ATL_NO_VTABLE CSOActiveX :
+    public CComObjectRootEx<CComSingleThreadModel>,
+    public IDispatchImpl<ISOActiveX, &IID_ISOActiveX, &LIBID_SO_ACTIVEXLib>,
+    public CComControl<CSOActiveX>,
+    public IPersistStreamInitImpl<CSOActiveX>,
+    public IOleControlImpl<CSOActiveX>,
+    public IOleObjectImpl<CSOActiveX>,
+    public IOleInPlaceActiveObjectImpl<CSOActiveX>,
+    public IViewObjectExImpl<CSOActiveX>,
+    public IOleInPlaceObjectWindowlessImpl<CSOActiveX>,
+//  public IConnectionPointContainerImpl<CSOActiveX>,
+    public CComCoClass<CSOActiveX, &CLSID_SOActiveX>,
+//  public CProxy_ItryPluginEvents< CSOActiveX >,
+    public IPersistPropertyBagImpl< CSOActiveX >,
+    public IProvideClassInfo2Impl<  &CLSID_SOActiveX,
+                                    &DIID__ISOActiveXEvents,
+                                    &LIBID_SO_ACTIVEXLib >,
+    public IObjectSafetyImpl< CSOActiveX,
+                              INTERFACESAFE_FOR_UNTRUSTED_DATA >
+{
+protected:
+    CComPtr<IWebBrowser2>   mWebBrowser2;
+    DWORD                   mCookie;
+
+    CComPtr<IDispatch>      mpDispFactory;
+    CComPtr<IDispatch>      mpDispFrame;
+    CComPtr<IDispatch>      mpInstanceLocker;
+    CComPtr<IDispatch>      mpDispWin;
+    OLECHAR*                mCurFileUrl;
+    BOOL                    mbLoad;
+    BOOL                    mbViewOnly;
+    WNDCLASS                mPWinClass;
+    HWND                    mParentWin;
+    HWND                    mOffWin;
+
+    SODispatchInterceptor*  mpDispatchInterceptor;
+    SOVersion               mnVersion;
+
+    BOOL                    mbReadyForActivation;
+    CComPtr<IDispatch>      mpDispTempFile;
+
+    BOOL                    mbDrawLocked;
+
+public:
+    CSOActiveX();
+    ~CSOActiveX();
+
+DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CSOActiveX)
+    COM_INTERFACE_ENTRY(ISOActiveX)
+    COM_INTERFACE_ENTRY(IDispatch)
+    COM_INTERFACE_ENTRY(IViewObjectEx)
+    COM_INTERFACE_ENTRY(IViewObject2)
+    COM_INTERFACE_ENTRY(IViewObject)
+    COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
+    COM_INTERFACE_ENTRY(IOleInPlaceObject)
+    COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
+    COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
+    COM_INTERFACE_ENTRY(IOleControl)
+    COM_INTERFACE_ENTRY(IOleObject)
+    COM_INTERFACE_ENTRY(IPersistStreamInit)
+    COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
+//  COM_INTERFACE_ENTRY(IConnectionPointContainer)
+    COM_INTERFACE_ENTRY(IProvideClassInfo)
+    COM_INTERFACE_ENTRY(IProvideClassInfo2)
+    COM_INTERFACE_ENTRY(IPersistPropertyBag)
+    COM_INTERFACE_ENTRY(IObjectSafety)
+END_COM_MAP()
+
+BEGIN_PROP_MAP(CSOActiveX)
+    PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
+    PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
+    // Example entries
+    // PROP_ENTRY("Property Description", dispid, clsid)
+    // PROP_PAGE(CLSID_StockColorPage)
+END_PROP_MAP()
+
+BEGIN_CONNECTION_POINT_MAP(CSOActiveX)
+END_CONNECTION_POINT_MAP()
+
+BEGIN_MSG_MAP(CSOActiveX)
+    CHAIN_MSG_MAP(CComControl<CSOActiveX>)
+    DEFAULT_REFLECTION_HANDLER()
+END_MSG_MAP()
+// Handler prototypes:
+//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
+
+
+
+// IViewObjectEx
+    DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE)
+
+// ISOActiveX
+public:
+
+    STDMETHOD(SetClientSite)( IOleClientSite* aClientSite );
+    STDMETHOD(Invoke)(  DISPID dispidMember,
+                        REFIID riid,
+                        LCID lcid,
+                        WORD wFlags,
+                        DISPPARAMS* pDispParams,
+                        VARIANT* pvarResult,
+                        EXCEPINFO* pExcepInfo,
+                        UINT* puArgErr);
+    STDMETHOD(Load) ( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog );
+    STDMETHOD(Load) ( LPSTREAM pStm );
+    STDMETHOD(InitNew) ();
+    HRESULT OnDrawAdvanced(ATL_DRAWINFO& di);
+    HRESULT OnDraw(ATL_DRAWINFO& di);
+
+    HRESULT SetLayoutManagerProps();
+    HRESULT CreateFrameOldWay( HWND hwnd, int width, int height );
+    HRESULT GetUnoStruct( OLECHAR* sStructName, CComPtr<IDispatch>& pdispResult );
+    HRESULT LoadURLToFrame();
+    HRESULT CallDispatchMethod( OLECHAR* sUrl, CComVariant* sArgNames, CComVariant* sArgVal, unsigned int count );
+    HRESULT CallLoadComponentFromURL1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL sArgVal );
+    HRESULT GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl );
+    HRESULT Cleanup();
+    HRESULT TerminateOffice();
+    HRESULT GetURL( const OLECHAR* url,
+                                const OLECHAR* target );
+
+    void CallbackCreateXInputStream( CBindStatusCallback<CSOActiveX>* pbsc, BYTE* pBytes, DWORD dwSize );
+
+
+    SOVersion GetVersionConnected();
+};
+
+#endif //__SOACTIVEX_H_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOActiveX.rgs b/extensions/source/activex/SOActiveX.rgs
new file mode 100644
index 0000000..d3814df
--- /dev/null
+++ b/extensions/source/activex/SOActiveX.rgs
@@ -0,0 +1,33 @@
+HKCR
+{
+	so_activex.SOActiveX.1 = s 'SOActiveX Class'
+	{
+		CLSID = s '{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}'
+	}
+	so_activex.SOActiveX = s 'SOActiveX Class'
+	{
+		CLSID = s '{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}'
+		CurVer = s 'so_activex.SOActiveX.1'
+	}
+	NoRemove CLSID
+	{
+		ForceRemove {67F2A879-82D5-4A6D-8CC5-FFB3C114B69D} = s 'SOActiveX Class'
+		{
+			ProgID = s 'so_activex.SOActiveX.1'
+			VersionIndependentProgID = s 'so_activex.SOActiveX'
+			ForceRemove 'Programmable'
+			InprocServer32 = s '%MODULE%'
+			{
+				val ThreadingModel = s 'Apartment'
+			}
+			ForceRemove 'Control'
+			ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 101'
+			'MiscStatus' = s '0'
+			{
+			    '1' = s '131473'
+			}
+			'TypeLib' = s '{61FA3F13-8061-4796-B055-3697ED28CB38}'
+			'Version' = s '1.0'
+		}
+	}
+}
diff --git a/extensions/source/activex/SOComWindowPeer.cxx b/extensions/source/activex/SOComWindowPeer.cxx
new file mode 100644
index 0000000..7fb56db
--- /dev/null
+++ b/extensions/source/activex/SOComWindowPeer.cxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+
+#include "stdafx2.h"
+#include "so_activex.h"
+#include "SOComWindowPeer.h"
+#include <sal/macros.h>
+
+/////////////////////////////////////////////////////////////////////////////
+//
+
+STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
+{
+    static const IID* arr[] =
+    {
+        &IID_ISOComWindowPeer,
+    };
+
+    for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
+    {
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+        if (InlineIsEqualGUID(*arr[i],riid))
+#else
+        if (::ATL::InlineIsEqualGUID(*arr[i],riid))
+#endif
+            return S_OK;
+    }
+    return S_FALSE;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOComWindowPeer.h b/extensions/source/activex/SOComWindowPeer.h
new file mode 100644
index 0000000..c819e17
--- /dev/null
+++ b/extensions/source/activex/SOComWindowPeer.h
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SOComWindowPeer.h: Definition of the SOComWindowPeer class
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined __SOCOMWINDOWPEER_H_
+#define __SOCOMWINDOWPEER_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h"       // main symbols
+#include <ExDispID.h>
+#include <ExDisp.h>
+#include <shlguid.h>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#undef _DEBUG
+#endif
+#include <atlctl.h>
+
+#include "so_activex.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// SOComWindowPeer
+
+class SOComWindowPeer :
+    public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
+    public ISupportErrorInfo,
+    public CComObjectRoot,
+    public CComCoClass<SOComWindowPeer,&CLSID_SOComWindowPeer>
+{
+    HWND m_hwnd;
+public:
+    SOComWindowPeer() : m_hwnd( NULL ) {}
+    virtual ~SOComWindowPeer() { }
+
+BEGIN_COM_MAP(SOComWindowPeer)
+    COM_INTERFACE_ENTRY(IDispatch)
+    COM_INTERFACE_ENTRY(ISOComWindowPeer)
+    COM_INTERFACE_ENTRY(ISupportErrorInfo)
+END_COM_MAP()
+DECLARE_NOT_AGGREGATABLE(SOComWindowPeer)
+// Remove the comment from the line above if you don't want your object to
+// support aggregation.
+
+DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
+
+// ISupportsErrorInfo
+    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
+
+// ISOComWindowPeer
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getWindowHandle(
+            /* [in] */ SAFEARRAY __RPC_FAR * /*procId*/,
+            /* [in] */ short /*s*/,
+            /* [retval][out] */ long __RPC_FAR *ret)
+        {
+            *ret = HandleToLong( m_hwnd );
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
+            /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *retVal)
+        {
+            *retVal = NULL;
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
+            /* [in] */ IDispatch __RPC_FAR* /*xPointer*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
+            /* [in] */ int /*nColor*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
+            /* [in] */ short /*__MIDL_0015*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
+            /* [in] */ IDispatch __RPC_FAR* /*aRect*/,
+            /* [in] */ short /*nFlags*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE dispose( void)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
+            /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
+            /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
+        {
+            return S_OK;
+        }
+
+        virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
+            /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
+        {
+            *pVal = SafeArrayCreateVector( VT_BSTR, 0, 2 );
+
+            if( !*pVal )
+                return E_FAIL;
+
+            long ix = 0;
+            CComBSTR aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
+            SafeArrayPutElement( *pVal, &ix, aInterface );
+
+            ix = 1;
+            aInterface = CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
+            SafeArrayPutElement( *pVal, &ix, aInterface );
+
+            return S_OK;
+        }
+
+        void SetHWNDInternally( HWND hwnd ) { m_hwnd = hwnd; }
+};
+
+#endif // __SOCOMWINDOWPEER_H_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/activex/SOComWindowPeer.rgs b/extensions/source/activex/SOComWindowPeer.rgs
new file mode 100644
index 0000000..42e985a
--- /dev/null
+++ b/extensions/source/activex/SOComWindowPeer.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+	so_activex.SOComWindowPeer.1 = s 'SOComWindowPeer Class'
+	{
+		CLSID = s '{EE51BD3E-8BB6-4FB8-B319-F65B1BE3B21D}'
+	}
+	so_activex.SOComWindowPeer = s 'SOComWindowPeer Class'
+	{
+		CLSID = s '{EE51BD3E-8BB6-4FB8-B319-F65B1BE3B21D}'
+	}
+	NoRemove CLSID
+	{
+		ForceRemove {EE51BD3E-8BB6-4FB8-B319-F65B1BE3B21D} = s 'SOComWindowPeer Class'
+		{
+			ProgID = s 'so_activex.SOComWindowPeer.1'
+			VersionIndependentProgID = s 'so_activex.SOComWindowPeer'
+			InprocServer32 = s '%MODULE%'
+			{
+				val ThreadingModel = s 'both'
+			}
+		}
+	}
+}
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx b/extensions/source/activex/SODispatchInterceptor.cxx
new file mode 100644
index 0000000..dcddf0d
--- /dev/null
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+// SODispatchInterceptor.cpp : Implementation of CHelpApp and DLL registration.
+
+#include "stdio.h"
+#include "stdafx2.h"
+#include "so_activex.h"
+#include "SOActiveX.h"
+#include "SODispatchInterceptor.h"
+#include "com_uno_helper.h"
+#include <sal/macros.h>
+
+/////////////////////////////////////////////////////////////////////////////
+//
+
+STDMETHODIMP SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
+{
+    static const IID* arr[] =
+    {
+        &IID_ISODispatchInterceptor,
+    };
+
+    for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
+    {
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+        if (InlineIsEqualGUID(*arr[i],riid))
+#else
+        if (::ATL::InlineIsEqualGUID(*arr[i],riid))
+#endif
+            return S_OK;
+    }
+    return S_FALSE;
+}
+
+STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL,
+                                                   BSTR aTargetFrameName,
+                                                   long nSearchFlags,
+                                                   IDispatch FAR* FAR* retVal )
+{
+    if ( !aURL || !retVal ) return E_FAIL;
+
+    CComVariant aTargetUrl;
+    OLECHAR* sURLMemberName = L"Complete";
+    DISPID nURLID;
+    HRESULT hr = aURL->GetIDsOfNames( IID_NULL, &sURLMemberName, 1, LOCALE_USER_DEFAULT, &nURLID );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    hr = CComDispatchDriver::GetProperty( aURL, nURLID, &aTargetUrl );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    if( aTargetUrl.vt != VT_BSTR  ) return E_FAIL;
+
+    USES_CONVERSION;
+    if( !strncmp( OLE2T( aTargetUrl.bstrVal ), ".uno:OpenHyperlink", 18 ) )
+    {
+        CComQIPtr< IDispatch, &IID_IDispatch > pIDisp( this );
+        if( pIDisp )
+        {
+            this->AddRef();
+            *retVal = pIDisp;
+        }
+    }
+    else
+    {
+        if( !m_xSlave )
+        {
+            *retVal = NULL;
+            return S_OK;
+        }
+
+        CComVariant aResult;
+        CComVariant aArgs[3];
+        aArgs[0] = CComVariant( nSearchFlags );
+        aArgs[1] = CComVariant( aTargetFrameName );
+        aArgs[2] = CComVariant( aURL );
+
+        hr = ExecuteFunc( m_xSlave, L"queryDispatch", aArgs, 3, &aResult );
+        if( !SUCCEEDED( hr ) || aResult.vt != VT_DISPATCH || aResult.pdispVal == NULL )
+        {
+            *retVal = NULL;
+            return S_OK;
+        }
+
+        *retVal = aResult.pdispVal;
+
+        CComQIPtr< IUnknown, &IID_IUnknown > pIUnk( *retVal );
+        if( pIUnk )
+            (*retVal)->AddRef();
+    }
+
+    return S_OK;
+}
+
+STDMETHODIMP SODispatchInterceptor::queryDispatches( SAFEARRAY FAR* aDescripts, SAFEARRAY FAR* FAR* retVal)
+{
+    if ( !aDescripts || !retVal || SafeArrayGetDim( aDescripts ) != 1 )
+        return E_FAIL;
+
+    long nLB, nUB;
+
+    HRESULT hr = SafeArrayGetLBound( aDescripts, 1, &nLB );
+    if( !SUCCEEDED( hr ) ) return hr;
+
+    hr = SafeArrayGetUBound( aDescripts, 1, &nUB );
+    if( !SUCCEEDED( hr ) ) return hr;
+    if( nUB < nLB ) return E_FAIL;
+
+    *retVal = SafeArrayCreateVector( VT_DISPATCH, 0, nUB - nLB );
+
+    for ( long ind = nLB; ind <= nUB; ind ++ )
+    {
+        CComPtr<IDispatch> pElem;
+        SafeArrayGetElement( aDescripts, &ind, pElem );
+        if( pElem )
+        {
+            OLECHAR* pMemberNames[3] = { L"FeatureURL", L"FrameName", L"SearchFlags" };
+            CComVariant pValues[3];
+            hr = GetPropertiesFromIDisp( pElem, pMemberNames, pValues, 3 );
+            if( !SUCCEEDED( hr ) ) return hr;
+            if( pValues[0].vt != VT_DISPATCH || pValues[0].pdispVal == NULL
+             || pValues[1].vt != VT_BSTR || pValues[2].vt != VT_I4 )
+                return E_FAIL;
+
+            CComPtr<IDispatch> aRes;
+            hr = queryDispatch( pValues[0].pdispVal, pValues[1].bstrVal, pValues[2].lVal, &aRes );
+            SafeArrayPutElement( *retVal, &ind, aRes );
+        }
+    }
+
+    return S_OK;
+}
+
+
+STDMETHODIMP SODispatchInterceptor::dispatch( IDispatch FAR* aURL, SAFEARRAY FAR* aArgs)
+{
+    // get url from aURL
+    OLECHAR* pUrlName = L"Complete";
+    CComVariant pValue;
+    HRESULT hr = GetPropertiesFromIDisp( aURL, &pUrlName, &pValue, 1 );
+    if( !SUCCEEDED( hr ) ) return hr;
+    if( pValue.vt != VT_BSTR || pValue.bstrVal == NULL )
+        return E_FAIL;
+
+    USES_CONVERSION;
+    if( !strncmp( OLE2T( pValue.bstrVal ), ".uno:OpenHyperlink", 18 ) )
+    {
+        long nLB = 0, nUB = 0;
+        // long nDim = SafeArrayGetDim( aArgs );
+
+        hr = SafeArrayGetLBound( aArgs, 1, &nLB );
+        if( !SUCCEEDED( hr ) ) return hr;
+
+        hr = SafeArrayGetUBound( aArgs, 1, &nUB );
+        if( !SUCCEEDED( hr ) ) return hr;
+        if( nUB < nLB ) return E_FAIL;
+
+        for ( long ind = nLB; ind <= nUB; ind ++ )
+        {
+            CComVariant pVarElem;
+            SafeArrayGetElement( aArgs, &ind, &pVarElem );
+            if( pVarElem.vt == VT_DISPATCH && pVarElem.pdispVal != NULL )
+            {
+                OLECHAR* pMemberNames[2] = { L"Name", L"Value" };
+                CComVariant pValues[2];
+                hr = GetPropertiesFromIDisp( pVarElem.pdispVal, pMemberNames, pValues, 2 );
+                if( !SUCCEEDED( hr ) ) return hr;
+
+                if( pValues[0].vt == VT_BSTR && pValues[1].vt == VT_BSTR )
+                {
+                    USES_CONVERSION;
+                    if( !strncmp( OLE2T( pValues[0].bstrVal ), "URL", 3 ) )
+                    {
+                        EnterCriticalSection( &mMutex );
+                        if( m_xParentControl )
+                        {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list