summaryrefslogtreecommitdiff
path: root/desktop/source/deployment
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/deployment')
-rwxr-xr-xdesktop/source/deployment/deployment.component64
-rw-r--r--desktop/source/deployment/dp_log.cxx4
-rw-r--r--desktop/source/deployment/dp_persmap.cxx21
-rw-r--r--desktop/source/deployment/dp_services.cxx21
-rw-r--r--desktop/source/deployment/dp_xml.cxx14
-rwxr-xr-xdesktop/source/deployment/gui/deploymentgui.component40
-rw-r--r--desktop/source/deployment/gui/descedit.cxx2
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui.h0
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui.hrc63
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_backend.src45
-rw-r--r--desktop/source/deployment/gui/dp_gui_dependencydialog.src2
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/gui/dp_gui_dialog.src80
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx136
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx28
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src30
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx92
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx43
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx16
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx14
-rw-r--r--desktop/source/deployment/gui/dp_gui_shared.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_system.cxx62
-rw-r--r--desktop/source/deployment/gui/dp_gui_system.hxx40
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedata.hxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx880
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx63
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.src36
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx10
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.src1
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx35
-rw-r--r--desktop/source/deployment/gui/license_dialog.hxx5
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/makefile.mk12
-rw-r--r--desktop/source/deployment/inc/db.hxx38
-rw-r--r--desktop/source/deployment/inc/dp_dependencies.hxx9
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_interact.h0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_misc.h0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_misc.mk0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_persmap.h4
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_resource.h6
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_ucb.h0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/inc/dp_xml.h0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/makefile.mk9
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_commandenvironments.cxx36
-rw-r--r--desktop/source/deployment/manager/dp_commandenvironments.hxx18
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx188
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.hxx21
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx41
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx68
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/manager/dp_manager.h0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/manager/dp_manager.hrc0
-rw-r--r--desktop/source/deployment/manager/dp_managerfac.cxx4
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/manager/makefile.mk0
-rw-r--r--desktop/source/deployment/misc/db.cxx1
-rw-r--r--desktop/source/deployment/misc/dp_dependencies.cxx48
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx3
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx8
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/misc/dp_misc.hrc0
-rw-r--r--desktop/source/deployment/misc/dp_misc.src4
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx15
-rw-r--r--desktop/source/deployment/misc/dp_resource.cxx4
-rw-r--r--desktop/source/deployment/misc/dp_ucb.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_update.cxx45
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/misc/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/component/dp_compbackenddb.cxx43
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx1043
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/component/dp_component.hrc1
-rw-r--r--desktop/source/deployment/registry/component/dp_component.src5
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/component/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx137
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/configuration/dp_configuration.hrc0
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx22
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx1
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/configuration/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx89
-rw-r--r--desktop/source/deployment/registry/dp_backenddb.cxx130
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx30
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx45
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/executable/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx478
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/help/dp_help.hrc0
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.cxx46
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.hxx2
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/help/makefile.mk0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/inc/dp_backend.h38
-rw-r--r--desktop/source/deployment/registry/inc/dp_backenddb.hxx15
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/inc/dp_registry.hrc0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/package/dp_extbackenddb.cxx23
-rw-r--r--desktop/source/deployment/registry/package/dp_extbackenddb.hxx11
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/registry/package/dp_package.cxx81
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/package/dp_package.hrc0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/package/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/script/dp_lib_container.cxx6
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/script/dp_lib_container.h17
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx202
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/script/dp_script.hrc0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/script/makefile.mk0
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx4
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_sfwk.cxx66
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/sfwk/dp_sfwk.hrc0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/sfwk/makefile.mk0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/target.pmk0
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/unopkg/makefile.mk0
107 files changed, 2833 insertions, 2153 deletions
diff --git a/desktop/source/deployment/deployment.component b/desktop/source/deployment/deployment.component
new file mode 100755
index 0000000000..11385c7aa8
--- /dev/null
+++ b/desktop/source/deployment/deployment.component
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.deployment.ExtensionManager">
+ <service name="com.sun.star.comp.deployment.ExtensionManager"/>
+ <singleton name="com.sun.star.deployment.ExtensionManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.PackageInformationProvider">
+ <service name="com.sun.star.comp.deployment.PackageInformationProvider"/>
+ <singleton name="com.sun.star.deployment.PackageInformationProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.PackageManagerFactory">
+ <service name="com.sun.star.comp.deployment.PackageManagerFactory"/>
+ <singleton name="com.sun.star.deployment.thePackageManagerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ProgressLog">
+ <service name="com.sun.star.comp.deployment.ProgressLog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.component.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.configuration.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.executable.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.help.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.script.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.sfwk.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+</component>
diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx
index bb58770c4c..e8afda6542 100644
--- a/desktop/source/deployment/dp_log.cxx
+++ b/desktop/source/deployment/dp_log.cxx
@@ -89,7 +89,7 @@ void ProgressLogImpl::disposing()
}
catch (Exception & exc) {
(void) exc;
- OSL_ENSURE( 0, OUStringToOString(
+ OSL_FAIL( OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -153,7 +153,7 @@ void ProgressLogImpl::log_write( OString const & text )
}
catch (io::IOException & exc) {
(void) exc;
- OSL_ENSURE( 0, OUStringToOString(
+ OSL_FAIL( OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index 410bb01c1a..eb5267ee4a 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -61,7 +61,7 @@ void PersistentMap::throw_rtexc( int err, char const * pmsg ) const
buf.append( OUString( msg.getStr(), msg.getLength(),
osl_getThreadTextEncoding() ) );
const OUString msg_(buf.makeStringAndClear());
- OSL_ENSURE( 0, rtl::OUStringToOString(
+ OSL_FAIL( rtl::OUStringToOString(
msg_, RTL_TEXTENCODING_UTF8 ).getStr() );
throw RuntimeException( msg_, Reference<XInterface>() );
}
@@ -74,7 +74,7 @@ PersistentMap::~PersistentMap()
}
catch (DbException & exc) {
(void) exc; // avoid warnings
- OSL_ENSURE( 0, DbEnv::strerror( exc.get_errno() ) );
+ OSL_FAIL( DbEnv::strerror( exc.get_errno() ) );
}
}
@@ -228,15 +228,14 @@ t_string2string_map PersistentMap::getEntries() const
if (err != 0)
throw_rtexc(err);
- ::std::pair<t_string2string_map::iterator, bool > insertion(
- ret.insert( t_string2string_map::value_type(
- t_string2string_map::value_type(
- OString( static_cast< sal_Char const * >(
- dbKey.get_data()),
- dbKey.get_size() ),
- OString( static_cast< sal_Char const * >(
- dbData.get_data()),
- dbData.get_size() ) ) ) ) );
+#if OSL_DEBUG_LEVEL > 0
+ ::std::pair<t_string2string_map::iterator, bool> insertion =
+#endif
+ ret.insert(
+ t_string2string_map::value_type(
+ OString( static_cast<sal_Char const*>(dbKey.get_data()), dbKey.get_size() ),
+ OString( static_cast<sal_Char const*>(dbData.get_data()), dbData.get_size() )
+ ) );
OSL_ASSERT( insertion.second );
}
err = pcurs->close();
diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx
index 36e7163f28..b9a8185b2d 100644
--- a/desktop/source/deployment/dp_services.cxx
+++ b/desktop/source/deployment/dp_services.cxx
@@ -93,27 +93,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return component_writeInfoHelper(
- pServiceManager, pRegistryKey,
- dp_registry::backend::configuration::serviceDecl,
- dp_registry::backend::component::serviceDecl,
- dp_registry::backend::help::serviceDecl,
- dp_registry::backend::script::serviceDecl,
- dp_registry::backend::sfwk::serviceDecl,
- dp_registry::backend::executable::serviceDecl,
- dp_manager::factory::serviceDecl,
- dp_log::serviceDecl,
- dp_info::serviceDecl,
- dp_manager::serviceDecl) &&
- dp_manager::factory::singleton_entries( pRegistryKey ) &&
- dp_info::singleton_entries( pRegistryKey ) &&
- dp_manager::singleton_entries( pRegistryKey);
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/desktop/source/deployment/dp_xml.cxx b/desktop/source/deployment/dp_xml.cxx
index db787eb578..8bd219c1ed 100644
--- a/desktop/source/deployment/dp_xml.cxx
+++ b/desktop/source/deployment/dp_xml.cxx
@@ -45,20 +45,6 @@ namespace dp_misc
//==============================================================================
void xml_parse(
- Reference<xml::input::XRoot> const & xRoot,
- ::ucbhelper::Content & ucb_content,
- Reference<XComponentContext> const & xContext )
-{
- const Any arg(xRoot);
- const Reference<xml::sax::XDocumentHandler> xDocHandler(
- xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUSTR("com.sun.star.xml.input.SaxDocumentHandler"),
- Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY_THROW );
- xml_parse( xDocHandler, ucb_content, xContext );
- }
-
-//==============================================================================
-void xml_parse(
Reference<xml::sax::XDocumentHandler> const & xDocHandler,
::ucbhelper::Content & ucb_content,
Reference<XComponentContext> const & xContext )
diff --git a/desktop/source/deployment/gui/deploymentgui.component b/desktop/source/deployment/gui/deploymentgui.component
new file mode 100755
index 0000000000..d613f482e7
--- /dev/null
+++ b/desktop/source/deployment/gui/deploymentgui.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.deployment.ui.LicenseDialog">
+ <service name="com.sun.star.deployment.ui.LicenseDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ui.PackageManagerDialog">
+ <service name="com.sun.star.deployment.ui.PackageManagerDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ui.UpdateRequiredDialog">
+ <service name="com.sun.star.deployment.ui.UpdateRequiredDialog"/>
+ </implementation>
+</component>
diff --git a/desktop/source/deployment/gui/descedit.cxx b/desktop/source/deployment/gui/descedit.cxx
index 0291ce5802..4091e89f53 100644
--- a/desktop/source/deployment/gui/descedit.cxx
+++ b/desktop/source/deployment/gui/descedit.cxx
@@ -61,7 +61,7 @@ void DescriptionEdit::Init()
// read-only
SetReadOnly();
// no cursor
- EnableCursor( FALSE );
+ EnableCursor( sal_False );
}
// -----------------------------------------------------------------------
diff --git a/desktop/source/deployment/gui/dp_gui.h b/desktop/source/deployment/gui/dp_gui.h
index 043a86f1af..043a86f1af 100644..100755
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.h
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index 19b2faf129..aa856c4ab6 100755
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#define RID_DLG_EXTENSION_MANAGER RID_DEPLOYMENT_GUI_START
#define RID_DLG_UPDATE_REQUIRED (RID_DEPLOYMENT_GUI_START + 11)
-#define RID_EM_BTN_CLOSE 10
+#define RID_EM_BTN_CLOSE 10
#define RID_EM_BTN_HELP 11
#define RID_EM_BTN_ADD 12
#define RID_EM_BTN_CHECK_UPDATES 13
@@ -57,7 +57,6 @@
#define FL_LICENSE 69
#define FI_LICENSE_ARROW1 60
#define FI_LICENSE_ARROW2 61
-#define IMG_LICENCE_ARROW_HC 62
#define BTN_LICENSE_ACCEPT 63
// local RIDs for "Download and Install" dialog
@@ -94,28 +93,27 @@
#define RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES (RID_DEPLOYMENT_GUI_START + 8)
#define RID_WARNINGBOX_INSTALL_EXTENSION (RID_DEPLOYMENT_GUI_START + 9)
-#define RID_DLG_UPDATE (RID_DEPLOYMENT_GUI_START + 10)
-
-#define RID_DLG_UPDATE_CHECKING 1
-#define RID_DLG_UPDATE_THROBBER 2
-#define RID_DLG_UPDATE_UPDATE 3
-#define RID_DLG_UPDATE_UPDATES 4
-#define RID_DLG_UPDATE_ALL 5
-#define RID_DLG_UPDATE_DESCRIPTION 6
-#define RID_DLG_UPDATE_DESCRIPTIONS 7
-#define RID_DLG_UPDATE_LINE 8
-#define RID_DLG_UPDATE_HELP 9
-#define RID_DLG_UPDATE_OK 10
-#define RID_DLG_UPDATE_CANCEL 11
-#define RID_DLG_UPDATE_NORMALALERT 12
-#define RID_DLG_UPDATE_HIGHCONTRASTALERT 13
-#define RID_DLG_UPDATE_ERROR 14
-#define RID_DLG_UPDATE_NONE 15
-#define RID_DLG_UPDATE_NOINSTALLABLE 16
-#define RID_DLG_UPDATE_FAILURE 17
-#define RID_DLG_UPDATE_UNKNOWNERROR 18
-#define RID_DLG_UPDATE_NODESCRIPTION 19
-#define RID_DLG_UPDATE_NOINSTALL 20
+#define RID_DLG_UPDATE (RID_DEPLOYMENT_GUI_START + 10)
+
+#define RID_DLG_UPDATE_CHECKING 1
+#define RID_DLG_UPDATE_THROBBER 2
+#define RID_DLG_UPDATE_UPDATE 3
+#define RID_DLG_UPDATE_UPDATES 4
+#define RID_DLG_UPDATE_ALL 5
+#define RID_DLG_UPDATE_DESCRIPTION 6
+#define RID_DLG_UPDATE_DESCRIPTIONS 7
+#define RID_DLG_UPDATE_LINE 8
+#define RID_DLG_UPDATE_HELP 9
+#define RID_DLG_UPDATE_OK 10
+#define RID_DLG_UPDATE_CLOSE 11
+#define RID_DLG_UPDATE_NORMALALERT 12
+#define RID_DLG_UPDATE_ERROR 14
+#define RID_DLG_UPDATE_NONE 15
+#define RID_DLG_UPDATE_NOINSTALLABLE 16
+#define RID_DLG_UPDATE_FAILURE 17
+#define RID_DLG_UPDATE_UNKNOWNERROR 18
+#define RID_DLG_UPDATE_NODESCRIPTION 19
+#define RID_DLG_UPDATE_NOINSTALL 20
#define RID_DLG_UPDATE_NODEPENDENCY 21
#define RID_DLG_UPDATE_NODEPENDENCY_CUR_VER 22
#define RID_DLG_UPDATE_NOPERMISSION 23
@@ -123,23 +121,24 @@
#define RID_DLG_UPDATE_BROWSERBASED 25
#define RID_DLG_UPDATE_PUBLISHER_LABEL 26
#define RID_DLG_UPDATE_PUBLISHER_LINK 27
-#define RID_DLG_UPDATE_RELEASENOTES_LABEL 28
-#define RID_DLG_UPDATE_RELEASENOTES_LINK 29
+#define RID_DLG_UPDATE_RELEASENOTES_LABEL 28
+#define RID_DLG_UPDATE_RELEASENOTES_LINK 29
#define RID_DLG_UPDATE_NOUPDATE 30
#define RID_DLG_UPDATE_VERSION 31
+#define RID_DLG_UPDATE_IGNORE 32
+#define RID_DLG_UPDATE_ENABLE 33
+#define RID_DLG_UPDATE_IGNORE_ALL 34
+#define RID_DLG_UPDATE_IGNORED_UPDATE 35
+
#define RID_DLG_UPDATEINSTALL (RID_DEPLOYMENT_GUI_START + 20)
#define RID_INFOBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START + 21)
#define RID_IMG_WARNING (RID_DEPLOYMENT_GUI_START+56)
-#define RID_IMG_WARNING_HC (RID_DEPLOYMENT_GUI_START+57)
#define RID_IMG_LOCKED (RID_DEPLOYMENT_GUI_START+58)
-#define RID_IMG_LOCKED_HC (RID_DEPLOYMENT_GUI_START+59)
#define RID_IMG_EXTENSION (RID_DEPLOYMENT_GUI_START+60)
-#define RID_IMG_EXTENSION_HC (RID_DEPLOYMENT_GUI_START+61)
#define RID_IMG_SHARED (RID_DEPLOYMENT_GUI_START+62)
-#define RID_IMG_SHARED_HC (RID_DEPLOYMENT_GUI_START+63)
#define RID_STR_ADD_PACKAGES (RID_DEPLOYMENT_GUI_START+70)
@@ -163,6 +162,7 @@
#define RID_STR_NO_ADMIN_PRIVILEGE (RID_DEPLOYMENT_GUI_START+95)
#define RID_STR_ERROR_MISSING_DEPENDENCIES (RID_DEPLOYMENT_GUI_START+96)
#define RID_STR_ERROR_MISSING_LICENSE (RID_DEPLOYMENT_GUI_START+97)
+#define RID_STR_SHOW_LICENSE_CMD (RID_DEPLOYMENT_GUI_START+98)
#define WARNINGBOX_CONCURRENTINSTANCE (RID_DEPLOYMENT_GUI_START+100)
@@ -172,6 +172,7 @@
#define RID_WARNINGBOX_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104)
#define RID_WARNINGBOX_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105)
#define RID_WARNINGBOX_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106)
+#define RID_DLG_SHOW_LICENSE (RID_DEPLOYMENT_GUI_START+107)
#define RID_DLG_LICENSE RID_DEPLOYMENT_LICENSE_START
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
index c00123fb91..fae0f3022a 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
@@ -47,7 +47,6 @@ AutoScrollEdit::AutoScrollEdit( Window* pParent, const ResId& rResId )
ScrollBar* pScroll = GetVScrollBar();
if (pScroll)
pScroll->Hide();
-// SetLeftMargin( 0 );
StartListening( *GetTextEngine() );
}
@@ -60,7 +59,7 @@ void AutoScrollEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.IsA( TYPE(TextHint) ) )
{
- ULONG nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = ((const TextHint&)rHint).GetId();
if ( nId == TEXT_HINT_VIEWSCROLLED )
{
ScrollBar* pScroll = GetVScrollBar();
diff --git a/desktop/source/deployment/gui/dp_gui_backend.src b/desktop/source/deployment/gui/dp_gui_backend.src
index 343d75df6a..b002bf2408 100644
--- a/desktop/source/deployment/gui/dp_gui_backend.src
+++ b/desktop/source/deployment/gui/dp_gui_backend.src
@@ -33,11 +33,6 @@ Image RID_IMG_DEF_PACKAGE_BUNDLE
ImageBitmap = Bitmap { File = "sx03256.bmp"; };
MASKCOLOR
};
-Image RID_IMG_DEF_PACKAGE_BUNDLE_HC
-{
- ImageBitmap = Bitmap { File = "sxh03256.bmp"; };
- MASKCOLOR
-};
// script, dialog:
Image RID_IMG_SCRIPTLIB
@@ -45,22 +40,12 @@ Image RID_IMG_SCRIPTLIB
ImageBitmap = Bitmap { File = "im30820.bmp"; };
MASKCOLOR
};
-Image RID_IMG_SCRIPTLIB_HC
-{
- ImageBitmap = Bitmap { File = "imh30820.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_DIALOGLIB
{
ImageBitmap = Bitmap { File = "dialogfolder_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_DIALOGLIB_HC
-{
- ImageBitmap = Bitmap { File = "dialogfolder_16_h.bmp"; };
- MASKCOLOR
-};
// configuration:
Image RID_IMG_CONF_XML
@@ -68,11 +53,6 @@ Image RID_IMG_CONF_XML
ImageBitmap = Bitmap { File = "xml_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_CONF_XML_HC
-{
- ImageBitmap = Bitmap { File = "xml_16_h.bmp"; };
- MASKCOLOR
-};
// component, typelib:
Image RID_IMG_COMPONENT
@@ -80,52 +60,27 @@ Image RID_IMG_COMPONENT
ImageBitmap = Bitmap { File = "component_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_COMPONENT_HC
-{
- ImageBitmap = Bitmap { File = "component_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_JAVA_COMPONENT
{
ImageBitmap = Bitmap { File = "javacomponent_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_JAVA_COMPONENT_HC
-{
- ImageBitmap = Bitmap { File = "javacomponent_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_TYPELIB
{
ImageBitmap = Bitmap { File = "library_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_TYPELIB_HC
-{
- ImageBitmap = Bitmap { File = "library_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_JAVA_TYPELIB
{
ImageBitmap = Bitmap { File = "javalibrary_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_JAVA_TYPELIB_HC
-{
- ImageBitmap = Bitmap { File = "javalibrary_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_HELP
{
ImageBitmap = Bitmap { File = "commandimagelist/sc_helperdialog.bmp"; };
MASKCOLOR
};
-Image RID_IMG_HELP_HC
-{
- ImageBitmap = Bitmap { File = "commandimagelist/sch_helperdialog.bmp"; };
- MASKCOLOR
-};
diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.src b/desktop/source/deployment/gui/dp_gui_dependencydialog.src
index 80b584f894..1e5d273943 100644
--- a/desktop/source/deployment/gui/dp_gui_dependencydialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.src
@@ -34,6 +34,7 @@
#define LOCAL_LIST_HEIGHT (6 * RSC_BS_CHARHEIGHT)
ModalDialog RID_DLG_DEPENDENCIES {
+ HelpID = "desktop:ModalDialog:RID_DLG_DEPENDENCIES";
Size = MAP_APPFONT(
(RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH +
RSC_SP_DLG_INNERBORDER_RIGHT),
@@ -52,6 +53,7 @@ ModalDialog RID_DLG_DEPENDENCIES {
NoLabel = TRUE;
};
ListBox RID_DLG_DEPENDENCIES_LIST {
+ HelpID = "desktop:ListBox:RID_DLG_DEPENDENCIES:RID_DLG_DEPENDENCIES_LIST";
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT,
(RSC_SP_DLG_INNERBORDER_TOP + LOCAL_TEXT_HEIGHT +
diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src
index db2e09769d..12b6acb847 100755..100644
--- a/desktop/source/deployment/gui/dp_gui_dialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -31,27 +31,33 @@ String RID_STR_ADD_PACKAGES
{
Text [ en-US ] = "Add Extension(s)";
};
+
String RID_CTX_ITEM_REMOVE
{
Text [ en-US ] = "~Remove";
};
+
String RID_CTX_ITEM_ENABLE
{
Text [ en-US ] = "~Enable";
};
+
String RID_CTX_ITEM_DISABLE
{
Text [ en-US ] = "~Disable";
};
+
String RID_CTX_ITEM_CHECK_UPDATE
{
Text [ en-US ] = "~Update...";
};
+
String RID_CTX_ITEM_OPTIONS
{
Text [ en-US ] = "~Options...";
};
+
String RID_STR_ADDING_PACKAGES
{
Text [ en-US ] = "Adding %EXTENSION_NAME";
@@ -119,11 +125,16 @@ String RID_STR_ERROR_MISSING_LICENSE
Text [ en-US ] = "This extension is disabled because you haven't accepted the license yet.\n";
};
+String RID_STR_SHOW_LICENSE_CMD
+{
+ Text [ en-US ] = "Show license";
+};
+
// Dialog layout
// ---------------------------------------------------
// row 1 | multi line edit
// ---------------------------------------------------
-// row 2 | fixed text
+// row 2 | fixed text
// ---------------------------------------------------
// row 3 | img | fixed text | fixed text | button
// ----------------------------------------------------
@@ -131,7 +142,7 @@ String RID_STR_ERROR_MISSING_LICENSE
// ---------------------------------------------------
// row 5 |fixed line
// ---------------------------------------------------
-// row 6 | | |button | button
+// row 6 | | |button | button
// ---------------------------------------------------
// | col 1 | col 2 | col3 | col4 | col5
@@ -169,6 +180,7 @@ String RID_STR_ERROR_MISSING_LICENSE
ModalDialog RID_DLG_LICENSE
{
+ HelpID = "desktop:ModalDialog:RID_DLG_LICENSE";
Text [ en-US ] = "Extension Software License Agreement";
Size = MAP_APPFONT(LIC_DLG_WIDTH, LIC_DLG_HEIGHT);
@@ -177,10 +189,10 @@ ModalDialog RID_DLG_LICENSE
Moveable = TRUE;
Closeable = TRUE;
Sizeable = FALSE;
-// Hide = TRUE;
MultiLineEdit ML_LICENSE
{
+ HelpID = "desktop:MultiLineEdit:RID_DLG_LICENSE:ML_LICENSE";
Pos = MAP_APPFONT(COL1_X, ROW1_Y);
Size = MAP_APPFONT(BODYWIDTH, ROW1_HEIGHT);
Border = TRUE;
@@ -195,14 +207,16 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Please follow these steps to proceed with the installation of the extension:";
- };
+ };
+
FixedText FT_LICENSE_BODY_1
{
Pos = MAP_APPFONT(COL2_X, ROW3_Y);
Size = MAP_APPFONT( COL2_WIDTH, ROW3_HEIGHT );
NoLabel = TRUE;
Text [ en-US ] = "1.";
- };
+ };
+
//spans col3 + col4
FixedText FT_LICENSE_BODY_1_TXT
{
@@ -211,14 +225,16 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Read the complete License Agreement. Use the scroll bar or the \'Scroll Down\' button in this dialog to view the entire license text.";
- };
+ };
+
FixedText FT_LICENSE_BODY_2
{
Pos = MAP_APPFONT(COL2_X, ROW4_Y);
Size = MAP_APPFONT(COL2_WIDTH, ROW4_HEIGHT);
NoLabel = TRUE;
Text [ en-US ] = "2.";
- };
+ };
+
FixedText FT_LICENSE_BODY_2_TXT
{
Pos = MAP_APPFONT(COL3_X, ROW4_Y);
@@ -226,22 +242,25 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Accept the License Agreement for the extension by pressing the \'Accept\' button.";
-
- };
+
+ };
+
PushButton PB_LICENSE_DOWN
{
+ HelpID = "desktop:PushButton:RID_DLG_LICENSE:PB_LICENSE_DOWN";
TabStop = TRUE ;
Pos = MAP_APPFONT(COL5_X , ROW3_Y) ;
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT) ;
Text [ en-US ] = "~Scroll Down";
-
+
};
+
FixedLine FL_LICENSE
{
Pos = MAP_APPFONT ( 0, ROW5_Y) ;
Size = MAP_APPFONT ( LIC_DLG_WIDTH, ROW5_HEIGHT ) ;
};
-
+
FixedImage FI_LICENSE_ARROW1
{
Pos = MAP_APPFONT (COL1_X, ROW3_Y) ;
@@ -263,13 +282,7 @@ ModalDialog RID_DLG_LICENSE
MASKCOLOR
};
};
-
- Image IMG_LICENCE_ARROW_HC
- {
- ImageBitmap = Bitmap { File = "sch06300.png"; };
- MASKCOLOR
- };
-
+
OKButton BTN_LICENSE_ACCEPT
{
Pos = MAP_APPFONT(COL4_X, ROW6_Y);
@@ -290,6 +303,35 @@ ModalDialog RID_DLG_LICENSE
};
+ModalDialog RID_DLG_SHOW_LICENSE
+{
+ Text [ en-US ] = "Extension Software License Agreement";
+ Size = MAP_APPFONT( 300, 200 );
+ OutputSize = TRUE;
+ SVLook = TRUE;
+ Moveable = TRUE;
+ Closeable = TRUE;
+ Sizeable = TRUE;
+
+ MultiLineEdit ML_LICENSE
+ {
+ Pos = MAP_APPFONT( 5, 5 );
+ Size = MAP_APPFONT( 300 - 10, 200 - 15 - RSC_CD_PUSHBUTTON_HEIGHT );
+ Border = TRUE;
+ VScroll = TRUE;
+ ReadOnly = TRUE;
+ };
+
+ OKButton RID_EM_BTN_CLOSE
+ {
+ TabStop = TRUE;
+ DefButton = TRUE;
+ Text [ en-US ] = "Close";
+ Pos = MAP_APPFONT( (300-RSC_CD_PUSHBUTTON_WIDTH)/2, 200 - 5 - RSC_CD_PUSHBUTTON_HEIGHT );
+ Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+};
+
WarningBox RID_WARNINGBOX_INSTALL_EXTENSION {
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 53628fb854..7aa8decb6f 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -40,8 +40,10 @@
#include "dp_gui_theextmgr.hxx"
#include "dp_gui_extensioncmdqueue.hxx"
#include "dp_misc.h"
+#include "dp_ucb.h"
#include "dp_update.hxx"
#include "dp_identifier.hxx"
+#include "dp_descriptioninfoset.hxx"
#include "vcl/ctrl.hxx"
#include "vcl/menu.hxx"
@@ -119,7 +121,8 @@ enum MENU_COMMAND
CMD_REMOVE = 1,
CMD_ENABLE,
CMD_DISABLE,
- CMD_UPDATE
+ CMD_UPDATE,
+ CMD_SHOW_LICENSE
};
class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
@@ -207,8 +210,6 @@ ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl()
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
const Size ExtBoxWithBtns_Impl::GetMinOutputSizePixel() const
{
Size aMinSize( ExtensionBox_Impl::GetMinOutputSizePixel() );
@@ -225,13 +226,10 @@ const Size ExtBoxWithBtns_Impl::GetMinOutputSizePixel() const
// -----------------------------------------------------------------------
void ExtBoxWithBtns_Impl::RecalcAll()
{
- ExtensionBox_Impl::RecalcAll();
-
const sal_Int32 nActive = getSelIndex();
if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- SetButtonPos( GetEntryRect( nActive ) );
SetButtonStatus( GetEntryData( nActive) );
}
else
@@ -240,6 +238,11 @@ void ExtBoxWithBtns_Impl::RecalcAll()
m_pEnableBtn->Hide();
m_pRemoveBtn->Hide();
}
+
+ ExtensionBox_Impl::RecalcAll();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ SetButtonPos( GetEntryRect( nActive ) );
}
@@ -364,28 +367,29 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse )
// -----------------------------------------------------------------------
MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
{
- if ( ( nPos >= 0 ) && ( nPos < (long) getItemCount() ) )
- {
- if ( ! GetEntryData( nPos )->m_bLocked )
- {
- PopupMenu aPopup;
+ if ( nPos >= (long) getItemCount() )
+ return CMD_NONE;
- aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
+ PopupMenu aPopup;
- if ( GetEntryData( nPos )->m_bUser )
- {
- if ( GetEntryData( nPos )->m_eState == REGISTERED )
- aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
- else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
- aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
- }
+ aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
- aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
-
- return (MENU_COMMAND) aPopup.Execute( this, rPos );
+ if ( ! GetEntryData( nPos )->m_bLocked )
+ {
+ if ( GetEntryData( nPos )->m_bUser )
+ {
+ if ( GetEntryData( nPos )->m_eState == REGISTERED )
+ aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
+ aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
}
+ aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
}
- return CMD_NONE;
+
+ if ( GetEntryData( nPos )->m_sLicenseText.Len() )
+ aPopup.InsertItem( CMD_SHOW_LICENSE, DialogHelper::getResourceString( RID_STR_SHOW_LICENSE_CMD ) );
+
+ return (MENU_COMMAND) aPopup.Execute( this, rPos );
}
//------------------------------------------------------------------------------
@@ -410,6 +414,12 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
break;
case CMD_REMOVE: m_pParent->removePackage( GetEntryData( nPos )->m_xPackage );
break;
+ case CMD_SHOW_LICENSE:
+ {
+ ShowLicenseDialog aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
+ aLicenseDlg.Execute();
+ break;
+ }
}
}
else if ( rMEvt.IsLeft() )
@@ -431,7 +441,7 @@ long ExtBoxWithBtns_Impl::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( nKeyCode == KEY_TAB )
bHandled = HandleTabKey( aKeyCode.IsShift() );
@@ -558,14 +568,14 @@ DialogHelper::~DialogHelper()
}
//------------------------------------------------------------------------------
-ResId DialogHelper::getResId( USHORT nId )
+ResId DialogHelper::getResId( sal_uInt16 nId )
{
const SolarMutexGuard guard;
return ResId( nId, *DeploymentGuiResMgr::get() );
}
//------------------------------------------------------------------------------
-String DialogHelper::getResourceString( USHORT id )
+String DialogHelper::getResourceString( sal_uInt16 id )
{
// init with non-acquired solar mutex:
BrandName::get();
@@ -589,7 +599,7 @@ bool DialogHelper::IsSharedPkgMgr( const uno::Reference< deployment::XPackage >
//------------------------------------------------------------------------------
bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::XPackage > &xPackage,
Window *pParent,
- const USHORT nResID,
+ const sal_uInt16 nResID,
bool &bHadWarning )
{
if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
@@ -658,8 +668,8 @@ bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
aQuery.SetMessText( sMsgText );
- USHORT nYesBtnID = aQuery.GetButtonId( 0 );
- USHORT nNoBtnID = aQuery.GetButtonId( 1 );
+ sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 );
+ sal_uInt16 nNoBtnID = aQuery.GetButtonId( 1 );
if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) );
@@ -929,7 +939,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
xFilterManager->appendFilter( iPos->first, iPos->second );
}
catch (lang::IllegalArgumentException & exc) {
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
(void) exc;
}
@@ -948,7 +958,6 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
//------------------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, HandleCancelBtn, void*, EMPTYARG )
{
- // m_dialog->m_cmdEnv->m_aborted = true;
if ( m_xAbortChannel.is() )
{
try
@@ -957,7 +966,7 @@ IMPL_LINK( ExtMgrDialog, HandleCancelBtn, void*, EMPTYARG )
}
catch ( uno::RuntimeException & )
{
- OSL_ENSURE( 0, "### unexpected RuntimeException!" );
+ OSL_FAIL( "### unexpected RuntimeException!" );
}
}
return 1;
@@ -1106,7 +1115,7 @@ IMPL_LINK( ExtMgrDialog, TimeOutHdl, Timer*, EMPTYARG )
}
if ( m_aProgressBar.IsVisible() )
- m_aProgressBar.SetValue( (USHORT) m_nProgress );
+ m_aProgressBar.SetValue( (sal_uInt16) m_nProgress );
m_aTimeoutTimer.Start();
}
@@ -1154,12 +1163,11 @@ void ExtMgrDialog::Resize()
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
- bool bNativeOK;
Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() );
Rectangle aNativeControlRegion, aNativeContentRegion;
- if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) != sal_False )
{
nProgressHeight = aNativeControlRegion.GetHeight();
}
@@ -1196,7 +1204,7 @@ long ExtMgrDialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( nKeyCode == KEY_TAB )
{
@@ -1223,7 +1231,7 @@ long ExtMgrDialog::Notify( NotifyEvent& rNEvt )
}
//------------------------------------------------------------------------------
-BOOL ExtMgrDialog::Close()
+sal_Bool ExtMgrDialog::Close()
{
bool bRet = m_pManager->queryTermination();
if ( bRet )
@@ -1364,7 +1372,6 @@ bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPac
//------------------------------------------------------------------------------
IMPL_LINK( UpdateRequiredDialog, HandleCancelBtn, void*, EMPTYARG )
{
- // m_dialog->m_cmdEnv->m_aborted = true;
if ( m_xAbortChannel.is() )
{
try
@@ -1373,7 +1380,7 @@ IMPL_LINK( UpdateRequiredDialog, HandleCancelBtn, void*, EMPTYARG )
}
catch ( uno::RuntimeException & )
{
- OSL_ENSURE( 0, "### unexpected RuntimeException!" );
+ OSL_FAIL( "### unexpected RuntimeException!" );
}
}
return 1;
@@ -1545,7 +1552,7 @@ IMPL_LINK( UpdateRequiredDialog, TimeOutHdl, Timer*, EMPTYARG )
}
if ( m_aProgressBar.IsVisible() )
- m_aProgressBar.SetValue( (USHORT) m_nProgress );
+ m_aProgressBar.SetValue( (sal_uInt16) m_nProgress );
m_aTimeoutTimer.Start();
}
@@ -1599,12 +1606,11 @@ void UpdateRequiredDialog::Resize()
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
- bool bNativeOK;
Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() );
Rectangle aNativeControlRegion, aNativeContentRegion;
- if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) != sal_False )
{
nProgressHeight = aNativeControlRegion.GetHeight();
}
@@ -1642,7 +1648,7 @@ short UpdateRequiredDialog::Execute()
//------------------------------------------------------------------------------
// VCL::Dialog
-BOOL UpdateRequiredDialog::Close()
+sal_Bool UpdateRequiredDialog::Close()
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -1682,7 +1688,7 @@ bool UpdateRequiredDialog::isEnabled( const uno::Reference< deployment::XPackage
catch ( uno::RuntimeException & ) { throw; }
catch ( uno::Exception & exc) {
(void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ OSL_FAIL( ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
bRegistered = false;
}
@@ -1748,6 +1754,42 @@ void UpdateRequiredDialog::disableAllEntries()
m_aCloseBtn.SetText( m_sCloseText );
}
+//------------------------------------------------------------------------------
+// ShowLicenseDialog
+//------------------------------------------------------------------------------
+ShowLicenseDialog::ShowLicenseDialog( Window * pParent,
+ const uno::Reference< deployment::XPackage > &xPackage ) :
+ ModalDialog( pParent, DialogHelper::getResId( RID_DLG_SHOW_LICENSE ) ),
+ m_aLicenseText( this, DialogHelper::getResId( ML_LICENSE ) ),
+ m_aCloseBtn( this, DialogHelper::getResId( RID_EM_BTN_CLOSE ) )
+{
+ FreeResource();
+
+ OUString aText = xPackage->getLicenseText();
+ m_aLicenseText.SetText( aText );
+}
+
+//------------------------------------------------------------------------------
+ShowLicenseDialog::~ShowLicenseDialog()
+{}
+
+//------------------------------------------------------------------------------
+void ShowLicenseDialog::Resize()
+{
+ Size aTotalSize( GetOutputSizePixel() );
+ Size aTextSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT,
+ aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_TOP - 2*RSC_SP_DLG_INNERBORDER_BOTTOM
+ - m_aCloseBtn.GetSizePixel().Height() );
+
+ m_aLicenseText.SetPosSizePixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ),
+ aTextSize );
+
+ Point aBtnPos( (aTotalSize.Width() - m_aCloseBtn.GetSizePixel().Width())/2,
+ aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_BOTTOM
+ - m_aCloseBtn.GetSizePixel().Height() );
+ m_aCloseBtn.SetPosPixel( aBtnPos );
+}
+
//=================================================================================
// UpdateRequiredDialogService
//=================================================================================
@@ -1778,8 +1820,6 @@ sal_Int16 UpdateRequiredDialogService::execute() throw ( uno::RuntimeException )
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
SelectedPackage::~SelectedPackage() {}
} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index bb8c9785d9..03b8839d23 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -36,6 +36,7 @@
#include "svtools/fixedhyper.hxx"
#include "svtools/prgsbar.hxx"
+#include "svtools/svmedit.hxx"
#include "osl/conditn.hxx"
#include "osl/mutex.hxx"
@@ -63,7 +64,7 @@ class DialogHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
Dialog* m_pVCLWindow;
- ULONG m_nEventID;
+ sal_uLong m_nEventID;
bool m_bIsBusy;
public:
@@ -88,12 +89,12 @@ public:
virtual void prepareChecking() = 0;
virtual void checkEntries() = 0;
- static ResId getResId( USHORT nId );
- static String getResourceString( USHORT id );
+ static ResId getResId( sal_uInt16 nId );
+ static String getResourceString( sal_uInt16 id );
static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &);
static bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
Window *pParent,
- const USHORT nResID,
+ const sal_uInt16 nResID,
bool &bHadWarning );
void setBusy( const bool bBusy ) { m_bIsBusy = bBusy; }
@@ -149,7 +150,7 @@ public:
virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual void showProgress( bool bStart );
virtual void updateProgress( const ::rtl::OUString &rText,
@@ -221,8 +222,7 @@ public:
virtual short Execute();
virtual void Resize();
- virtual BOOL Close();
-// virtual long Notify( NotifyEvent& rNEvt );
+ virtual sal_Bool Close();
virtual void showProgress( bool bStart );
virtual void updateProgress( const ::rtl::OUString &rText,
@@ -247,6 +247,20 @@ public:
};
//==============================================================================
+class ShowLicenseDialog : public ModalDialog
+{
+ MultiLineEdit m_aLicenseText;
+ OKButton m_aCloseBtn;
+
+public:
+ ShowLicenseDialog( Window * pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ virtual ~ShowLicenseDialog();
+
+ virtual void Resize();
+};
+
+//==============================================================================
class UpdateRequiredDialogService : public ::cppu::WeakImplHelper1< ::com::sun::star::ui::dialogs::XExecutableDialog >
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const m_xComponentContext;
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index b74a802ceb..296928abfb 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -43,6 +43,7 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER
PushButton RID_EM_BTN_ADD
{
+ HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_ADD";
TabStop = TRUE;
Text [ en-US ] = "~Add...";
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
@@ -50,6 +51,7 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER
PushButton RID_EM_BTN_CHECK_UPDATES
{
+ HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_CHECK_UPDATES";
TabStop = TRUE;
Text [ en-US ] = "Check for ~Updates...";
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
@@ -131,6 +133,7 @@ ModalDialog RID_DLG_UPDATE_REQUIRED
PushButton RID_EM_BTN_CHECK_UPDATES
{
+ HelpID = "desktop:PushButton:RID_DLG_UPDATE_REQUIRED:RID_EM_BTN_CHECK_UPDATES";
TabStop = TRUE;
Text [ en-US ] = "Check for ~Updates...";
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
@@ -138,6 +141,7 @@ ModalDialog RID_DLG_UPDATE_REQUIRED
PushButton RID_EM_BTN_CLOSE
{
+ HelpID = "desktop:PushButton:RID_DLG_UPDATE_REQUIRED:RID_EM_BTN_CLOSE";
TabStop = TRUE;
DefButton = TRUE;
Text [ en-US ] = "Disable all";
@@ -158,41 +162,21 @@ Image RID_IMG_WARNING
ImageBitmap = Bitmap { File = "caution_16.png"; };
};
-Image RID_IMG_WARNING_HC
-{
- ImageBitmap = Bitmap { File = "caution_16_h.png"; };
-};
-
Image RID_IMG_LOCKED
{
ImageBitmap = Bitmap { File = "lock_16.png"; };
};
-Image RID_IMG_LOCKED_HC
-{
- ImageBitmap = Bitmap { File = "lock_16_h.png"; };
-};
-
Image RID_IMG_SHARED
{
ImageBitmap = Bitmap { File = "shared_16.png"; };
};
-Image RID_IMG_SHARED_HC
-{
- ImageBitmap = Bitmap { File = "shared_16_h.png"; };
-};
-
Image RID_IMG_EXTENSION
{
ImageBitmap = Bitmap { File = "extension_32.png"; };
};
-Image RID_IMG_EXTENSION_HC
-{
- ImageBitmap = Bitmap { File = "extension_32_h.png"; };
-};
-
QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
{
Buttons = WB_YES_NO_CANCEL;
@@ -205,7 +189,7 @@ QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
// ---------------------------------------------------
// row 1 | multi line edit
// ---------------------------------------------------
-// row 2 | fixed text
+// row 2 | fixed text
// ---------------------------------------------------
// row 3 | img | fixed text | fixed text | button
// ----------------------------------------------------
@@ -213,7 +197,7 @@ QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
// ---------------------------------------------------
// row 5 |fixed line
// ---------------------------------------------------
-// row 6 | | |button | button
+// row 6 | | |button | button
// ---------------------------------------------------
// | col 1 | col 2 | col3 | col4 | col5
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 3674759f6f..973e430bd3 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -102,9 +102,10 @@
#endif
#ifdef WNT
-#include "tools/prewin.h"
+#define GradientStyle_RECT BLA_GradientStyle_RECT
+#include <windows.h>
#include <objbase.h>
-#include "tools/postwin.h"
+#undef GradientStyle_RECT
#endif
@@ -261,6 +262,8 @@ private:
virtual void execute();
virtual void SAL_CALL onTerminated();
+ void _insert(const TExtensionCmd& rExtCmd);
+
void _addExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const OUString &rPackageURL,
const OUString &rRepository,
@@ -648,57 +651,30 @@ void ExtensionCmdQueue::Thread::addExtension( const ::rtl::OUString &rExtensionU
const ::rtl::OUString &rRepository,
const bool bWarnUser )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not add the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rExtensionURL.getLength() )
{
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ADD, rExtensionURL, rRepository, bWarnUser ) );
-
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
}
//------------------------------------------------------------------------------
void ExtensionCmdQueue::Thread::removeExtension( const uno::Reference< deployment::XPackage > &rPackage )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not remove the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rPackage.is() )
{
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::REMOVE, rPackage ) );
-
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
}
//------------------------------------------------------------------------------
void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment::XPackage > &rPackage )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not remove the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rPackage.is() )
{
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ACCEPT_LICENSE, rPackage ) );
-
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
}
@@ -706,20 +682,12 @@ void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment:
void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not remove the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rPackage.is() )
{
TExtensionCmd pEntry( new ExtensionCmd( bEnable ? ExtensionCmd::ENABLE :
ExtensionCmd::DISABLE,
rPackage ) );
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
}
@@ -727,16 +695,8 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
void ExtensionCmdQueue::Thread::checkForUpdates(
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not update the extension -> game over!
- if ( m_bStopped )
- return;
-
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, vExtensionList ) );
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
//------------------------------------------------------------------------------
@@ -848,12 +808,6 @@ void ExtensionCmdQueue::Thread::execute()
break;
}
}
- //catch ( deployment::DeploymentException &)
- //{
- //}
- //catch ( lang::IllegalArgumentException &)
- //{
- //}
catch ( ucb::CommandAbortedException & )
{
//This exception is thrown when the user clicks cancel on the progressbar.
@@ -915,9 +869,6 @@ void ExtensionCmdQueue::Thread::execute()
currentCmdEnv->stopProgress();
}
//end for
- //enable all buttons
-// m_pDialog->m_bAddingExtensions = false;
-// m_pDialog->updateButtonStates();
#ifdef WNT
CoUninitialize();
#endif
@@ -944,7 +895,7 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
OUString sName;
if ( ! (anyTitle >>= sName) )
{
- OSL_ENSURE(0, "Could not get file name for extension.");
+ OSL_FAIL("Could not get file name for extension.");
return;
}
@@ -1013,13 +964,13 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
if ( ( pUpdateDialog->Execute() == RET_OK ) && !vData.empty() )
{
- // If there is at least one directly downloadable dialog then we
+ // If there is at least one directly downloadable extension then we
// open the install dialog.
::std::vector< UpdateData > dataDownload;
int countWebsiteDownload = 0;
typedef std::vector< dp_gui::UpdateData >::const_iterator cit;
- for ( cit i = vData.begin(); i < vData.end(); i++ )
+ for ( cit i = vData.begin(); i < vData.end(); ++i )
{
if ( i->sWebsiteURL.getLength() > 0 )
countWebsiteDownload ++;
@@ -1039,7 +990,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
//Now start the webbrowser and navigate to the websites where we get the updates
if ( RET_OK == nDialogResult )
{
- for ( cit i = vData.begin(); i < vData.end(); i++ )
+ for ( cit i = vData.begin(); i < vData.end(); ++i )
{
if ( m_pDialogHelper && ( i->sWebsiteURL.getLength() > 0 ) )
m_pDialogHelper->openWebBrowser( i->sWebsiteURL, m_pDialogHelper->getWindow()->GetText() );
@@ -1125,6 +1076,19 @@ void ExtensionCmdQueue::Thread::onTerminated()
m_bTerminated = true;
}
+void ExtensionCmdQueue::Thread::_insert(const TExtensionCmd& rExtCmd)
+{
+ ::osl::MutexGuard aGuard( m_mutex );
+
+ // If someone called stop then we do not process the command -> game over!
+ if ( m_bStopped )
+ return;
+
+ m_queue.push( rExtCmd );
+ m_eInput = START;
+ m_wakeup.set();
+}
+
//------------------------------------------------------------------------------
OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource,
const OUString &rWhat,
@@ -1147,8 +1111,6 @@ OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
ExtensionCmdQueue::ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > &rContext )
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 05511135e2..8cdf0a67e2 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -77,11 +77,12 @@ Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
m_sTitle = xPackage->getDisplayName();
m_sVersion = xPackage->getVersion();
m_sDescription = xPackage->getDescription();
+ m_sLicenseText = xPackage->getLicenseText();
beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
m_sPublisher = aInfo.First;
m_sPublisherURL = aInfo.Second;
-
+
// get the icons for the package if there are any
uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
if ( xGraphic.is() )
@@ -184,13 +185,9 @@ ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pMan
m_nActiveHeight( 0 ),
m_nExtraHeight( 2 ),
m_aSharedImage( DialogHelper::getResId( RID_IMG_SHARED ) ),
- m_aSharedImageHC( DialogHelper::getResId( RID_IMG_SHARED_HC ) ),
m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
- m_aLockedImageHC( DialogHelper::getResId( RID_IMG_LOCKED_HC ) ),
m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
- m_aWarningImageHC( DialogHelper::getResId( RID_IMG_WARNING_HC ) ),
m_aDefaultImage( DialogHelper::getResId( RID_IMG_EXTENSION ) ),
- m_aDefaultImageHC( DialogHelper::getResId( RID_IMG_EXTENSION_HC ) ),
m_pScrollBar( NULL ),
m_pManager( pManager )
{
@@ -334,7 +331,7 @@ void ExtensionBox_Impl::select( sal_Int32 nIndex )
{
const ::osl::MutexGuard aGuard( m_entriesMutex );
checkIndex( nIndex );
- selectEntry( nIndex );
+ selectEntry( nIndex );
}
//------------------------------------------------------------------------------
@@ -355,7 +352,6 @@ void ExtensionBox_Impl::select( const rtl::OUString & sName )
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
// Title + description
void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
{
@@ -455,10 +451,10 @@ void ExtensionBox_Impl::DeleteRemoved()
void ExtensionBox_Impl::selectEntry( const long nPos )
{
//ToDo whe should not use the guard at such a big scope here.
- //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
+ //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
//modified in this function.
//It would be probably best to always use a copy of m_vEntries
- //and some other state variables from ExtensionBox_Impl for
+ //and some other state variables from ExtensionBox_Impl for
//the whole painting operation. See issue i86993
::osl::ClearableMutexGuard guard(m_entriesMutex);
@@ -531,9 +527,9 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
aPos += Point( TOP_OFFSET, TOP_OFFSET );
Image aImage;
if ( ! pEntry->m_aIcon )
- aImage = isHCMode() ? m_aDefaultImageHC : m_aDefaultImage;
+ aImage = m_aDefaultImage;
else
- aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
+ aImage = pEntry->m_aIcon;
Size aImageSize = aImage.GetSizePixel();
if ( ( aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
DrawImage( Point( aPos.X()+((ICON_WIDTH-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
@@ -639,16 +635,16 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
{
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET );
if ( pEntry->m_bLocked )
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aLockedImageHC : m_aLockedImage );
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aLockedImage );
else
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aSharedImageHC : m_aSharedImage );
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aSharedImage );
}
if ( ( pEntry->m_eState == AMBIGUOUS ) || pEntry->m_bMissingDeps || pEntry->m_bMissingLic )
{
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2*SMALL_ICON_SIZE), TOP_OFFSET );
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aWarningImageHC : m_aWarningImage );
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aWarningImage );
}
-
+
SetLineColor( Color( COL_LIGHTGRAY ) );
DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
}
@@ -711,7 +707,7 @@ bool ExtensionBox_Impl::HandleTabKey( bool )
}
// -----------------------------------------------------------------------
-bool ExtensionBox_Impl::HandleCursorKey( USHORT nKeyCode )
+bool ExtensionBox_Impl::HandleCursorKey( sal_uInt16 nKeyCode )
{
if ( m_vEntries.empty() )
return true;
@@ -876,7 +872,7 @@ long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( nKeyCode == KEY_TAB )
bHandled = HandleTabKey( aKeyCode.IsShift() );
@@ -989,7 +985,7 @@ long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &
}
else if ( !m_bInCheckMode )
{
- OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
+ OSL_FAIL( "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
}
}
@@ -1062,7 +1058,7 @@ void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage
long nPos = iIndex - m_vEntries.begin();
// Entries mustn't removed here, because they contain a hyperlink control
- // which can only be deleted when the thread has the solar mutex. Therefor
+ // which can only be deleted when the thread has the solar mutex. Therefor
// the entry will be moved into the m_vRemovedEntries list which will be
// cleared on the next paint event
m_vRemovedEntries.push_back( *iIndex );
@@ -1154,7 +1150,7 @@ void ExtensionBox_Impl::checkEntries()
nNewPos = nPos;
if ( nPos <= m_nActive )
m_nActive += 1;
- iIndex++;
+ ++iIndex;
}
else
{ // remove entry from list
@@ -1168,7 +1164,7 @@ void ExtensionBox_Impl::checkEntries()
}
}
else
- iIndex++;
+ ++iIndex;
}
guard.clear();
@@ -1184,11 +1180,6 @@ void ExtensionBox_Impl::checkEntries()
Invalidate();
}
}
-//------------------------------------------------------------------------------
-bool ExtensionBox_Impl::isHCMode()
-{
- return (bool)GetSettings().GetStyleSettings().GetHighContrastMode();
-}
//------------------------------------------------------------------------------
void ExtensionBox_Impl::SetScrollHdl( const Link& rLink )
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 4726a0c9e2..9dbbb7d337 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -82,6 +82,7 @@ struct Entry_Impl
String m_sPublisher;
String m_sPublisherURL;
String m_sErrorText;
+ String m_sLicenseText;
Image m_aIcon;
Image m_aIconHC;
svt::FixedHyperlink *m_pPublisher;
@@ -137,22 +138,18 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
long m_nExtraHeight;
Size m_aOutputSize;
Image m_aSharedImage;
- Image m_aSharedImageHC;
Image m_aLockedImage;
- Image m_aLockedImageHC;
Image m_aWarningImage;
- Image m_aWarningImageHC;
Image m_aDefaultImage;
- Image m_aDefaultImageHC;
Link m_aClickHdl;
-
+
ScrollBar *m_pScrollBar;
com::sun::star::uno::Reference< ExtensionRemovedListener > m_xRemoveListener;
TheExtensionManager *m_pManager;
//This mutex is used for synchronizing access to m_vEntries.
- //Currently it is used to synchronize adding, removing entries and
+ //Currently it is used to synchronize adding, removing entries and
//functions like getItemName, getItemDescription, etc. to prevent
//that m_vEntries is accessed at an invalid index.
//ToDo: There are many more places where m_vEntries is read and which may
@@ -170,9 +167,8 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
void SetupScrollBar();
void DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry );
bool HandleTabKey( bool bReverse );
- bool HandleCursorKey( USHORT nKeyCode );
+ bool HandleCursorKey( sal_uInt16 nKeyCode );
bool FindEntryPos( const TEntry_Impl pEntry, long nStart, long nEnd, long &nFound );
- bool isHCMode();
void DeleteRemoved();
//-----------------
@@ -194,7 +190,7 @@ public:
const Size GetMinOutputSizePixel() const;
void SetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
- TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
+ TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
long GetEntryCount() { return (long) m_vEntries.size(); }
Rectangle GetEntryRect( const long nPos ) const;
bool HasActive() { return m_bHasActive; }
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index a01b8b309d..cf6dc14463 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -66,7 +66,7 @@ public:
virtual ~MyApp();
// Application
- virtual void Main();
+ virtual int Main();
};
//______________________________________________________________________________
@@ -80,11 +80,11 @@ MyApp::MyApp()
}
//______________________________________________________________________________
-void MyApp::Main()
+int MyApp::Main()
{
+ return EXIT_SUCCESS;
}
-//##############################################################################
namespace
{
@@ -357,14 +357,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return component_writeInfoHelper(
- pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx b/desktop/source/deployment/gui/dp_gui_shared.hxx
index af3a0bd5b9..dcee2863cd 100644
--- a/desktop/source/deployment/gui/dp_gui_shared.hxx
+++ b/desktop/source/deployment/gui/dp_gui_shared.hxx
@@ -55,7 +55,7 @@ struct BrandName : public ::rtl::StaticWithInit<const ::rtl::OUString, BrandName
class DpGuiResId : public ResId
{
public:
- DpGuiResId( USHORT nId ):ResId( nId, *DeploymentGuiResMgr::get() ) {}
+ DpGuiResId( sal_uInt16 nId ):ResId( nId, *DeploymentGuiResMgr::get() ) {}
};
} // namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_system.cxx b/desktop/source/deployment/gui/dp_gui_system.cxx
deleted file mode 100644
index 0e6416f161..0000000000
--- a/desktop/source/deployment/gui/dp_gui_system.cxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_desktop.hxx"
-
-#include "dp_gui_system.hxx"
-#ifdef WNT
-#define WIN32_LEAN_AND_MEAN
-#ifdef _MSC_VER
-#pragma warning(push,1) /* disable warnings within system headers */
-#endif
-#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-#endif
-
-namespace dp_gui {
-
-//We cannot distinguish Vista and 2008 Server
-bool isVista()
-{
-#ifdef WNT
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- return osvi.dwMajorVersion >= 6;
-#else
- return false;
-#endif
-}
-
-} //namespace dp_gui
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_system.hxx b/desktop/source/deployment/gui/dp_gui_system.hxx
deleted file mode 100644
index 8c8feb43cf..0000000000
--- a/desktop/source/deployment/gui/dp_gui_system.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_SYSTEM_HXX
-#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_SYSTEM_HXX
-
-
-/// @HTML
-namespace dp_gui {
-bool isVista();
-
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 564580c520..84e08cbe4e 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -166,7 +166,7 @@ void TheExtensionManager::SetText( const ::rtl::OUString &rTitle )
}
//------------------------------------------------------------------------------
-void TheExtensionManager::ToTop( USHORT nFlags )
+void TheExtensionManager::ToTop( sal_uInt16 nFlags )
{
const SolarMutexGuard guard;
@@ -361,7 +361,7 @@ PackageState TheExtensionManager::getPackageState( const uno::Reference< deploym
}
catch ( uno::Exception & exc) {
(void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ OSL_FAIL( ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
return NOT_AVAILABLE;
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 13ba06d0b3..6b1deb7ba9 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -87,7 +87,7 @@ public:
void SetText( const ::rtl::OUString &rTitle );
void Show();
- void ToTop( USHORT nFlags );
+ void ToTop( sal_uInt16 nFlags );
bool Close();
bool isVisible();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index 314f449358..3a43dce5d6 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
@@ -29,6 +29,7 @@
#define INCLUDED_DP_GUI_UPDATEDATA_HXX
#include "sal/config.h"
+#include "tools/solar.h"
#include "rtl/ustring.hxx"
#include "com/sun/star/uno/Reference.hxx"
@@ -81,6 +82,10 @@ struct UpdateData
//are to be ignored.
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage >
aUpdateSource;
+
+ // ID to find this entry in the update listbox
+ sal_uInt16 m_nID;
+ bool m_bIgnored;
};
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 91f1aff663..8b73e6bae8 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -44,14 +44,15 @@
#include "com/sun/star/awt/WindowAttribute.hpp"
#include "com/sun/star/awt/WindowClass.hpp"
#include "com/sun/star/awt/WindowDescriptor.hpp"
-#include "com/sun/star/awt/XThrobber.hpp"
#include "com/sun/star/awt/XToolkit.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/beans/Optional.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
#include "com/sun/star/deployment/DeploymentException.hpp"
#include "com/sun/star/deployment/UpdateInformationProvider.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
@@ -63,6 +64,7 @@
#include "com/sun/star/frame/XDispatchProvider.hpp"
#include "com/sun/star/lang/IllegalArgumentException.hpp"
#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
#include "com/sun/star/system/XSystemShellExecute.hpp"
#include "com/sun/star/task/XAbortChannel.hpp"
@@ -77,6 +79,7 @@
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/uno/XInterface.hpp"
#include "com/sun/star/util/URL.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
#include "com/sun/star/util/XURLTransformer.hpp"
#include "com/sun/star/xml/dom/XElement.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
@@ -121,7 +124,6 @@
#include "dp_gui_updatedata.hxx"
#include "dp_gui_updatedialog.hxx"
#include "dp_gui_shared.hxx"
-#include "dp_gui_system.hxx"
class KeyEvent;
class MouseEvent;
@@ -130,16 +132,23 @@ namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
} } } }
-namespace css = ::com::sun::star;
-
+using namespace ::com::sun::star;
using dp_gui::UpdateDialog;
namespace {
static sal_Unicode const LF = 0x000A;
static sal_Unicode const CR = 0x000D;
+static const sal_uInt16 CMD_ENABLE_UPDATE = 1;
+static const sal_uInt16 CMD_IGNORE_UPDATE = 2;
+static const sal_uInt16 CMD_IGNORE_ALL_UPDATES = 3;
+
+#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+
+#define IGNORED_UPDATES OUSTR("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates")
+#define PROPERTY_VERSION OUSTR("Version")
-enum Kind { ENABLED_UPDATE, DISABLED_UPDATE, GENERAL_ERROR, SPECIFIC_ERROR };
+enum Kind { ENABLED_UPDATE, DISABLED_UPDATE, SPECIFIC_ERROR };
rtl::OUString confineToParagraph(rtl::OUString const & text) {
// Confine arbitrary text to a single paragraph in a dp_gui::AutoScrollEdit.
@@ -152,86 +161,64 @@ rtl::OUString confineToParagraph(rtl::OUString const & text) {
struct UpdateDialog::DisabledUpdate {
rtl::OUString name;
- css::uno::Sequence< rtl::OUString > unsatisfiedDependencies;
+ uno::Sequence< rtl::OUString > unsatisfiedDependencies;
// We also want to show release notes and publisher for disabled updates
::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XNode > aUpdateInfo;
+ sal_uInt16 m_nID;
};
struct UpdateDialog::SpecificError {
rtl::OUString name;
rtl::OUString message;
+ sal_uInt16 m_nID;
};
-union UpdateDialog::IndexUnion{
- std::vector< dp_gui::UpdateData >::size_type enabledUpdate;
- std::vector< UpdateDialog::DisabledUpdate >::size_type disabledUpdate;
- std::vector< rtl::OUString >::size_type generalError;
- std::vector< UpdateDialog::SpecificError >::size_type specificError;
-};
-
-struct UpdateDialog::Index {
- static std::auto_ptr< UpdateDialog::Index const > newEnabledUpdate(
- std::vector< dp_gui::UpdateData >::size_type n);
-
- static std::auto_ptr< UpdateDialog::Index const > newDisabledUpdate(
- std::vector< UpdateDialog::DisabledUpdate >::size_type n);
+//------------------------------------------------------------------------------
+struct UpdateDialog::IgnoredUpdate {
+ rtl::OUString sExtensionID;
+ rtl::OUString sVersion;
+ bool bRemoved;
- static std::auto_ptr< UpdateDialog::Index const > newGeneralError(
- std::vector< rtl::OUString >::size_type n);
-
- static std::auto_ptr< UpdateDialog::Index const > newSpecificError(
- std::vector< UpdateDialog::SpecificError >::size_type n);
-
- Kind kind;
- IndexUnion index;
-
-private:
- explicit Index(Kind theKind);
+ IgnoredUpdate( const rtl::OUString &rExtensionID, const rtl::OUString &rVersion );
};
-std::auto_ptr< UpdateDialog::Index const >
-UpdateDialog::Index::newEnabledUpdate(
- std::vector< dp_gui::UpdateData >::size_type n)
-{
- UpdateDialog::Index * p = new UpdateDialog::Index(ENABLED_UPDATE);
- p->index.enabledUpdate = n;
- return std::auto_ptr< UpdateDialog::Index const >(p);
-}
-
-std::auto_ptr< UpdateDialog::Index const >
-UpdateDialog::Index::newDisabledUpdate(
- std::vector< UpdateDialog::DisabledUpdate >::size_type n)
-{
- UpdateDialog::Index * p = new UpdateDialog::Index(DISABLED_UPDATE);
- p->index.disabledUpdate = n;
- return std::auto_ptr< UpdateDialog::Index const >(p);
-}
+//------------------------------------------------------------------------------
+UpdateDialog::IgnoredUpdate::IgnoredUpdate( const rtl::OUString &rExtensionID, const rtl::OUString &rVersion ):
+ sExtensionID( rExtensionID ),
+ sVersion( rVersion ),
+ bRemoved( false )
+{}
-std::auto_ptr< UpdateDialog::Index const > UpdateDialog::Index::newGeneralError(
- std::vector< rtl::OUString >::size_type n)
+//------------------------------------------------------------------------------
+struct UpdateDialog::Index
{
- UpdateDialog::Index * p = new UpdateDialog::Index(GENERAL_ERROR);
- p->index.generalError = n;
- return std::auto_ptr< UpdateDialog::Index const >(p);
-}
+ Kind m_eKind;
+ bool m_bIgnored;
+ sal_uInt16 m_nID;
+ sal_uInt16 m_nIndex;
+ rtl::OUString m_aName;
-std::auto_ptr< UpdateDialog::Index const >
-UpdateDialog::Index::newSpecificError(
- std::vector< UpdateDialog::SpecificError >::size_type n)
-{
- UpdateDialog::Index * p = new UpdateDialog::Index(SPECIFIC_ERROR);
- p->index.specificError = n;
- return std::auto_ptr< UpdateDialog::Index const >(p);
-}
+ Index( Kind theKind, sal_uInt16 nID, sal_uInt16 nIndex, const rtl::OUString &rName );
+};
-UpdateDialog::Index::Index(Kind theKind): kind(theKind) {}
+//------------------------------------------------------------------------------
+UpdateDialog::Index::Index( Kind theKind, sal_uInt16 nID, sal_uInt16 nIndex, const rtl::OUString &rName ):
+ m_eKind( theKind ),
+ m_bIgnored( false ),
+ m_nID( nID ),
+ m_nIndex( nIndex ),
+ m_aName( rName )
+{}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
class UpdateDialog::Thread: public dp_gui::Thread {
public:
Thread(
- css::uno::Reference< css::uno::XComponentContext > const & context,
+ uno::Reference< uno::XComponentContext > const & context,
UpdateDialog & dialog,
- const std::vector< css::uno::Reference< css::deployment::XPackage > > & vExtensionList);
+ const std::vector< uno::Reference< deployment::XPackage > > & vExtensionList);
void stop();
@@ -239,43 +226,20 @@ private:
Thread(UpdateDialog::Thread &); // not defined
void operator =(UpdateDialog::Thread &); // not defined
- struct Entry {
- explicit Entry(
- css::uno::Reference< css::deployment::XPackage > const & thePackage,
- rtl::OUString const & theVersion);
-
- css::uno::Reference< css::deployment::XPackage > package;
- rtl::OUString version;
- //Indicates that the extension provides its own update URLs.
- //If this is true, then we must not use the default update
- //URL to find the update information.
- bool bProvidesOwnUpdate;
- css::uno::Reference< css::xml::dom::XNode > info;
- UpdateDialog::DisabledUpdate disableUpdate;
- dp_gui::UpdateData updateData;
- };
-
- // A multimap in case an extension is installed in "user", "shared" or "bundled"
- typedef std::map< rtl::OUString, Entry > Map;
-
virtual ~Thread();
virtual void execute();
void handleSpecificError(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Any const & exception) const;
+ uno::Reference< deployment::XPackage > const & package,
+ uno::Any const & exception) const;
- css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
+ uno::Sequence< uno::Reference< xml::dom::XElement > >
getUpdateInformation(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Sequence< rtl::OUString > const & urls,
+ uno::Reference< deployment::XPackage > const & package,
+ uno::Sequence< rtl::OUString > const & urls,
rtl::OUString const & identifier) const;
- void getOwnUpdateInformation(
- css::uno::Reference< css::deployment::XPackage > const & package,
- Map * map);
-
::rtl::OUString getUpdateDisplayString(
dp_gui::UpdateData const & data, ::rtl::OUString const & version = ::rtl::OUString()) const;
@@ -285,40 +249,40 @@ private:
dp_gui::UpdateData & out_data) const;
bool update(
- UpdateDialog::DisabledUpdate const & du,
- dp_gui::UpdateData const & data) const;
-
- css::uno::Reference< css::uno::XComponentContext > m_context;
+ UpdateDialog::DisabledUpdate & du,
+ dp_gui::UpdateData & data) const;
+
+ uno::Reference< uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
- std::vector< css::uno::Reference< css::deployment::XPackage > > m_vExtensionList;
- css::uno::Reference< css::deployment::XUpdateInformationProvider > m_updateInformation;
- css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHdl;
+ std::vector< uno::Reference< deployment::XPackage > > m_vExtensionList;
+ uno::Reference< deployment::XUpdateInformationProvider > m_updateInformation;
+ uno::Reference< task::XInteractionHandler > m_xInteractionHdl;
// guarded by Application::GetSolarMutex():
- css::uno::Reference< css::task::XAbortChannel > m_abort;
+ uno::Reference< task::XAbortChannel > m_abort;
bool m_stop;
};
UpdateDialog::Thread::Thread(
- css::uno::Reference< css::uno::XComponentContext > const & context,
+ uno::Reference< uno::XComponentContext > const & context,
UpdateDialog & dialog,
- const std::vector< css::uno::Reference< css::deployment::XPackage > > &vExtensionList):
+ const std::vector< uno::Reference< deployment::XPackage > > &vExtensionList):
m_context(context),
m_dialog(dialog),
m_vExtensionList(vExtensionList),
m_updateInformation(
- css::deployment::UpdateInformationProvider::create(context)),
+ deployment::UpdateInformationProvider::create(context)),
m_stop(false)
{
if( m_context.is() )
{
- css::uno::Reference< css::lang::XMultiComponentFactory > xServiceManager( m_context->getServiceManager() );
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( m_context->getServiceManager() );
if( xServiceManager.is() )
{
- m_xInteractionHdl = css::uno::Reference< css::task::XInteractionHandler > (
+ m_xInteractionHdl = uno::Reference< task::XInteractionHandler > (
xServiceManager->createInstanceWithContext( OUSTR( "com.sun.star.task.InteractionHandler" ), m_context),
- css::uno::UNO_QUERY );
+ uno::UNO_QUERY );
if ( m_xInteractionHdl.is() )
m_updateInformation->setInteractionHandler( m_xInteractionHdl );
}
@@ -326,7 +290,7 @@ UpdateDialog::Thread::Thread(
}
void UpdateDialog::Thread::stop() {
- css::uno::Reference< css::task::XAbortChannel > abort;
+ uno::Reference< task::XAbortChannel > abort;
{
SolarMutexGuard g;
abort = m_abort;
@@ -338,21 +302,10 @@ void UpdateDialog::Thread::stop() {
m_updateInformation->cancel();
}
-UpdateDialog::Thread::Entry::Entry(
- css::uno::Reference< css::deployment::XPackage > const & thePackage,
- rtl::OUString const & theVersion):
-
- package(thePackage),
- version(theVersion),
- bProvidesOwnUpdate(false),
- updateData(thePackage)
-{
-}
-
UpdateDialog::Thread::~Thread()
{
if ( m_xInteractionHdl.is() )
- m_updateInformation->setInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > () );
+ m_updateInformation->setInteractionHandler( uno::Reference< task::XInteractionHandler > () );
}
void UpdateDialog::Thread::execute()
@@ -363,20 +316,20 @@ void UpdateDialog::Thread::execute()
return;
}
}
- css::uno::Reference<css::deployment::XExtensionManager> extMgr =
- css::deployment::ExtensionManager::get(m_context);
+ uno::Reference<deployment::XExtensionManager> extMgr =
+ deployment::ExtensionManager::get(m_context);
- std::vector<std::pair<css::uno::Reference<css::deployment::XPackage>, css::uno::Any > > errors;
+ std::vector<std::pair<uno::Reference<deployment::XPackage>, uno::Any > > errors;
dp_misc::UpdateInfoMap updateInfoMap = dp_misc::getOnlineUpdateInfos(
m_context, extMgr, m_updateInformation, &m_vExtensionList, errors);
- typedef std::vector<std::pair<css::uno::Reference<css::deployment::XPackage>,
- css::uno::Any> >::const_iterator ITERROR;
- for (ITERROR ite = errors.begin(); ite != errors.end(); ite ++)
+ typedef std::vector<std::pair<uno::Reference<deployment::XPackage>,
+ uno::Any> >::const_iterator ITERROR;
+ for (ITERROR ite = errors.begin(); ite != errors.end(); ++ite )
handleSpecificError(ite->first, ite->second);
- for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); i++)
+ for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); ++i)
{
dp_misc::UpdateInfo const & info = i->second;
UpdateData updateData(info.extension);
@@ -391,13 +344,17 @@ void UpdateDialog::Thread::execute()
rtl::OUString sVersionUser;
rtl::OUString sVersionShared;
rtl::OUString sVersionBundled;
- css::uno::Sequence< css::uno::Reference< css::deployment::XPackage> > extensions;
+ uno::Sequence< uno::Reference< deployment::XPackage> > extensions;
try {
extensions = extMgr->getExtensionsWithSameIdentifier(
dp_misc::getIdentifier(info.extension), info.extension->getName(),
- css::uno::Reference<css::ucb::XCommandEnvironment>());
- } catch (css::lang::IllegalArgumentException& ) {
+ uno::Reference<ucb::XCommandEnvironment>());
+ } catch (lang::IllegalArgumentException& ) {
OSL_ASSERT(0);
+ continue;
+ } catch (css::ucb::CommandFailedException& ) {
+ OSL_ASSERT(0);
+ continue;
}
OSL_ASSERT(extensions.getLength() == 3);
if (extensions[0].is() )
@@ -414,7 +371,7 @@ void UpdateDialog::Thread::execute()
dp_misc::UPDATE_SOURCE sourceShared = dp_misc::isUpdateSharedExtension(
bSharedReadOnly, sVersionShared, sVersionBundled, sOnlineVersion);
- css::uno::Reference<css::deployment::XPackage> updateSource;
+ uno::Reference<deployment::XPackage> updateSource;
if (sourceUser != dp_misc::UPDATE_SOURCE_NONE)
{
if (sourceUser == dp_misc::UPDATE_SOURCE_SHARED)
@@ -453,13 +410,13 @@ void UpdateDialog::Thread::execute()
//Parameter package can be null
void UpdateDialog::Thread::handleSpecificError(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Any const & exception) const
+ uno::Reference< deployment::XPackage > const & package,
+ uno::Any const & exception) const
{
UpdateDialog::SpecificError data;
if (package.is())
data.name = package->getDisplayName();
- css::uno::Exception e;
+ uno::Exception e;
if (exception >>= e) {
data.message = e.Message;
}
@@ -501,7 +458,7 @@ void UpdateDialog::Thread::handleSpecificError(
/** out_data will only be filled if all dependencies are ok.
*/
void UpdateDialog::Thread::prepareUpdateData(
- css::uno::Reference< css::xml::dom::XNode > const & updateInfo,
+ uno::Reference< xml::dom::XNode > const & updateInfo,
UpdateDialog::DisabledUpdate & out_du,
dp_gui::UpdateData & out_data) const
{
@@ -509,7 +466,7 @@ void UpdateDialog::Thread::prepareUpdateData(
return;
dp_misc::DescriptionInfoset infoset(m_context, updateInfo);
OSL_ASSERT(infoset.getVersion().getLength() != 0);
- css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > ds(
+ uno::Sequence< uno::Reference< xml::dom::XElement > > ds(
dp_misc::Dependencies::check(infoset));
out_du.aUpdateInfo = updateInfo;
@@ -532,8 +489,8 @@ void UpdateDialog::Thread::prepareUpdateData(
}
bool UpdateDialog::Thread::update(
- UpdateDialog::DisabledUpdate const & du,
- dp_gui::UpdateData const & data) const
+ UpdateDialog::DisabledUpdate & du,
+ dp_gui::UpdateData & data) const
{
bool ret = false;
if (du.unsatisfiedDependencies.getLength() == 0)
@@ -555,18 +512,18 @@ bool UpdateDialog::Thread::update(
// UpdateDialog ----------------------------------------------------------
UpdateDialog::UpdateDialog(
- css::uno::Reference< css::uno::XComponentContext > const & context,
+ uno::Reference< uno::XComponentContext > const & context,
Window * parent,
- const std::vector<css::uno::Reference< css::deployment::XPackage > > &vExtensionList,
+ const std::vector<uno::Reference< deployment::XPackage > > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData):
ModalDialog(parent,DpGuiResId(RID_DLG_UPDATE)),
m_context(context),
m_checking(this, DpGuiResId(RID_DLG_UPDATE_CHECKING)),
+ m_throbber(this, DpGuiResId(RID_DLG_UPDATE_THROBBER)),
m_update(this, DpGuiResId(RID_DLG_UPDATE_UPDATE)),
m_updates(
*this, DpGuiResId(RID_DLG_UPDATE_UPDATES),
- Image(DpGuiResId(RID_DLG_UPDATE_NORMALALERT)),
- Image(DpGuiResId(RID_DLG_UPDATE_HIGHCONTRASTALERT))),
+ Image(DpGuiResId(RID_DLG_UPDATE_NORMALALERT))),
m_all(this, DpGuiResId(RID_DLG_UPDATE_ALL)),
m_description(this, DpGuiResId(RID_DLG_UPDATE_DESCRIPTION)),
m_PublisherLabel(this, DpGuiResId(RID_DLG_UPDATE_PUBLISHER_LABEL)),
@@ -577,7 +534,7 @@ UpdateDialog::UpdateDialog(
m_line(this, DpGuiResId(RID_DLG_UPDATE_LINE)),
m_help(this, DpGuiResId(RID_DLG_UPDATE_HELP)),
m_ok(this, DpGuiResId(RID_DLG_UPDATE_OK)),
- m_cancel(this, DpGuiResId(RID_DLG_UPDATE_CANCEL)),
+ m_close(this, DpGuiResId(RID_DLG_UPDATE_CLOSE)),
m_error(String(DpGuiResId(RID_DLG_UPDATE_ERROR))),
m_none(String(DpGuiResId(RID_DLG_UPDATE_NONE))),
m_noInstallable(String(DpGuiResId(RID_DLG_UPDATE_NOINSTALLABLE))),
@@ -589,105 +546,116 @@ UpdateDialog::UpdateDialog(
m_noDependencyCurVer(String(DpGuiResId(RID_DLG_UPDATE_NODEPENDENCY_CUR_VER))),
m_browserbased(String(DpGuiResId(RID_DLG_UPDATE_BROWSERBASED))),
m_version(String(DpGuiResId(RID_DLG_UPDATE_VERSION))),
+ m_ignoredUpdate(String(DpGuiResId(RID_DLG_UPDATE_IGNORED_UPDATE))),
m_updateData(*updateData),
m_thread(
new UpdateDialog::Thread(
context, *this, vExtensionList)),
m_nFirstLineDelta(0),
- m_nOneLineMissing(0)
+ m_nOneLineMissing(0),
+ m_nLastID(1),
+ m_bModified( false )
// TODO: check!
// ,
// m_extensionManagerDialog(extensionManagerDialog)
{
OSL_ASSERT(updateData != NULL);
- m_xExtensionManager = css::deployment::ExtensionManager::get( context );
+ m_xExtensionManager = deployment::ExtensionManager::get( context );
- css::uno::Reference< css::awt::XToolkit > toolkit;
+ uno::Reference< awt::XToolkit > toolkit;
try {
- toolkit = css::uno::Reference< css::awt::XToolkit >(
- (css::uno::Reference< css::lang::XMultiComponentFactory >(
+ toolkit = uno::Reference< awt::XToolkit >(
+ (uno::Reference< lang::XMultiComponentFactory >(
m_context->getServiceManager(),
- css::uno::UNO_QUERY_THROW)->
+ uno::UNO_QUERY_THROW)->
createInstanceWithContext(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
m_context)),
- css::uno::UNO_QUERY_THROW);
- } catch (css::uno::RuntimeException &) {
+ uno::UNO_QUERY_THROW);
+ } catch (uno::RuntimeException &) {
throw;
- } catch (css::uno::Exception & e) {
- throw css::uno::RuntimeException(e.Message, e.Context);
- }
- Control c(this, DpGuiResId(RID_DLG_UPDATE_THROBBER));
- Point pos(c.GetPosPixel());
- Size size(c.GetSizePixel());
- try {
- m_throbber = css::uno::Reference< css::awt::XThrobber >(
- toolkit->createWindow(
- css::awt::WindowDescriptor(
- css::awt::WindowClass_SIMPLE,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")),
- GetComponentInterface(), 0,
- css::awt::Rectangle(
- pos.X(), pos.Y(), size.Width(), size.Height()),
- css::awt::WindowAttribute::SHOW)),
- css::uno::UNO_QUERY_THROW);
- } catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(e.Message, e.Context);
+ } catch (uno::Exception & e) {
+ throw uno::RuntimeException(e.Message, e.Context);
}
m_updates.SetSelectHdl(LINK(this, UpdateDialog, selectionHandler));
m_all.SetToggleHdl(LINK(this, UpdateDialog, allHandler));
m_ok.SetClickHdl(LINK(this, UpdateDialog, okHandler));
- m_cancel.SetClickHdl(LINK(this, UpdateDialog, cancelHandler));
+ m_close.SetClickHdl(LINK(this, UpdateDialog, closeHandler));
if ( ! dp_misc::office_is_running())
m_help.Disable();
FreeResource();
initDescription();
+ getIgnoredUpdates();
}
-UpdateDialog::~UpdateDialog() {
- for (USHORT i = 0; i < m_updates.getItemCount(); ++i) {
- delete static_cast< UpdateDialog::Index const * >(
- m_updates.GetEntryData(i));
+//------------------------------------------------------------------------------
+UpdateDialog::~UpdateDialog()
+{
+ storeIgnoredUpdates();
+
+ for ( std::vector< UpdateDialog::Index* >::iterator i( m_ListboxEntries.begin() ); i != m_ListboxEntries.end(); ++i )
+ {
+ delete (*i);
+ }
+ for ( std::vector< UpdateDialog::IgnoredUpdate* >::iterator i( m_ignoredUpdates.begin() ); i != m_ignoredUpdates.end(); ++i )
+ {
+ delete (*i);
}
}
-BOOL UpdateDialog::Close() {
+//------------------------------------------------------------------------------
+sal_Bool UpdateDialog::Close() {
m_thread->stop();
return ModalDialog::Close();
}
short UpdateDialog::Execute() {
- m_throbber->start();
+ m_throbber.start();
m_thread->launch();
return ModalDialog::Execute();
}
-UpdateDialog::CheckListBox::CheckListBox(
- UpdateDialog & dialog, ResId const & resource,
- Image const & normalStaticImage, Image const & highContrastStaticImage):
- SvxCheckListBox(
- &dialog, resource, normalStaticImage, highContrastStaticImage),
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+UpdateDialog::CheckListBox::CheckListBox( UpdateDialog & dialog, ResId const & resource,
+ Image const & normalStaticImage ):
+ SvxCheckListBox( &dialog, resource, normalStaticImage ),
+ m_ignoreUpdate( String( DpGuiResId( RID_DLG_UPDATE_IGNORE ) ) ),
+ m_ignoreAllUpdates( String( DpGuiResId( RID_DLG_UPDATE_IGNORE_ALL ) ) ),
+ m_enableUpdate( String( DpGuiResId( RID_DLG_UPDATE_ENABLE ) ) ),
m_dialog(dialog)
{}
+//------------------------------------------------------------------------------
UpdateDialog::CheckListBox::~CheckListBox() {}
-USHORT UpdateDialog::CheckListBox::getItemCount() const {
- ULONG i = GetEntryCount();
- OSL_ASSERT(i <= std::numeric_limits< USHORT >::max());
- return sal::static_int_cast< USHORT >(i);
+//------------------------------------------------------------------------------
+sal_uInt16 UpdateDialog::CheckListBox::getItemCount() const {
+ sal_uLong i = GetEntryCount();
+ OSL_ASSERT(i <= std::numeric_limits< sal_uInt16 >::max());
+ return sal::static_int_cast< sal_uInt16 >(i);
}
-void UpdateDialog::CheckListBox::MouseButtonDown(MouseEvent const & event) {
+//------------------------------------------------------------------------------
+void UpdateDialog::CheckListBox::MouseButtonDown( MouseEvent const & event )
+{
// When clicking on a selected entry in an SvxCheckListBox, the entry's
// checkbox is toggled on mouse button down:
- SvxCheckListBox::MouseButtonDown(event);
+ SvxCheckListBox::MouseButtonDown( event );
+
+ if ( event.IsRight() )
+ {
+ handlePopupMenu( event.GetPosPixel() );
+ }
+
m_dialog.enableOk();
}
+//------------------------------------------------------------------------------
void UpdateDialog::CheckListBox::MouseButtonUp(MouseEvent const & event) {
// When clicking on an entry's checkbox in an SvxCheckListBox, the entry's
// checkbox is toggled on mouse button up:
@@ -700,25 +668,82 @@ void UpdateDialog::CheckListBox::KeyInput(KeyEvent const & event) {
m_dialog.enableOk();
}
-void UpdateDialog::insertItem(
- rtl::OUString const & name, USHORT position,
- std::auto_ptr< UpdateDialog::Index const > index, SvLBoxButtonKind kind)
+//------------------------------------------------------------------------------
+void UpdateDialog::CheckListBox::handlePopupMenu( const Point &rPos )
{
- m_updates.InsertEntry(
- name, position,
- const_cast< void * >(static_cast< void const * >(index.release())),
- kind);
- //TODO #i72487#: UpdateDialog::Index potentially leaks as the exception
- // behavior of SvxCheckListBox::InsertEntry is unspecified
+ SvListEntry *pData = GetEntry( rPos );
+
+ if ( pData )
+ {
+ sal_uInt16 nEntryPos = GetSelectEntryPos();
+ UpdateDialog::Index * p = static_cast< UpdateDialog::Index * >( GetEntryData( nEntryPos ) );
+
+ if ( ( p->m_eKind == ENABLED_UPDATE ) || ( p->m_eKind == DISABLED_UPDATE ) )
+ {
+ PopupMenu aPopup;
+
+ if ( p->m_bIgnored )
+ aPopup.InsertItem( CMD_ENABLE_UPDATE, m_enableUpdate );
+ else
+ {
+ aPopup.InsertItem( CMD_IGNORE_UPDATE, m_ignoreUpdate );
+ aPopup.InsertItem( CMD_IGNORE_ALL_UPDATES, m_ignoreAllUpdates );
+ }
+
+ sal_uInt16 aCmd = aPopup.Execute( this, rPos );
+ if ( ( aCmd == CMD_IGNORE_UPDATE ) || ( aCmd == CMD_IGNORE_ALL_UPDATES ) )
+ {
+ p->m_bIgnored = true;
+ if ( p->m_eKind == ENABLED_UPDATE )
+ {
+ RemoveEntry( nEntryPos );
+ m_dialog.addAdditional( p, SvLBoxButtonKind_disabledCheckbox );
+ }
+ if ( aCmd == CMD_IGNORE_UPDATE )
+ m_dialog.setIgnoredUpdate( p, true, false );
+ else
+ m_dialog.setIgnoredUpdate( p, true, true );
+ // TODO: reselect entry to display new description!
+ }
+ else if ( aCmd == CMD_ENABLE_UPDATE )
+ {
+ p->m_bIgnored = false;
+ if ( p->m_eKind == ENABLED_UPDATE )
+ {
+ RemoveEntry( nEntryPos );
+ m_dialog.insertItem( p, SvLBoxButtonKind_enabledCheckbox );
+ }
+ m_dialog.setIgnoredUpdate( p, false, false );
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+sal_uInt16 UpdateDialog::insertItem( UpdateDialog::Index *pEntry, SvLBoxButtonKind kind )
+{
+ m_updates.InsertEntry( pEntry->m_aName, LISTBOX_APPEND, static_cast< void * >( pEntry ), kind );
+
+ for ( sal_uInt16 i = m_updates.getItemCount(); i != 0 ; )
+ {
+ i -= 1;
+ UpdateDialog::Index const * p = static_cast< UpdateDialog::Index const * >( m_updates.GetEntryData( i ) );
+ if ( p == pEntry )
+ return i;
+ }
+ OSL_ASSERT(0);
+ return 0;
}
-void UpdateDialog::addAdditional(
- rtl::OUString const & name, USHORT position,
- std::auto_ptr< UpdateDialog::Index const > index, SvLBoxButtonKind kind)
+//------------------------------------------------------------------------------
+void UpdateDialog::addAdditional( UpdateDialog::Index * index, SvLBoxButtonKind kind )
{
m_all.Enable();
- if (m_all.IsChecked()) {
- insertItem(name, position, index, kind);
+ if (m_all.IsChecked())
+ {
+ insertItem( index, kind );
m_update.Enable();
m_updates.Enable();
m_description.Enable();
@@ -726,60 +751,80 @@ void UpdateDialog::addAdditional(
}
}
-void UpdateDialog::addEnabledUpdate(
- rtl::OUString const & name, dp_gui::UpdateData const & data)
+//------------------------------------------------------------------------------
+void UpdateDialog::addEnabledUpdate( rtl::OUString const & name,
+ dp_gui::UpdateData & data )
{
- std::vector< dp_gui::UpdateData >::size_type n = m_enabledUpdates.size();
- m_enabledUpdates.push_back(data);
- insertItem(
- name, sal::static_int_cast< USHORT >(n),
- UpdateDialog::Index::newEnabledUpdate(n),
- SvLBoxButtonKind_enabledCheckbox);
- // position overflow is rather harmless
- m_updates.CheckEntryPos(sal::static_int_cast< USHORT >(n));
- //TODO #i72487#: fragile computation; insertItem should instead return
- // pos
+ sal_uInt16 nIndex = sal::static_int_cast< sal_uInt16 >( m_enabledUpdates.size() );
+ UpdateDialog::Index *pEntry = new UpdateDialog::Index( ENABLED_UPDATE, m_nLastID, nIndex, name );
+
+ data.m_nID = m_nLastID;
+ m_nLastID += 1;
+
+ m_enabledUpdates.push_back( data );
+ m_ListboxEntries.push_back( pEntry );
+
+ if ( ! isIgnoredUpdate( pEntry ) )
+ {
+ sal_uInt16 nPos = insertItem( pEntry, SvLBoxButtonKind_enabledCheckbox );
+ m_updates.CheckEntryPos( nPos );
+ }
+ else
+ addAdditional( pEntry, SvLBoxButtonKind_disabledCheckbox );
+
m_update.Enable();
m_updates.Enable();
m_description.Enable();
m_descriptions.Enable();
}
-void UpdateDialog::addDisabledUpdate(UpdateDialog::DisabledUpdate const & data)
+//------------------------------------------------------------------------------
+void UpdateDialog::addDisabledUpdate( UpdateDialog::DisabledUpdate & data )
{
- std::vector< UpdateDialog::DisabledUpdate >::size_type n =
- m_disabledUpdates.size();
- m_disabledUpdates.push_back(data);
- addAdditional(
- data.name, sal::static_int_cast< USHORT >(m_enabledUpdates.size() + n),
- UpdateDialog::Index::newDisabledUpdate(n),
- SvLBoxButtonKind_disabledCheckbox);
- // position overflow is rather harmless
+ sal_uInt16 nIndex = sal::static_int_cast< sal_uInt16 >( m_disabledUpdates.size() );
+ UpdateDialog::Index *pEntry = new UpdateDialog::Index( DISABLED_UPDATE, m_nLastID, nIndex, data.name );
+
+ data.m_nID = m_nLastID;
+ m_nLastID += 1;
+
+ m_disabledUpdates.push_back( data );
+ m_ListboxEntries.push_back( pEntry );
+
+ isIgnoredUpdate( pEntry );
+ addAdditional( pEntry, SvLBoxButtonKind_disabledCheckbox );
}
-void UpdateDialog::addSpecificError(UpdateDialog::SpecificError const & data) {
- std::vector< UpdateDialog::SpecificError >::size_type n =
- m_specificErrors.size();
- m_specificErrors.push_back(data);
- addAdditional(
- data.name, LISTBOX_APPEND, UpdateDialog::Index::newSpecificError(n),
- SvLBoxButtonKind_staticImage);
+//------------------------------------------------------------------------------
+void UpdateDialog::addSpecificError( UpdateDialog::SpecificError & data )
+{
+ sal_uInt16 nIndex = sal::static_int_cast< sal_uInt16 >( m_specificErrors.size() );
+ UpdateDialog::Index *pEntry = new UpdateDialog::Index( DISABLED_UPDATE, m_nLastID, nIndex, data.name );
+
+ data.m_nID = m_nLastID;
+ m_nLastID += 1;
+
+ m_specificErrors.push_back( data );
+ m_ListboxEntries.push_back( pEntry );
+
+ addAdditional( pEntry, SvLBoxButtonKind_staticImage);
}
void UpdateDialog::checkingDone() {
m_checking.Hide();
- m_throbber->stop();
- css::uno::Reference< css::awt::XWindow >(
- m_throbber, css::uno::UNO_QUERY_THROW)->setVisible(false);
+ m_throbber.stop();
+ m_throbber.Hide();
if (m_updates.getItemCount() == 0)
{
clearDescription();
m_description.Enable();
m_descriptions.Enable();
- showDescription(
- ( m_disabledUpdates.empty() && m_generalErrors.empty() && m_specificErrors.empty() )
- ? m_none : m_noInstallable, false );
+
+ if ( m_disabledUpdates.empty() && m_specificErrors.empty() && m_ignoredUpdates.empty() )
+ showDescription( m_none, false );
+ else
+ showDescription( m_noInstallable, false );
}
+
enableOk();
}
@@ -791,7 +836,7 @@ void UpdateDialog::enableOk() {
// *********************************************************************************
void UpdateDialog::createNotifyJob( bool bPrepareOnly,
- css::uno::Sequence< css::uno::Sequence< rtl::OUString > > &rItemList )
+ uno::Sequence< uno::Sequence< rtl::OUString > > &rItemList )
{
if ( !dp_misc::office_is_running() )
return;
@@ -799,51 +844,51 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
// notify update check job
try
{
- css::uno::Reference< css::lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider(
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
xFactory->createInstance( OUSTR( "com.sun.star.configuration.ConfigurationProvider" )),
- css::uno::UNO_QUERY_THROW);
+ uno::UNO_QUERY_THROW);
- css::beans::PropertyValue aProperty;
+ beans::PropertyValue aProperty;
aProperty.Name = OUSTR( "nodepath" );
- aProperty.Value = css::uno::makeAny( OUSTR("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
+ aProperty.Value = uno::makeAny( OUSTR("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
- css::uno::Sequence< css::uno::Any > aArgumentList( 1 );
- aArgumentList[0] = css::uno::makeAny( aProperty );
+ uno::Sequence< uno::Any > aArgumentList( 1 );
+ aArgumentList[0] = uno::makeAny( aProperty );
- css::uno::Reference< css::container::XNameAccess > xNameAccess(
+ uno::Reference< container::XNameAccess > xNameAccess(
xConfigProvider->createInstanceWithArguments(
OUSTR("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ),
- css::uno::UNO_QUERY_THROW );
+ uno::UNO_QUERY_THROW );
- css::util::URL aURL;
+ util::URL aURL;
xNameAccess->getByName(OUSTR("URL")) >>= aURL.Complete;
- css::uno::Reference < css::util::XURLTransformer > xTransformer( xFactory->createInstance( OUSTR( "com.sun.star.util.URLTransformer" ) ),
- css::uno::UNO_QUERY_THROW );
+ uno::Reference < util::XURLTransformer > xTransformer( xFactory->createInstance( OUSTR( "com.sun.star.util.URLTransformer" ) ),
+ uno::UNO_QUERY_THROW );
xTransformer->parseStrict(aURL);
- css::uno::Reference < css::frame::XDesktop > xDesktop( xFactory->createInstance( OUSTR( "com.sun.star.frame.Desktop" ) ),
- css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xDesktop->getCurrentFrame(),
- css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL, rtl::OUString(), 0);
+ uno::Reference < frame::XDesktop > xDesktop( xFactory->createInstance( OUSTR( "com.sun.star.frame.Desktop" ) ),
+ uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDispatchProvider > xDispatchProvider( xDesktop->getCurrentFrame(),
+ uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL, rtl::OUString(), 0);
if( xDispatch.is() )
{
- css::uno::Sequence< css::beans::PropertyValue > aPropList(2);
+ uno::Sequence< beans::PropertyValue > aPropList(2);
aProperty.Name = OUSTR( "updateList" );
- aProperty.Value = css::uno::makeAny( rItemList );
+ aProperty.Value = uno::makeAny( rItemList );
aPropList[0] = aProperty;
aProperty.Name = OUSTR( "prepareOnly" );
- aProperty.Value = css::uno::makeAny( bPrepareOnly );
+ aProperty.Value = uno::makeAny( bPrepareOnly );
aPropList[1] = aProperty;
xDispatch->dispatch(aURL, aPropList );
}
}
- catch( const css::uno::Exception& e )
+ catch( const uno::Exception& e )
{
dp_misc::TRACE( OUSTR("Caught exception: ")
+ e.Message + OUSTR("\n thread terminated.\n\n"));
@@ -856,26 +901,26 @@ void UpdateDialog::notifyMenubar( bool bPrepareOnly, bool bRecheckOnly )
if ( !dp_misc::office_is_running() )
return;
- css::uno::Sequence< css::uno::Sequence< rtl::OUString > > aItemList;
- sal_Int32 nCount = 0;
+ uno::Sequence< uno::Sequence< rtl::OUString > > aItemList;
if ( ! bRecheckOnly )
{
+ sal_Int32 nCount = 0;
for ( sal_Int16 i = 0; i < m_updates.getItemCount(); ++i )
{
- css::uno::Sequence< rtl::OUString > aItem(2);
+ uno::Sequence< rtl::OUString > aItem(2);
UpdateDialog::Index const * p = static_cast< UpdateDialog::Index const * >(m_updates.GetEntryData(i));
- if ( p->kind == ENABLED_UPDATE )
+ if ( p->m_eKind == ENABLED_UPDATE )
{
- dp_gui::UpdateData aUpdData = m_enabledUpdates[ p->index.enabledUpdate ];
+ dp_gui::UpdateData aUpdData = m_enabledUpdates[ p->m_nIndex ];
aItem[0] = dp_misc::getIdentifier( aUpdData.aInstalledPackage );
dp_misc::DescriptionInfoset aInfoset( m_context, aUpdData.aUpdateInfo );
aItem[1] = aInfoset.getVersion();
}
- else if ( p->kind == DISABLED_UPDATE )
+ else if ( p->m_eKind == DISABLED_UPDATE )
continue;
else
continue;
@@ -885,6 +930,8 @@ void UpdateDialog::notifyMenubar( bool bPrepareOnly, bool bRecheckOnly )
nCount += 1;
}
}
+
+ storeIgnoredUpdates();
createNotifyJob( bPrepareOnly, aItemList );
}
@@ -958,17 +1005,17 @@ void UpdateDialog::clearDescription()
m_descriptions.SetPosSizePixel( m_aFirstLinePos, m_aFirstLineSize );
}
-bool UpdateDialog::showDescription(css::uno::Reference< css::xml::dom::XNode > const & aUpdateInfo)
+bool UpdateDialog::showDescription(uno::Reference< xml::dom::XNode > const & aUpdateInfo)
{
dp_misc::DescriptionInfoset infoset(m_context, aUpdateInfo);
return showDescription(infoset.getLocalizedPublisherNameAndURL(),
infoset.getLocalizedReleaseNotesURL());
}
-bool UpdateDialog::showDescription(css::uno::Reference< css::deployment::XPackage > const & aExtension)
+bool UpdateDialog::showDescription(uno::Reference< deployment::XPackage > const & aExtension)
{
OSL_ASSERT(aExtension.is());
- css::beans::StringPair pubInfo = aExtension->getPublisherInfo();
+ beans::StringPair pubInfo = aExtension->getPublisherInfo();
return showDescription(std::make_pair(pubInfo.First, pubInfo.Second),
OUSTR(""));
}
@@ -1031,16 +1078,163 @@ bool UpdateDialog::showDescription( const String& rDescription, bool bWithPublis
return true;
}
-bool UpdateDialog::isReadOnly( const css::uno::Reference< css::deployment::XPackage > &xPackage ) const
+//------------------------------------------------------------------------------
+void UpdateDialog::getIgnoredUpdates()
{
- if ( m_xExtensionManager.is() && xPackage.is() )
+ uno::Reference< lang::XMultiServiceFactory > xConfig( m_context->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.configuration.ConfigurationProvider"), m_context ), uno::UNO_QUERY_THROW);
+ beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
+ uno::Sequence< uno::Any > args(1);
+ args[0] <<= aValue;
+
+ uno::Reference< container::XNameAccess > xNameAccess( xConfig->createInstanceWithArguments( OUSTR("com.sun.star.configuration.ConfigurationAccess"), args), uno::UNO_QUERY_THROW );
+ uno::Sequence< rtl::OUString > aElementNames = xNameAccess->getElementNames();
+
+ for ( sal_Int32 i = 0; i < aElementNames.getLength(); i++ )
{
- return m_xExtensionManager->isReadOnlyRepository( xPackage->getRepositoryName() );
+ ::rtl::OUString aIdentifier = aElementNames[i];
+ ::rtl::OUString aVersion;
+
+ uno::Any aPropValue( uno::Reference< beans::XPropertySet >( xNameAccess->getByName( aIdentifier ), uno::UNO_QUERY_THROW )->getPropertyValue( PROPERTY_VERSION ) );
+ aPropValue >>= aVersion;
+ IgnoredUpdate *pData = new IgnoredUpdate( aIdentifier, aVersion );
+ m_ignoredUpdates.push_back( pData );
+ }
+}
+
+//------------------------------------------------------------------------------
+void UpdateDialog::storeIgnoredUpdates()
+{
+ if ( m_bModified && ( m_ignoredUpdates.size() != 0 ) )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xConfig( m_context->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.configuration.ConfigurationProvider"), m_context ), uno::UNO_QUERY_THROW );
+ beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
+ uno::Sequence< uno::Any > args(1);
+ args[0] <<= aValue;
+
+ uno::Reference< container::XNameContainer > xNameContainer( xConfig->createInstanceWithArguments(
+ OUSTR("com.sun.star.configuration.ConfigurationUpdateAccess"), args ), uno::UNO_QUERY_THROW );
+
+ for ( std::vector< UpdateDialog::IgnoredUpdate* >::iterator i( m_ignoredUpdates.begin() ); i != m_ignoredUpdates.end(); ++i )
+ {
+ if ( xNameContainer->hasByName( (*i)->sExtensionID ) )
+ {
+ if ( (*i)->bRemoved )
+ xNameContainer->removeByName( (*i)->sExtensionID );
+ else
+ uno::Reference< beans::XPropertySet >( xNameContainer->getByName( (*i)->sExtensionID ), uno::UNO_QUERY_THROW )->setPropertyValue( PROPERTY_VERSION, uno::Any( (*i)->sVersion ) );
+ }
+ else if ( ! (*i)->bRemoved )
+ {
+ uno::Reference< beans::XPropertySet > elem( uno::Reference< lang::XSingleServiceFactory >( xNameContainer, uno::UNO_QUERY_THROW )->createInstance(), uno::UNO_QUERY_THROW );
+ elem->setPropertyValue( PROPERTY_VERSION, uno::Any( (*i)->sVersion ) );
+ xNameContainer->insertByName( (*i)->sExtensionID, uno::Any( elem ) );
+ }
+ }
+
+ uno::Reference< util::XChangesBatch > xChangesBatch( xNameContainer, uno::UNO_QUERY );
+ if ( xChangesBatch.is() && xChangesBatch->hasPendingChanges() )
+ xChangesBatch->commitChanges();
+ }
+
+ m_bModified = false;
+}
+
+//------------------------------------------------------------------------------
+bool UpdateDialog::isIgnoredUpdate( UpdateDialog::Index * index )
+{
+ bool bIsIgnored = false;
+
+ if ( m_ignoredUpdates.size() != 0 )
+ {
+ rtl::OUString aExtensionID;
+ rtl::OUString aVersion;
+
+ if ( index->m_eKind == ENABLED_UPDATE )
+ {
+ dp_gui::UpdateData aUpdData = m_enabledUpdates[ index->m_nIndex ];
+ aExtensionID = dp_misc::getIdentifier( aUpdData.aInstalledPackage );
+ aVersion = aUpdData.updateVersion;
+ }
+ else if ( index->m_eKind == DISABLED_UPDATE )
+ {
+ DisabledUpdate &rData = m_disabledUpdates[ index->m_nIndex ];
+ dp_misc::DescriptionInfoset aInfoset( m_context, rData.aUpdateInfo );
+ ::boost::optional< ::rtl::OUString > aID( aInfoset.getIdentifier() );
+ if ( aID )
+ aExtensionID = *aID;
+ aVersion = aInfoset.getVersion();
+ }
+
+ for ( std::vector< UpdateDialog::IgnoredUpdate* >::iterator i( m_ignoredUpdates.begin() ); i != m_ignoredUpdates.end(); ++i )
+ {
+ if ( (*i)->sExtensionID == aExtensionID )
+ {
+ if ( ( (*i)->sVersion.getLength() == 0 ) || ( (*i)->sVersion == aVersion ) )
+ {
+ bIsIgnored = true;
+ index->m_bIgnored = true;
+ }
+ else // when we find another update of an ignored version, we will remove the old one to keep the ignored list small
+ (*i)->bRemoved = true;
+ break;
+ }
+ }
+ }
+
+ return bIsIgnored;
+}
+
+//------------------------------------------------------------------------------
+void UpdateDialog::setIgnoredUpdate( UpdateDialog::Index *pIndex, bool bIgnore, bool bIgnoreAll )
+{
+ rtl::OUString aExtensionID;
+ rtl::OUString aVersion;
+
+ m_bModified = true;
+
+ if ( pIndex->m_eKind == ENABLED_UPDATE )
+ {
+ dp_gui::UpdateData aUpdData = m_enabledUpdates[ pIndex->m_nIndex ];
+ aExtensionID = dp_misc::getIdentifier( aUpdData.aInstalledPackage );
+ if ( !bIgnoreAll )
+ aVersion = aUpdData.updateVersion;
+ }
+ else if ( pIndex->m_eKind == DISABLED_UPDATE )
+ {
+ DisabledUpdate &rData = m_disabledUpdates[ pIndex->m_nIndex ];
+ dp_misc::DescriptionInfoset aInfoset( m_context, rData.aUpdateInfo );
+ ::boost::optional< ::rtl::OUString > aID( aInfoset.getIdentifier() );
+ if ( aID )
+ aExtensionID = *aID;
+ if ( !bIgnoreAll )
+ aVersion = aInfoset.getVersion();
+ }
+
+ if ( aExtensionID.getLength() )
+ {
+ bool bFound = false;
+ for ( std::vector< UpdateDialog::IgnoredUpdate* >::iterator i( m_ignoredUpdates.begin() ); i != m_ignoredUpdates.end(); ++i )
+ {
+ if ( (*i)->sExtensionID == aExtensionID )
+ {
+ (*i)->sVersion = aVersion;
+ (*i)->bRemoved = !bIgnore;
+ bFound = true;
+ break;
+ }
+ }
+ if ( bIgnore && !bFound )
+ {
+ IgnoredUpdate *pData = new IgnoredUpdate( aExtensionID, aVersion );
+ m_ignoredUpdates.push_back( pData );
+ }
}
- else
- return true;
}
+//------------------------------------------------------------------------------
+
IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
{
rtl::OUStringBuffer b;
@@ -1049,42 +1243,37 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
m_updates.GetEntryData(m_updates.GetSelectEntryPos()));
clearDescription();
- if (p != NULL)
+ if ( p != NULL )
{
- //When the index is greater or equal than the amount of enabled updates then the "Show all"
- //button is probably checked. Then we show first all enabled and then the disabled
- //updates.
- USHORT pos = m_updates.GetSelectEntryPos();
- const std::vector< dp_gui::UpdateData >::size_type sizeEnabled =
- m_enabledUpdates.size();
- const std::vector< UpdateDialog::DisabledUpdate >::size_type sizeDisabled =
- m_disabledUpdates.size();
- if (pos < sizeEnabled)
- {
- if (m_enabledUpdates[pos].aUpdateSource.is())
- bInserted = showDescription(m_enabledUpdates[pos].aUpdateSource);
- else
- bInserted = showDescription(m_enabledUpdates[pos].aUpdateInfo);
- }
- else if (pos >= sizeEnabled
- && pos < (sizeEnabled + sizeDisabled))
- bInserted = showDescription(m_disabledUpdates[pos - sizeEnabled].aUpdateInfo);
+ sal_uInt16 pos = p->m_nIndex;
- switch (p->kind)
+ switch (p->m_eKind)
{
case ENABLED_UPDATE:
{
- b.append(m_noDescription);
+ if ( m_enabledUpdates[ pos ].aUpdateSource.is() )
+ bInserted = showDescription( m_enabledUpdates[ pos ].aUpdateSource );
+ else
+ bInserted = showDescription( m_enabledUpdates[ pos ].aUpdateInfo );
+
+ if ( p->m_bIgnored )
+ b.append( m_ignoredUpdate );
+
break;
}
case DISABLED_UPDATE:
{
- UpdateDialog::DisabledUpdate & data = m_disabledUpdates[
- p->index.disabledUpdate];
+ bInserted = showDescription( m_disabledUpdates[pos].aUpdateInfo );
+
+ if ( p->m_bIgnored )
+ b.append( m_ignoredUpdate );
+
+ UpdateDialog::DisabledUpdate & data = m_disabledUpdates[ pos ];
if (data.unsatisfiedDependencies.getLength() != 0)
{
// create error string for version mismatch
::rtl::OUString sVersion( RTL_CONSTASCII_USTRINGPARAM("%VERSION") );
+ ::rtl::OUString sProductName( RTL_CONSTASCII_USTRINGPARAM("%PRODUCTNAME") );
sal_Int32 nPos = m_noDependencyCurVer.indexOf( sVersion );
if ( nPos >= 0 )
{
@@ -1092,7 +1281,17 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
::rtl::Bootstrap::expandMacros(sCurVersion);
m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sVersion.getLength(), sCurVersion );
}
-
+ nPos = m_noDependencyCurVer.indexOf( sProductName );
+ if ( nPos >= 0 )
+ {
+ m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sProductName.getLength(), BrandName::get() );
+ }
+ nPos = m_noDependency.indexOf( sProductName );
+ if ( nPos >= 0 )
+ {
+ m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), BrandName::get() );
+ }
+
b.append(m_noInstall);
b.append(LF);
b.append(m_noDependency);
@@ -1113,23 +1312,12 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
}
break;
}
- case GENERAL_ERROR:
- {
- rtl::OUString & msg = m_generalErrors[p->index.generalError];
- b.append(m_failure);
- b.append(LF);
- b.append(msg.getLength() == 0 ? m_unknownError : msg);
- break;
- }
case SPECIFIC_ERROR:
{
- UpdateDialog::SpecificError & data = m_specificErrors[
- p->index.specificError];
+ UpdateDialog::SpecificError & data = m_specificErrors[ pos ];
b.append(m_failure);
b.append(LF);
- b.append(
- data.message.getLength() == 0
- ? m_unknownError : data.message);
+ b.append( data.message.getLength() == 0 ? m_unknownError : data.message );
break;
}
default:
@@ -1138,56 +1326,37 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
}
}
+ if ( b.getLength() == 0 )
+ b.append( m_noDescription );
+
showDescription( b.makeStringAndClear(), bInserted );
return 0;
}
-IMPL_LINK(UpdateDialog, allHandler, void *, EMPTYARG) {
- if (m_all.IsChecked()) {
+IMPL_LINK(UpdateDialog, allHandler, void *, EMPTYARG)
+{
+ if (m_all.IsChecked())
+ {
m_update.Enable();
m_updates.Enable();
m_description.Enable();
m_descriptions.Enable();
- std::vector< UpdateDialog::DisabledUpdate >::size_type n1 = 0;
- for (std::vector< UpdateDialog::DisabledUpdate >::iterator i(
- m_disabledUpdates.begin());
- i != m_disabledUpdates.end(); ++i)
- {
- insertItem(
- i->name, LISTBOX_APPEND,
- UpdateDialog::Index::newDisabledUpdate(n1++),
- SvLBoxButtonKind_disabledCheckbox);
- }
- std::vector< rtl::OUString >::size_type n2 = 0;
- for (std::vector< rtl::OUString >::iterator i(m_generalErrors.begin());
- i != m_generalErrors.end(); ++i)
+
+ for (std::vector< UpdateDialog::Index* >::iterator i( m_ListboxEntries.begin() );
+ i != m_ListboxEntries.end(); ++i )
{
- insertItem(
- m_error, LISTBOX_APPEND,
- UpdateDialog::Index::newGeneralError(n2++),
- SvLBoxButtonKind_staticImage);
+ if ( (*i)->m_bIgnored || ( (*i)->m_eKind != ENABLED_UPDATE ) )
+ insertItem( (*i), SvLBoxButtonKind_disabledCheckbox );
}
- std::vector< UpdateDialog::SpecificError >::size_type n3 = 0;
- for (std::vector< UpdateDialog::SpecificError >::iterator i(
- m_specificErrors.begin());
- i != m_specificErrors.end(); ++i)
+ }
+ else
+ {
+ for ( sal_uInt16 i = 0; i < m_updates.getItemCount(); )
{
- insertItem(
- i->name, LISTBOX_APPEND,
- UpdateDialog::Index::newSpecificError(n3++),
- SvLBoxButtonKind_staticImage);
- }
- } else {
- for (USHORT i = 0; i < m_updates.getItemCount();) {
- UpdateDialog::Index const * p =
- static_cast< UpdateDialog::Index const * >(
- m_updates.GetEntryData(i));
- if (p->kind != ENABLED_UPDATE) {
+ UpdateDialog::Index const * p = static_cast< UpdateDialog::Index const * >( m_updates.GetEntryData(i) );
+ if ( p->m_bIgnored || ( p->m_eKind != ENABLED_UPDATE ) )
+ {
m_updates.RemoveEntry(i);
- //TODO #i72487#: UpdateDialog::Index potentially leaks as
- // SvxCheckListBox::RemoveEntry's exception behavior is
- // unspecified
- delete p;
} else {
++i;
}
@@ -1217,16 +1386,15 @@ IMPL_LINK(UpdateDialog, okHandler, void *, EMPTYARG)
OSL_ASSERT(i->aInstalledPackage.is());
//If the user has no write access to the shared folder then the update
//for a shared extension is disable, that is it cannot be in m_enabledUpdates
-// OSL_ASSERT(isReadOnly(i->aInstalledPackage) == sal_False);
}
- for (USHORT i = 0; i < m_updates.getItemCount(); ++i) {
+ for (sal_uInt16 i = 0; i < m_updates.getItemCount(); ++i) {
UpdateDialog::Index const * p =
static_cast< UpdateDialog::Index const * >(
m_updates.GetEntryData(i));
- if (p->kind == ENABLED_UPDATE && m_updates.IsChecked(i)) {
- m_updateData.push_back(m_enabledUpdates[p->index.enabledUpdate]);
+ if (p->m_eKind == ENABLED_UPDATE && m_updates.IsChecked(i)) {
+ m_updateData.push_back( m_enabledUpdates[ p->m_nIndex ] );
}
}
@@ -1234,7 +1402,7 @@ IMPL_LINK(UpdateDialog, okHandler, void *, EMPTYARG)
return 0;
}
-IMPL_LINK(UpdateDialog, cancelHandler, void *, EMPTYARG) {
+IMPL_LINK(UpdateDialog, closeHandler, void *, EMPTYARG) {
m_thread->stop();
EndDialog(RET_CANCEL);
return 0;
@@ -1250,15 +1418,15 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
try
{
- css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute(
+ uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
m_context->getServiceManager()->createInstanceWithContext(
OUSTR( "com.sun.star.system.SystemShellExecute" ),
- m_context), css::uno::UNO_QUERY_THROW);
- //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
+ m_context), uno::UNO_QUERY_THROW);
+ //throws lang::IllegalArgumentException, system::SystemShellExecuteException
xSystemShellExecute->execute(
- sURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS);
+ sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS);
}
- catch (css::uno::Exception& )
+ catch (uno::Exception& )
{
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index a9a8bcf716..d8fc455600 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -45,6 +45,7 @@
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
#include <svtools/fixedhyper.hxx>
+#include <vcl/throbber.hxx>
#include "descedit.hxx"
#include "dp_gui_updatedata.hxx"
@@ -58,7 +59,6 @@ class ResId;
class Window;
namespace com { namespace sun { namespace star {
- namespace awt { class XThrobber; }
namespace deployment { class XExtensionManager;
class XPackage; }
namespace uno { class XComponentContext; }
@@ -97,7 +97,7 @@ public:
~UpdateDialog();
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual short Execute();
@@ -111,8 +111,7 @@ private:
struct DisabledUpdate;
struct SpecificError;
- union IndexUnion;
- friend union IndexUnion;
+ struct IgnoredUpdate;
struct Index;
friend struct Index;
class Thread;
@@ -122,49 +121,47 @@ private:
public:
CheckListBox(
UpdateDialog & dialog, ResId const & resource,
- Image const & normalStaticImage,
- Image const & highContrastStaticImage);
+ Image const & normalStaticImage);
virtual ~CheckListBox();
- USHORT getItemCount() const;
+ sal_uInt16 getItemCount() const;
private:
CheckListBox(UpdateDialog::CheckListBox &); // not defined
void operator =(UpdateDialog::CheckListBox &); // not defined
virtual void MouseButtonDown(MouseEvent const & event);
-
virtual void MouseButtonUp(MouseEvent const & event);
-
virtual void KeyInput(KeyEvent const & event);
+ void handlePopupMenu( const Point &rPos );
+
+ rtl::OUString m_ignoreUpdate;
+ rtl::OUString m_ignoreAllUpdates;
+ rtl::OUString m_enableUpdate;
UpdateDialog & m_dialog;
};
friend class CheckListBox;
- void insertItem(
- rtl::OUString const & name, USHORT position,
- std::auto_ptr< UpdateDialog::Index const > index,
- SvLBoxButtonKind kind);
+ sal_uInt16 insertItem( UpdateDialog::Index *pIndex, SvLBoxButtonKind kind );
+ void addAdditional( UpdateDialog::Index *pIndex, SvLBoxButtonKind kind );
+ bool isIgnoredUpdate( UpdateDialog::Index *pIndex );
+ void setIgnoredUpdate( UpdateDialog::Index *pIndex, bool bIgnore, bool bIgnoreAll );
- void addAdditional(
- rtl::OUString const & name, USHORT position,
- std::auto_ptr< UpdateDialog::Index const > index,
- SvLBoxButtonKind kind);
-
- void addEnabledUpdate(
- rtl::OUString const & name, dp_gui::UpdateData const & data);
-
- void addDisabledUpdate(UpdateDialog::DisabledUpdate const & data);
- void addSpecificError(UpdateDialog::SpecificError const & data);
+ void addEnabledUpdate( rtl::OUString const & name, dp_gui::UpdateData & data );
+ void addDisabledUpdate( UpdateDialog::DisabledUpdate & data );
+ void addSpecificError( UpdateDialog::SpecificError & data );
void checkingDone();
void enableOk();
+ void getIgnoredUpdates();
+ void storeIgnoredUpdates();
+
void initDescription();
void clearDescription();
bool showDescription(::com::sun::star::uno::Reference<
@@ -179,13 +176,13 @@ private:
DECL_LINK(selectionHandler, void *);
DECL_LINK(allHandler, void *);
DECL_LINK(okHandler, void *);
- DECL_LINK(cancelHandler, void *);
+ DECL_LINK(closeHandler, void *);
DECL_LINK(hyperlink_clicked, svt::FixedHyperlink *);
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
m_context;
FixedText m_checking;
- com::sun::star::uno::Reference< com::sun::star::awt::XThrobber > m_throbber;
+ Throbber m_throbber;
FixedText m_update;
UpdateDialog::CheckListBox m_updates;
CheckBox m_all;
@@ -198,7 +195,7 @@ private:
FixedLine m_line;
HelpButton m_help;
PushButton m_ok;
- CancelButton m_cancel;
+ PushButton m_close;
rtl::OUString m_error;
rtl::OUString m_none;
rtl::OUString m_noInstallable;
@@ -210,18 +207,22 @@ private:
rtl::OUString m_noDependencyCurVer;
rtl::OUString m_browserbased;
rtl::OUString m_version;
+ rtl::OUString m_ignoredUpdate;
std::vector< dp_gui::UpdateData > m_enabledUpdates;
std::vector< UpdateDialog::DisabledUpdate > m_disabledUpdates;
- std::vector< rtl::OUString > m_generalErrors;
std::vector< UpdateDialog::SpecificError > m_specificErrors;
+ std::vector< UpdateDialog::IgnoredUpdate* > m_ignoredUpdates;
+ std::vector< Index* > m_ListboxEntries;
std::vector< dp_gui::UpdateData > & m_updateData;
rtl::Reference< UpdateDialog::Thread > m_thread;
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
- Point m_aFirstLinePos;
- Size m_aFirstLineSize;
- long m_nFirstLineDelta;
- long m_nOneLineMissing;
+ Point m_aFirstLinePos;
+ Size m_aFirstLineSize;
+ long m_nFirstLineDelta;
+ long m_nOneLineMissing;
+ sal_uInt16 m_nLastID;
+ bool m_bModified;
};
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src
index 59539d55c1..c8f7a26c1e 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src
@@ -60,11 +60,11 @@ ModalDialog RID_DLG_UPDATE {
Right = TRUE;
NoLabel = TRUE;
};
- Control RID_DLG_UPDATE_THROBBER {
+ FixedImage RID_DLG_UPDATE_THROBBER {
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH - RSC_CD_FIXEDTEXT_HEIGHT,
RSC_SP_DLG_INNERBORDER_TOP);
- Size = MAP_APPFONT(RSC_CD_FIXEDTEXT_HEIGHT, RSC_CD_FIXEDTEXT_HEIGHT);
+ Size = MAP_APPFONT(RSC_CD_FIXEDTEXT_HEIGHT, RSC_CD_FIXEDTEXT_HEIGHT + 1);
};
FixedText RID_DLG_UPDATE_UPDATE {
Disable = TRUE;
@@ -86,6 +86,7 @@ ModalDialog RID_DLG_UPDATE {
TabStop = TRUE;
};
CheckBox RID_DLG_UPDATE_ALL {
+ HelpID = "desktop:CheckBox:RID_DLG_UPDATE:RID_DLG_UPDATE_ALL";
Disable = TRUE;
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT,
@@ -150,6 +151,7 @@ ModalDialog RID_DLG_UPDATE {
Text[en-US] = "Release Notes";
};
MultiLineEdit RID_DLG_UPDATE_DESCRIPTIONS {
+ HelpID = "desktop:MultiLineEdit:RID_DLG_UPDATE:RID_DLG_UPDATE_DESCRIPTIONS";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT(
@@ -183,6 +185,7 @@ ModalDialog RID_DLG_UPDATE {
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT);
};
PushButton RID_DLG_UPDATE_OK {
+ HelpID = "desktop:PushButton:RID_DLG_UPDATE:RID_DLG_UPDATE_OK";
Disable = TRUE;
Pos = MAP_APPFONT(
(RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH - RSC_CD_PUSHBUTTON_WIDTH -
@@ -196,7 +199,7 @@ ModalDialog RID_DLG_UPDATE {
Text[en-US] = "~Install";
DefButton = TRUE;
};
- CancelButton RID_DLG_UPDATE_CANCEL {
+ PushButton RID_DLG_UPDATE_CLOSE {
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH - RSC_CD_PUSHBUTTON_WIDTH,
(RSC_SP_DLG_INNERBORDER_TOP + RSC_CD_FIXEDTEXT_HEIGHT +
@@ -205,6 +208,7 @@ ModalDialog RID_DLG_UPDATE {
RSC_SP_CTRL_DESC_Y + LOCAL_LIST_HEIGHT2 + RSC_SP_FLGR_SPACE_Y +
RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_SPACE_Y));
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT);
+ Text[en-US] = "Close";
};
Image RID_DLG_UPDATE_NORMALALERT {
@@ -212,11 +216,6 @@ ModalDialog RID_DLG_UPDATE {
File = "caution_12.png";
};
};
- Image RID_DLG_UPDATE_HIGHCONTRASTALERT {
- ImageBitmap = Bitmap {
- File = "caution_12_h.png";
- };
- };
String RID_DLG_UPDATE_ERROR {
Text[en-US] = "Error";
};
@@ -224,7 +223,7 @@ ModalDialog RID_DLG_UPDATE {
Text[en-US] = "No new updates are available.";
};
String RID_DLG_UPDATE_NOINSTALLABLE {
- Text[en-US] = "No installable updates are available. To see all updates, mark the check box 'Show all updates'.";
+ Text[en-US] = "No installable updates are available. To see ignored or disabled updates, mark the check box 'Show all updates'.";
};
String RID_DLG_UPDATE_FAILURE {
Text[en-US] = "An error occurred:";
@@ -233,24 +232,35 @@ ModalDialog RID_DLG_UPDATE {
Text[en-US] = "Unknown error.";
};
String RID_DLG_UPDATE_NODESCRIPTION {
- Text[en-US] = "No descriptions available for this extension.";
+ Text[en-US] = "No more details are available for this update.";
};
String RID_DLG_UPDATE_NOINSTALL {
Text[en-US] = "The extension cannot be updated because:";
};
String RID_DLG_UPDATE_NODEPENDENCY {
- Text[en-US] = "Required OpenOffice.org version doesn't match:";
+ Text[en-US] = "Required %PRODUCTNAME version doesn't match:";
};
String RID_DLG_UPDATE_NODEPENDENCY_CUR_VER {
- Text[en-US] = "You have OpenOffice.org %VERSION";
+ Text[en-US] = "You have %PRODUCTNAME %VERSION";
};
String RID_DLG_UPDATE_BROWSERBASED {
Text[en-US] = "browser based update";
};
-
String RID_DLG_UPDATE_VERSION {
Text[en-US] = "Version";
};
+ String RID_DLG_UPDATE_IGNORE {
+ Text[en-US] = "Ignore this Update";
+ };
+ String RID_DLG_UPDATE_IGNORE_ALL {
+ Text[en-US] = "Ignore all Updates";
+ };
+ String RID_DLG_UPDATE_ENABLE {
+ Text[en-US] = "Enable Updates";
+ };
+ String RID_DLG_UPDATE_IGNORED_UPDATE {
+ Text[en-US] = "This update will be ignored.\n";
+ };
};
WarningBox RID_WARNINGBOX_UPDATE_SHARED_EXTENSION
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index cfc42aa8d8..ad2baa5d6a 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -262,14 +262,14 @@ UpdateInstallDialog::UpdateInstallDialog(
m_xExtensionManager = css::deployment::ExtensionManager::get( xCtx );
m_cancel.SetClickHdl(LINK(this, UpdateInstallDialog, cancelHandler));
- m_mle_info.EnableCursor(FALSE);
+ m_mle_info.EnableCursor(sal_False);
if ( ! dp_misc::office_is_running())
m_help.Disable();
}
UpdateInstallDialog::~UpdateInstallDialog() {}
-BOOL UpdateInstallDialog::Close()
+sal_Bool UpdateInstallDialog::Close()
{
m_thread->stop();
return ModalDialog::Close();
@@ -377,7 +377,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
sal_uInt16 count = 0;
typedef std::vector<UpdateData>::iterator It;
- for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); i++)
+ for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); ++i)
{
UpdateData & curData = *i;
@@ -471,7 +471,7 @@ void UpdateInstallDialog::Thread::installExtensions()
sal_uInt16 count = 0;
typedef std::vector<UpdateData>::iterator It;
- for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); i++, count++)
+ for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); ++i, ++count)
{
//update the name of the extension which is to be installed
{
@@ -487,8 +487,6 @@ void UpdateInstallDialog::Thread::installExtensions()
}
m_dialog.m_ft_extension_name.SetText(i->aInstalledPackage->getDisplayName());
}
-// TimeValue v = {1, 0};
-// osl::Thread::wait(v);
bool bError = false;
bool bLicenseDeclined = false;
cssu::Reference<css::deployment::XPackage> xExtension;
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index a23488bfbf..390e55f9d0 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
@@ -80,7 +80,7 @@ public:
~UpdateInstallDialog();
- BOOL Close();
+ sal_Bool Close();
virtual short Execute();
private:
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src
index 7c43817754..a3ded83be1 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src
@@ -90,6 +90,7 @@ ModalDialog RID_DLG_UPDATEINSTALL {
};
MultiLineEdit RID_DLG_UPDATE_INSTALL_INFO {
+ HelpID = "desktop:MultiLineEdit:RID_DLG_UPDATEINSTALL:RID_DLG_UPDATE_INSTALL_INFO";
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT,
RSC_SP_DLG_INNERBORDER_TOP + RSC_CD_FIXEDTEXT_HEIGHT +
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index 9fd55d2938..907fb66890 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,7 +63,7 @@ namespace dp_gui {
class LicenseView : public MultiLineEdit, public SfxListener
{
- BOOL mbEndReached;
+ sal_Bool mbEndReached;
Link maEndReachedHdl;
Link maScrolledHdl;
@@ -73,9 +73,9 @@ public:
void ScrollDown( ScrollType eScroll );
- BOOL IsEndReached() const;
- BOOL EndReached() const { return mbEndReached; }
- void SetEndReached( BOOL bEnd ) { mbEndReached = bEnd; }
+ sal_Bool IsEndReached() const;
+ sal_Bool EndReached() const { return mbEndReached; }
+ void SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
void SetEndReachedHdl( const Link& rHdl ) { maEndReachedHdl = rHdl; }
const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
@@ -90,7 +90,7 @@ protected:
};
struct LicenseDialogImpl : public ModalDialog
-{
+{
cssu::Reference<cssu::XComponentContext> m_xComponentContext;
FixedText m_ftHead;
FixedText m_ftBody1;
@@ -146,20 +146,20 @@ void LicenseView::ScrollDown( ScrollType eScroll )
pScroll->DoScrollAction( eScroll );
}
-BOOL LicenseView::IsEndReached() const
+sal_Bool LicenseView::IsEndReached() const
{
- BOOL bEndReached;
+ sal_Bool bEndReached;
ExtTextView* pView = GetTextView();
ExtTextEngine* pEdit = GetTextEngine();
- ULONG nHeight = pEdit->GetTextHeight();
+ sal_uLong nHeight = pEdit->GetTextHeight();
Size aOutSize = pView->GetWindow()->GetOutputSizePixel();
Point aBottom( 0, aOutSize.Height() );
- if ( (ULONG) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 )
- bEndReached = TRUE;
+ if ( (sal_uLong) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 )
+ bEndReached = sal_True;
else
- bEndReached = FALSE;
+ bEndReached = sal_False;
return bEndReached;
}
@@ -168,8 +168,8 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.IsA( TYPE(TextHint) ) )
{
- BOOL bLastVal = EndReached();
- ULONG nId = ((const TextHint&)rHint).GetId();
+ sal_Bool bLastVal = EndReached();
+ sal_uLong nId = ((const TextHint&)rHint).GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
@@ -215,13 +215,6 @@ LicenseDialogImpl::LicenseDialogImpl(
{
- if (GetSettings().GetStyleSettings().GetHighContrastMode())
- {
- // high contrast mode needs other images
- m_fiArrow1.SetImage(Image(DpGuiResId(IMG_LICENCE_ARROW_HC)));
- m_fiArrow2.SetImage(Image(DpGuiResId(IMG_LICENCE_ARROW_HC)));
- }
-
FreeResource();
m_acceptButton.SetUniqueId(UID_BTN_LICENSE_ACCEPT);
diff --git a/desktop/source/deployment/gui/license_dialog.hxx b/desktop/source/deployment/gui/license_dialog.hxx
index 7e7a8592e6..ec63ffbfbb 100644
--- a/desktop/source/deployment/gui/license_dialog.hxx
+++ b/desktop/source/deployment/gui/license_dialog.hxx
@@ -45,7 +45,6 @@ namespace dp_gui {
class LicenseDialog
: public ::cppu::WeakImplHelper1<ui::dialogs::XExecutableDialog>
-// task::XJobExecutor>
{
Reference<XComponentContext> const m_xComponentContext;
Reference<awt::XWindow> /* const */ m_parent;
@@ -63,10 +62,6 @@ public:
virtual void SAL_CALL setTitle( OUString const & title )
throw (RuntimeException);
virtual sal_Int16 SAL_CALL execute() throw (RuntimeException);
-
- //// XJobExecutor
- //virtual void SAL_CALL trigger( OUString const & event )
- // throw (RuntimeException);
};
}
#endif
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index 52092a077a..73ca837925 100644..100755
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -30,7 +30,6 @@ PRJ = ..$/..$/..
PRJNAME = desktop
TARGET = deploymentgui
ENABLE_EXCEPTIONS = TRUE
-#USE_DEFFILE = TRUE
NO_BSYMBOLIC = TRUE
USE_PCH :=
ENABLE_PCH :=
@@ -55,7 +54,6 @@ SLOFILES = \
$(SLO)$/dp_gui_updatedialog.obj \
$(SLO)$/dp_gui_updateinstalldialog.obj \
$(SLO)$/dp_gui_autoscrolledit.obj \
- $(SLO)$/dp_gui_system.obj \
$(SLO)$/dp_gui_extensioncmdqueue.obj \
$(SLO)$/descedit.obj
@@ -88,8 +86,6 @@ SHL1LIBS = $(SLB)$/$(TARGET).lib
SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
-#DEFLIB1NAME = $(TARGET)
-#DEF1DEPN =
SRS1NAME = $(TARGET)
SRC1FILES = \
@@ -107,3 +103,11 @@ RESLIB1IMAGES= $(PRJ)$/res
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/deploymentgui.component
+
+$(MISC)/deploymentgui.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component
diff --git a/desktop/source/deployment/inc/db.hxx b/desktop/source/deployment/inc/db.hxx
index 4f144667a9..3fa3d22679 100644
--- a/desktop/source/deployment/inc/db.hxx
+++ b/desktop/source/deployment/inc/db.hxx
@@ -28,6 +28,8 @@
#ifndef BERKELEYDBPROXY_DB_HXX_
#define BERKELEYDBPROXY_DB_HXX_
+#include <boost/noncopyable.hpp>
+
#ifdef SYSTEM_DB
#include <db.h>
#else
@@ -43,26 +45,12 @@ extern "C" {
typedef void (*db_free_fcn_type)(void *);
}
-
namespace berkeleydbproxy {
class DbEnv;
class Dbc;
class Dbt;
- namespace db_internal
- {
- class Noncopyable
- {
- // not implemented
- Noncopyable(const Noncopyable&);
- void operator=(const Noncopyable&);
- protected:
- Noncopyable() {}
- ~Noncopyable() {}
- };
- }
-
class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbException
{
rtl::OString what_;
@@ -78,7 +66,7 @@ namespace berkeleydbproxy {
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : boost::noncopyable
{
friend class Db;
@@ -89,7 +77,7 @@ namespace berkeleydbproxy {
static char *strerror(int);
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : boost::noncopyable
{
private:
DB* m_pDBP;
@@ -116,7 +104,7 @@ namespace berkeleydbproxy {
int cursor(DB_TXN *txnid, Dbc **cursorp, u_int32_t flags);
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : boost::noncopyable
{
friend class Db;
friend class Dbt;
@@ -156,20 +144,4 @@ namespace berkeleydbproxy {
}
#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_dependencies.hxx b/desktop/source/deployment/inc/dp_dependencies.hxx
index 2e57c06275..f31d5f3084 100644
--- a/desktop/source/deployment/inc/dp_dependencies.hxx
+++ b/desktop/source/deployment/inc/dp_dependencies.hxx
@@ -29,6 +29,7 @@
#ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_DEPENDENCIES_HXX
#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_DEPENDENCIES_HXX
+#include "unotools/configmgr.hxx"
#include "sal/config.h"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
@@ -44,6 +45,14 @@ namespace rtl { class OUString; }
namespace dp_misc {
+struct BrandName : public ::rtl::StaticWithInit<const ::rtl::OUString, BrandName> {
+ const ::rtl::OUString operator () () {
+ return ::utl::ConfigManager::GetDirectConfigProperty(
+ ::utl::ConfigManager::PRODUCTNAME ).get< ::rtl::OUString >();
+ }
+};
+
+
/**
Dependency handling.
*/
diff --git a/desktop/source/deployment/inc/dp_interact.h b/desktop/source/deployment/inc/dp_interact.h
index 3aca761c2d..3aca761c2d 100644..100755
--- a/desktop/source/deployment/inc/dp_interact.h
+++ b/desktop/source/deployment/inc/dp_interact.h
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index bbf6d5274b..bbf6d5274b 100644..100755
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
diff --git a/desktop/source/deployment/inc/dp_misc.mk b/desktop/source/deployment/inc/dp_misc.mk
index 829a6bb96b..829a6bb96b 100644..100755
--- a/desktop/source/deployment/inc/dp_misc.mk
+++ b/desktop/source/deployment/inc/dp_misc.mk
diff --git a/desktop/source/deployment/inc/dp_persmap.h b/desktop/source/deployment/inc/dp_persmap.h
index b1597f3bb5..8af038413a 100644..100755
--- a/desktop/source/deployment/inc/dp_persmap.h
+++ b/desktop/source/deployment/inc/dp_persmap.h
@@ -31,14 +31,14 @@
#include "rtl/ustring.hxx"
#include "db.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace berkeleydbproxy;
namespace dp_misc
{
-typedef ::std::hash_map<
+typedef ::boost::unordered_map<
::rtl::OString, ::rtl::OString, ::rtl::OStringHash > t_string2string_map;
//==============================================================================
diff --git a/desktop/source/deployment/inc/dp_resource.h b/desktop/source/deployment/inc/dp_resource.h
index 96fd049207..bd3a4fac82 100644..100755
--- a/desktop/source/deployment/inc/dp_resource.h
+++ b/desktop/source/deployment/inc/dp_resource.h
@@ -40,12 +40,12 @@
namespace dp_misc {
//==============================================================================
-ResId getResId( USHORT id );
+ResId getResId( sal_uInt16 id );
//==============================================================================
-DESKTOP_DEPLOYMENTMISC_DLLPUBLIC String getResourceString( USHORT id );
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC String getResourceString( sal_uInt16 id );
-template <typename Unique, USHORT id>
+template <typename Unique, sal_uInt16 id>
struct StaticResourceString :
public ::rtl::StaticWithInit<const ::rtl::OUString, Unique> {
const ::rtl::OUString operator () () { return getResourceString(id); }
diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h
index c2fcdcd7e0..c2fcdcd7e0 100644..100755
--- a/desktop/source/deployment/inc/dp_ucb.h
+++ b/desktop/source/deployment/inc/dp_ucb.h
diff --git a/desktop/source/deployment/inc/dp_xml.h b/desktop/source/deployment/inc/dp_xml.h
index 376df332fb..376df332fb 100644..100755
--- a/desktop/source/deployment/inc/dp_xml.h
+++ b/desktop/source/deployment/inc/dp_xml.h
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index 6d83a5c100..877379ad73 100644..100755
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -30,7 +30,6 @@ PRJ = ..$/..
PRJNAME = desktop
TARGET = deployment
ENABLE_EXCEPTIONS = TRUE
-#USE_DEFFILE = TRUE
NO_BSYMBOLIC = TRUE
.IF "$(GUI)"=="OS2"
@@ -110,3 +109,11 @@ RESLIB1SRSFILES += $(SRS)$/deployment_misc.srs
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/deployment.component
+
+$(MISC)/deployment.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ deployment.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt deployment.component
diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx
index 950e46174d..94a16f6230 100644
--- a/desktop/source/deployment/manager/dp_activepackages.cxx
+++ b/desktop/source/deployment/manager/dp_activepackages.cxx
@@ -41,7 +41,7 @@
#include "rtl/uri.h"
#include "rtl/uri.hxx"
#include "rtl/ustring.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include "dp_identifier.hxx"
#include "dp_persmap.h"
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx
index ba32b30898..f8237f3549 100644
--- a/desktop/source/deployment/manager/dp_commandenvironments.cxx
+++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx
@@ -223,7 +223,6 @@ void LicenseCommandEnv::handle(
}
//================================================================================
-//================================================================================
NoLicenseCommandEnv::NoLicenseCommandEnv(
css::uno::Reference< css::task::XInteractionHandler> const & handler):
@@ -250,11 +249,6 @@ void NoLicenseCommandEnv::handle(
handle_(approve, abort, xRequest);
}
-// SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv(
-// css::uno::Reference< css::task::XInteractionHandler> const & handler):
-// BaseCommandEnv(handler)
-// {
-// }
SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv()
{
}
@@ -287,33 +281,7 @@ void SilentCheckPrerequisitesCommandEnv::handle(
m_UnknownException = request;
}
}
-// NoExceptionCommandEnv::NoExceptionCommandEnv(
-// css::uno::Reference< css::task::XInteractionHandler> const & handler,
-// css::uno::Type const & type):
-// BaseCommandEnv(handler),
-// m_type(type)
-// {
-// }
-// // XInteractionHandler
-// void NoExceptionCommandEnv::handle(
-// Reference< task::XInteractionRequest> const & xRequest )
-// throw (uno::RuntimeException)
-// {
-// uno::Any request( xRequest->getRequest() );
-// OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
-
-// deployment::LicenseException licExc;
-
-// bool approve = false;
-// bool abort = false;
-
-// if (request.getValueType() == m_type)
-// {
-// approve = true;
-// }
-// handle_(approve, abort, xRequest);
-// }
-
-} // namespace dp_manager
+
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.hxx b/desktop/source/deployment/manager/dp_commandenvironments.hxx
index da64628792..59349c469a 100644
--- a/desktop/source/deployment/manager/dp_commandenvironments.hxx
+++ b/desktop/source/deployment/manager/dp_commandenvironments.hxx
@@ -100,7 +100,7 @@ private:
::rtl::OUString m_repository;
bool m_bSuppressLicense;
public:
- LicenseCommandEnv(){};
+ LicenseCommandEnv() : m_bSuppressLicense(false) {};
LicenseCommandEnv(
css::uno::Reference< css::task::XInteractionHandler> const & handler,
bool bSuppressLicense,
@@ -154,22 +154,6 @@ public:
css::uno::Any m_UnknownException;
};
-// class NoExceptionCommandEnv : public BaseCommandEnv
-// {
-// css::uno::Type m_type;
-// public:
-// NoExceptionCommandEnv::NoExceptionCommandEnv(){};
-// NoExceptionCommandEnv::NoExceptionCommandEnv(
-// css::uno::Reference< css::task::XInteractionHandler> const & handler,
-// css::uno::Type const & type);
-
-// // XInteractionHandler
-// virtual void SAL_CALL handle(
-// css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
-// throw (css::uno::RuntimeException);
-
-// };
-
}
#endif
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 11b38cdc88..e2fe27e12d 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -65,7 +65,7 @@
#include "boost/bind.hpp"
#include <list>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <algorithm>
namespace deploy = com::sun::star::deployment;
@@ -78,8 +78,6 @@ namespace beans = com::sun::star::beans;
namespace util = com::sun::star::util;
namespace css = com::sun::star;
-//#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
using ::com::sun::star::uno::Reference;
using ::rtl::OUString;
@@ -90,7 +88,6 @@ struct CompIdentifiers
bool operator() (::std::vector<Reference<deploy::XPackage> > const & a,
::std::vector<Reference<deploy::XPackage> > const & b)
{
-
if (getName(a).compareTo(getName(b)) < 0)
return true;
return false;
@@ -170,7 +167,7 @@ ExtensionRemoveGuard::~ExtensionRemoveGuard()
}
}
-} //end namespace
+}
namespace dp_manager {
@@ -181,13 +178,9 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x
::cppu::WeakComponentImplHelper1< css::deployment::XExtensionManager >(getMutex()),
m_xContext( xContext )
{
- Reference<deploy::XPackageManagerFactory> xPackageManagerFactory(
- deploy::thePackageManagerFactory::get(m_xContext));
- m_userRepository = xPackageManagerFactory->getPackageManager(OUSTR("user"));
- m_sharedRepository = xPackageManagerFactory->getPackageManager(OUSTR("shared"));
- m_bundledRepository = xPackageManagerFactory->getPackageManager(OUSTR("bundled"));
- m_tmpRepository = xPackageManagerFactory->getPackageManager(OUSTR("tmp"));
-
+ m_xPackageManagerFactory = deploy::thePackageManagerFactory::get(m_xContext);
+ OSL_ASSERT(m_xPackageManagerFactory.is());
+
m_repositoryNames.push_back(OUSTR("user"));
m_repositoryNames.push_back(OUSTR("shared"));
m_repositoryNames.push_back(OUSTR("bundled"));
@@ -199,6 +192,23 @@ ExtensionManager::~ExtensionManager()
{
}
+Reference<deploy::XPackageManager> ExtensionManager::getUserRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("user"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getSharedRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("shared"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getBundledRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("bundled"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getTmpRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("tmp"));
+}
+
Reference<task::XAbortChannel> ExtensionManager::createAbortChannel()
throw (uno::RuntimeException)
{
@@ -211,11 +221,11 @@ ExtensionManager::getPackageManager(::rtl::OUString const & repository)
{
Reference<deploy::XPackageManager> xPackageManager;
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else if (repository.equals(OUSTR("bundled")))
- xPackageManager = m_bundledRepository;
+ xPackageManager = getBundledRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -227,7 +237,7 @@ ExtensionManager::getPackageManager(::rtl::OUString const & repository)
Enters the XPackage objects into a map. They must be all from the
same repository. The value type of the map is a vector, where each vector
represents an extension with a particular identifier. The first member
- is represents the user extension, the second the shared extension and the
+ represents the user extension, the second the shared extension and the
third the bundled extension.
*/
void ExtensionManager::addExtensionsToMap(
@@ -266,8 +276,8 @@ void ExtensionManager::addExtensionsToMap(
/*
returns a list containing extensions with the same identifier from
- all repositories (user, shared, bundled) If one repository does not
- have this extension, then the list contains an empty Referenc. The list
+ all repositories (user, shared, bundled). If one repository does not
+ have this extension, then the list contains an empty Reference. The list
is ordered according to the priority of the repostories:
1. user
2. shared
@@ -283,29 +293,21 @@ void ExtensionManager::addExtensionsToMap(
{
::std::list<Reference<deploy::XPackage> > extensionList;
- try
- { //will throw an exception if the extension does not exist
- extensionList.push_back(m_userRepository->getDeployedPackage(
- identifier, fileName, Reference<ucb::XCommandEnvironment>()));
- } catch(lang::IllegalArgumentException &)
+ Reference<deploy::XPackageManager> lRepos[] = {
+ getUserRepository(), getSharedRepository(), getBundledRepository() };
+ for (int i(0); i != SAL_N_ELEMENTS(lRepos); ++i)
{
- extensionList.push_back(Reference<deploy::XPackage>());
- }
- try
- {
- extensionList.push_back(m_sharedRepository->getDeployedPackage(
- identifier, fileName, Reference<ucb::XCommandEnvironment>()));
- } catch (lang::IllegalArgumentException &)
- {
- extensionList.push_back(Reference<deploy::XPackage>());
- }
- try
- {
- extensionList.push_back(m_bundledRepository->getDeployedPackage(
- identifier, fileName, Reference<ucb::XCommandEnvironment>()));
- } catch (lang::IllegalArgumentException &)
- {
- extensionList.push_back(Reference<deploy::XPackage>());
+ Reference<deploy::XPackage> xPackage;
+ try
+ {
+ xPackage = lRepos[i]->getDeployedPackage(
+ identifier, fileName, Reference<ucb::XCommandEnvironment>());
+ }
+ catch(lang::IllegalArgumentException &)
+ {
+ // thrown if the extension does not exist in this repository
+ }
+ extensionList.push_back(xPackage);
}
OSL_ASSERT(extensionList.size() == 3);
return extensionList;
@@ -503,7 +505,7 @@ Reference<deploy::XPackage> ExtensionManager::backupExtension(
if (xOldExtension.is())
{
- xBackup = m_tmpRepository->addPackage(
+ xBackup = getTmpRepository()->addPackage(
xOldExtension->getURL(), uno::Sequence<beans::NamedValue>(),
OUString(), Reference<task::XAbortChannel>(), tmpCmdEnv);
@@ -524,7 +526,7 @@ uno::Sequence< Reference<deploy::XPackageTypeInfo> >
ExtensionManager::getSupportedPackageTypes()
throw (uno::RuntimeException)
{
- return m_userRepository->getSupportedPackageTypes();
+ return getUserRepository()->getSupportedPackageTypes();
}
//Do some necessary checks and user interaction. This function does not
//aquire the extension manager mutex and that mutex must not be aquired
@@ -644,9 +646,9 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//Determine the repository to use
Reference<deploy::XPackageManager> xPackageManager;
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -659,7 +661,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
getTempExtension(url, xAbortChannel, xCmdEnv);
//Make sure the extension is removed from the tmp repository in case
//of an exception
- ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, m_tmpRepository);
+ ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository());
const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension);
const OUString sFileName = xTmpExtension->getName();
Reference<deploy::XPackage> xOldExtension;
@@ -703,8 +705,8 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//the xTmpExtension
//no command environment supplied, only this class shall interact
//with the user!
- xExtensionBackup = m_tmpRepository->importExtension(
- xOldExtension, Reference<task::XAbortChannel>(),
+ xExtensionBackup = getTmpRepository()->importExtension(
+ xOldExtension, Reference<task::XAbortChannel>(),
Reference<ucb::XCommandEnvironment>());
tmpExtensionRemoveGuard.reset(xExtensionBackup);
//xTmpExtension will later be used to check the dependencies
@@ -720,7 +722,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
}
//check again dependencies but prevent user interaction,
//We can disregard the license, because the user must have already
- //accepted it, whe we called checkPrerequisites the first time
+ //accepted it, when we called checkPrerequisites the first time
SilentCheckPrerequisitesCommandEnv * pSilentCommandEnv =
new SilentCheckPrerequisitesCommandEnv();
Reference<ucb::XCommandEnvironment> silentCommandEnv(pSilentCommandEnv);
@@ -856,9 +858,9 @@ void ExtensionManager::removeExtension(
{
//Determine the repository to use
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -917,8 +919,8 @@ void ExtensionManager::removeExtension(
identifier, fileName, bUserDisabled, false,
Reference<task::XAbortChannel>(),
tmpCmdEnv);
-
- m_tmpRepository->removePackage(
+
+ getTmpRepository()->removePackage(
dp_misc::getIdentifier(xExtensionBackup),
xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
fireModified();
@@ -931,7 +933,7 @@ void ExtensionManager::removeExtension(
}
if (xExtensionBackup.is())
- m_tmpRepository->removePackage(
+ getTmpRepository()->removePackage(
dp_misc::getIdentifier(xExtensionBackup),
xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
}
@@ -1158,20 +1160,20 @@ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > >
id2extensions mapExt;
uno::Sequence<Reference<deploy::XPackage> > userExt =
- m_userRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getUserRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, userExt, OUSTR("user"));
uno::Sequence<Reference<deploy::XPackage> > sharedExt =
- m_sharedRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getSharedRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, sharedExt, OUSTR("shared"));
uno::Sequence<Reference<deploy::XPackage> > bundledExt =
- m_bundledRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled"));
//copy the values of the map to a vector for sorting
::std::vector< ::std::vector<Reference<deploy::XPackage> > >
vecExtensions;
id2extensions::const_iterator mapIt = mapExt.begin();
- for (;mapIt != mapExt.end(); mapIt++)
+ for (;mapIt != mapExt.end(); ++mapIt)
vecExtensions.push_back(mapIt->second);
//sort the element according to the identifier
@@ -1234,7 +1236,7 @@ void ExtensionManager::reinstallDeployedExtensions(
const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
const OUString fileName = extensions[ pos ]->getName();
OSL_ASSERT(id.getLength());
- activateExtension(id, fileName, false, false, xAbortChannel, xCmdEnv );
+ activateExtension(id, fileName, false, true, xAbortChannel, xCmdEnv );
}
catch (lang::DisposedException &)
{
@@ -1258,6 +1260,64 @@ void ExtensionManager::reinstallDeployedExtensions(
}
}
+/** Works on the bundled repository. That is using the variables
+ BUNDLED_EXTENSIONS and BUNDLED_EXTENSIONS_USER.
+ */
+void ExtensionManager::synchronizeBundledPrereg(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ String sSynchronizingBundled(StrSyncRepository::get());
+ sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled"));
+ dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
+
+ Reference<deploy::XPackageManagerFactory> xPackageManagerFactory(
+ deploy::thePackageManagerFactory::get(m_xContext));
+
+ Reference<deploy::XPackageManager> xMgr =
+ xPackageManagerFactory->getPackageManager(OUSTR("bundled_prereg"));
+ xMgr->synchronize(xAbortChannel, xCmdEnv);
+ progressBundled.update(OUSTR("\n\n"));
+
+ uno::Sequence<Reference<deploy::XPackage> > extensions = xMgr->getDeployedPackages(
+ xAbortChannel, xCmdEnv);
+ try
+ {
+ for (sal_Int32 i = 0; i < extensions.getLength(); i++)
+ {
+ extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv);
+ }
+ }
+ catch (...)
+ {
+ OSL_ASSERT(0);
+ }
+ OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM(
+ "$BUNDLED_EXTENSIONS_PREREG/lastsynchronized"));
+ writeLastModified(lastSyncBundled, xCmdEnv);
+
+ } catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception in synchronize"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
sal_Bool ExtensionManager::synchronize(
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv )
@@ -1275,13 +1335,13 @@ sal_Bool ExtensionManager::synchronize(
String sSynchronizingShared(StrSyncRepository::get());
sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUSTR("shared"));
dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
- bModified = m_sharedRepository->synchronize(xAbortChannel, xCmdEnv);
+ bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv);
progressShared.update(OUSTR("\n\n"));
String sSynchronizingBundled(StrSyncRepository::get());
sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled"));
dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
- bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv);
+ bModified |= getBundledRepository()->synchronize(xAbortChannel, xCmdEnv);
progressBundled.update(OUSTR("\n\n"));
//Always determine the active extension. This is necessary for the
@@ -1308,7 +1368,7 @@ sal_Bool ExtensionManager::synchronize(
{
//We catch the exception, so we can write the lastmodified file
//so we will no repeat this everytime OOo starts.
- OSL_ENSURE(0, "Extensions Manager: synchronize");
+ OSL_FAIL("Extensions Manager: synchronize");
}
OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM(
"$BUNDLED_EXTENSIONS_USER/lastsynchronized"));
@@ -1408,7 +1468,7 @@ Reference<deploy::XPackage> ExtensionManager::getTempExtension(
{
Reference<ucb::XCommandEnvironment> tmpCmdEnvA(new TmpRepositoryCommandEnv());
- Reference<deploy::XPackage> xTmpPackage = m_tmpRepository->addPackage(
+ Reference<deploy::XPackage> xTmpPackage = getTmpRepository()->addPackage(
url, uno::Sequence<beans::NamedValue>(),OUString(), xAbortChannel, tmpCmdEnvA);
if (!xTmpPackage.is())
{
@@ -1439,8 +1499,6 @@ sal_Bool ExtensionManager::isReadOnlyRepository(::rtl::OUString const & reposito
return getPackageManager(repository)->isReadOnly();
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
namespace sdecl = comphelper::service_decl;
sdecl::class_<ExtensionManager> servicePIP;
@@ -1466,7 +1524,7 @@ bool singleton_entries(
}
catch (registry::InvalidRegistryException & exc) {
(void) exc; // avoid warnings
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
return false;
}
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index 8677f960ef..7adcf0a201 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -45,7 +45,7 @@ namespace css = ::com::sun::star;
namespace dp_manager {
-typedef ::std::hash_map<
+typedef ::boost::unordered_map<
::rtl::OUString,
::std::vector<css::uno::Reference<css::deployment::XPackage> >,
::rtl::OUStringHash > id2extensions;
@@ -200,6 +200,12 @@ public:
css::lang::IllegalArgumentException,
css::uno::RuntimeException);
+ virtual void SAL_CALL synchronizeBundledPrereg(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException);
+
virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL
getExtensionsWithUnacceptedLicenses(
::rtl::OUString const & repository,
@@ -224,12 +230,8 @@ private:
};
css::uno::Reference< css::uno::XComponentContext> m_xContext;
-
- css::uno::Reference<css::deployment::XPackageManager> m_userRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_sharedRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_bundledRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_tmpRepository;
-
+ css::uno::Reference<css::deployment::XPackageManagerFactory> m_xPackageManagerFactory;
+
//only to be used within addExtension
::osl::Mutex m_addMutex;
/* contains the names of all repositories (except tmp) in order of there
@@ -238,6 +240,11 @@ private:
*/
::std::list< ::rtl::OUString > m_repositoryNames;
+ css::uno::Reference<css::deployment::XPackageManager> getUserRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getSharedRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getBundledRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getTmpRepository();
+
bool isUserDisabled(::rtl::OUString const & identifier,
::rtl::OUString const & filename);
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 6aaf3739e2..c3e915b108 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -41,9 +41,8 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/registry/XRegistryKey.hpp"
#include "com/sun/star/task/XAbortChannel.hpp"
-#include "com/sun/star/ucb/CommandFailedException.hpp"
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/xml/dom/XElement.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
@@ -72,9 +71,8 @@ namespace xml = com::sun::star::xml ;
namespace dp_info {
class PackageInformationProvider :
- public ::cppu::WeakImplHelper3< deployment::XPackageInformationProvider,
- css_ucb::XCommandEnvironment,
- task::XInteractionHandler >
+ public ::cppu::WeakImplHelper1< deployment::XPackageInformationProvider >
+
{
public:
PackageInformationProvider( uno::Reference< uno::XComponentContext >const& xContext);
@@ -83,16 +81,6 @@ class PackageInformationProvider :
static uno::Sequence< rtl::OUString > getServiceNames();
static rtl::OUString getImplName();
- // XInteractionHandler
- virtual void SAL_CALL handle( const uno::Reference< task::XInteractionRequest >& Request )
- throw( uno::RuntimeException );
- // XCommandEnvironment
- virtual uno::Reference< task::XInteractionHandler > SAL_CALL getInteractionHandler()
- throw ( uno::RuntimeException ) { return static_cast<task::XInteractionHandler*>(this); };
-
- virtual uno::Reference< css_ucb::XProgressHandler > SAL_CALL getProgressHandler()
- throw ( uno::RuntimeException ) { return uno::Reference< css_ucb::XProgressHandler >(); };
-
// XPackageInformationProvider
virtual rtl::OUString SAL_CALL getPackageLocation( const rtl::OUString& extensionId )
throw ( uno::RuntimeException );
@@ -126,17 +114,6 @@ PackageInformationProvider::~PackageInformationProvider()
}
//------------------------------------------------------------------------------
-void SAL_CALL PackageInformationProvider::handle( uno::Reference< task::XInteractionRequest > const & rRequest)
- throw (uno::RuntimeException)
-{
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations();
- if ( xContinuations.getLength() == 1 )
- {
- xContinuations[0]->select();
- }
-}
-
-//------------------------------------------------------------------------------
rtl::OUString PackageInformationProvider::getPackageLocation(
const rtl::OUString & repository,
const rtl::OUString& _rExtensionId )
@@ -151,7 +128,7 @@ rtl::OUString PackageInformationProvider::getPackageLocation(
xManager->getDeployedExtensions(
repository,
uno::Reference< task::XAbortChannel >(),
- static_cast < XCommandEnvironment *> (this) ) );
+ uno::Reference< css_ucb::XCommandEnvironment > () ) );
for ( int pos = packages.getLength(); pos--; )
{
@@ -173,8 +150,6 @@ rtl::OUString PackageInformationProvider::getPackageLocation(
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
rtl::OUString SAL_CALL
PackageInformationProvider::getPackageLocation( const rtl::OUString& _sExtensionId )
@@ -241,7 +216,7 @@ PackageInformationProvider::isUpdateAvailable( const rtl::OUString& _sExtensionI
}
int nCount = 0;
- for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); i++)
+ for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); ++i)
{
dp_misc::UpdateInfo const & info = i->second;
@@ -321,7 +296,7 @@ uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvi
const uno::Sequence< uno::Sequence< uno::Reference<deployment::XPackage > > >
allExt = mgr->getAllExtensions(
uno::Reference< task::XAbortChannel >(),
- static_cast < XCommandEnvironment *> (this) );
+ uno::Reference< css_ucb::XCommandEnvironment > () );
uno::Sequence< uno::Sequence< rtl::OUString > > retList;
@@ -356,8 +331,6 @@ uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvi
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
namespace sdecl = comphelper::service_decl;
sdecl::class_<PackageInformationProvider> servicePIP;
@@ -383,7 +356,7 @@ bool singleton_entries(
}
catch (registry::InvalidRegistryException & exc) {
(void) exc; // avoid warnings
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
return false;
}
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 3b7432ae80..17b65f1ded 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -64,6 +64,7 @@
#include "com/sun/star/ucb/UnsupportedCommandException.hpp"
#include "boost/bind.hpp"
#include "tools/urlobj.hxx"
+#include "unotools/tempfile.hxx"
#include "osl/file.hxx"
#include <vector>
@@ -371,6 +372,24 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
//No stamp file. We assume that bundled is always readonly. It must not be
//modified from ExtensionManager but only by the installer
}
+ else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") )) {
+ //This is a bundled repository but the registration data
+ //is in the brand layer: share/prereg
+ //It is special because the registration data are copied at the first startup
+ //into the user installation. The processed help and xcu files are not
+ //copied. Instead the backenddb.xml for the help backend references the help
+ //by using $BUNDLED_EXTENSION_PREREG instead $BUNDLED_EXTENSIONS_USER. The
+ //configmgr.ini also used $BUNDLED_EXTENSIONS_PREREG to refer to the xcu file
+ //which contain the replacement for %origin%.
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/registry");
+ logFile = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/log.txt");
+ }
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") )) {
that->m_activePackages = OUSTR(
"vnd.sun.star.expand:$TMP_EXTENSIONS/extensions");
@@ -603,7 +622,7 @@ OUString PackageManagerImpl::detectMediaType(
if (throw_exc)
throw;
(void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -619,21 +638,12 @@ OUString PackageManagerImpl::insertToActivationLayer(
::ucbhelper::Content sourceContent(sourceContent_);
Reference<XCommandEnvironment> xCmdEnv(
sourceContent.getCommandEnvironment() );
- OUString destFolder, tempEntry;
- if (::osl::File::createTempFile(
- m_activePackages_expanded.getLength() == 0
- ? 0 : &m_activePackages_expanded,
- 0, &tempEntry ) != ::osl::File::E_None)
- throw RuntimeException(
- OUSTR("::osl::File::createTempFile() failed!"), 0 );
- if (m_activePackages_expanded.getLength() == 0) {
- destFolder = tempEntry;
- }
- else {
- tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
- // tweak user|share to macrofied url:
- destFolder = makeURL( m_activePackages, tempEntry );
- }
+
+ String baseDir(m_activePackages_expanded);
+ ::utl::TempFile aTemp(&baseDir, sal_False);
+ OUString tempEntry = aTemp.GetURL();
+ tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1);
+ OUString destFolder = makeURL( m_activePackages, tempEntry);
destFolder += OUSTR("_");
// prepare activation folder:
@@ -950,6 +960,8 @@ void PackageManagerImpl::removePackage(
contentRemoved.writeStream( xData, true /* replace existing */ );
}
m_activePackagesDB->erase( id, fileName ); // to be removed upon next start
+ //remove any cached data hold by the backend
+ m_xRegistry->packageRemoved(xPackage->getURL(), xPackage->getPackageType()->getMediaType());
}
try_dispose( xPackage );
@@ -990,7 +1002,8 @@ OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data )
//The bundled extensions are not contained in an additional folder
//with a unique name. data.temporaryName contains already the
//UTF8 encoded folder name. See PackageManagerImpl::synchronize
- if (!m_context.equals(OUSTR("bundled")))
+ if (!m_context.equals(OUSTR("bundled"))
+ && !m_context.equals(OUSTR("bundled_prereg")))
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") );
buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar,
@@ -1076,13 +1089,13 @@ PackageManagerImpl::getDeployedPackages_(
catch (lang::IllegalArgumentException & exc) {
// ignore
(void) exc; // avoid warnings
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch (deployment::DeploymentException& exc) {
// ignore
(void) exc; // avoid warnings
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -1261,7 +1274,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions(
typedef ActivePackages::Entries::const_iterator ITActive;
bool bShared = m_context.equals(OUSTR("shared"));
- for (ITActive i = id2temp.begin(); i != id2temp.end(); i++)
+ for (ITActive i = id2temp.begin(); i != id2temp.end(); ++i)
{
try
{
@@ -1305,7 +1318,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions(
//There may be another extensions at the same place
dp_misc::DescriptionInfoset infoset =
dp_misc::getDescriptionInfoset(url);
- OSL_ENSURE(infoset.hasDescription(),
+ OSL_ENSURE(infoset.hasDescription() && infoset.getIdentifier(),
"Extension Manager: bundled and shared extensions "
"must have an identifer and a version");
if (infoset.hasDescription() &&
@@ -1342,6 +1355,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
{
bool bModified = false;
+ OSL_ASSERT(!m_context.equals(OUSTR("user")));
+
ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
//check if the folder exist at all. The shared extension folder
//may not exist for a normal user.
@@ -1367,8 +1382,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
//The temporary folders of user and shared have an '_' at then end.
//But the name in ActivePackages.temporaryName is saved without.
OUString title2 = title;
- bool bNotBundled = !m_context.equals(OUSTR("bundled"));
- if (bNotBundled)
+ bool bShared = m_context.equals(OUSTR("shared"));
+ if (bShared)
{
OSL_ASSERT(title2[title2.getLength() -1] == '_');
title2 = title2.copy(0, title2.getLength() -1);
@@ -1390,7 +1405,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
// an added extension
OUString url(m_activePackages_expanded + OUSTR("/") + titleEncoded);
OUString sExtFolder;
- if (bNotBundled) //that is, shared
+ if (bShared) //that is, shared
{
//Check if the extension was not "deleted" already which is indicated
//by a xxx.tmpremoved file
@@ -1412,7 +1427,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
ActivePackages::Data dbData;
dbData.temporaryName = titleEncoded;
- if (bNotBundled)
+ if (bShared)
dbData.fileName = sExtFolder;
else
dbData.fileName = title;
@@ -1497,7 +1512,7 @@ Sequence< Reference<deployment::XPackage> > PackageManagerImpl::getExtensionsWit
ActivePackages::Entries::const_iterator i = id2temp.begin();
bool bShared = m_context.equals(OUSTR("shared"));
- for (; i != id2temp.end(); i++ )
+ for (; i != id2temp.end(); ++i )
{
//Get the database entry
ActivePackages::Data const & dbData = i->second;
@@ -1604,7 +1619,6 @@ sal_Int32 PackageManagerImpl::checkPrerequisites(
}
}
-//##############################################################################
//______________________________________________________________________________
PackageManagerImpl::CmdEnvWrapperImpl::~CmdEnvWrapperImpl()
diff --git a/desktop/source/deployment/manager/dp_manager.h b/desktop/source/deployment/manager/dp_manager.h
index fa4a9078ac..fa4a9078ac 100644..100755
--- a/desktop/source/deployment/manager/dp_manager.h
+++ b/desktop/source/deployment/manager/dp_manager.h
diff --git a/desktop/source/deployment/manager/dp_manager.hrc b/desktop/source/deployment/manager/dp_manager.hrc
index 3dd89f57cf..3dd89f57cf 100644..100755
--- a/desktop/source/deployment/manager/dp_manager.hrc
+++ b/desktop/source/deployment/manager/dp_manager.hrc
diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx
index ccbaadcb8a..b2e51599d9 100644
--- a/desktop/source/deployment/manager/dp_managerfac.cxx
+++ b/desktop/source/deployment/manager/dp_managerfac.cxx
@@ -55,7 +55,7 @@ class PackageManagerFactoryImpl : private MutexHolder, public t_pmfac_helper
Reference<deployment::XPackageManager> m_xUserMgr;
Reference<deployment::XPackageManager> m_xSharedMgr;
Reference<deployment::XPackageManager> m_xBundledMgr;
- typedef ::std::hash_map<
+ typedef ::boost::unordered_map<
OUString, WeakReference<deployment::XPackageManager>,
::rtl::OUStringHash > t_string2weakref;
t_string2weakref m_managers;
@@ -99,7 +99,7 @@ bool singleton_entries(
}
catch (registry::InvalidRegistryException & exc) {
(void) exc; // avoid warnings
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
return false;
}
diff --git a/desktop/source/deployment/manager/makefile.mk b/desktop/source/deployment/manager/makefile.mk
index 4dc6405e34..4dc6405e34 100644..100755
--- a/desktop/source/deployment/manager/makefile.mk
+++ b/desktop/source/deployment/manager/makefile.mk
diff --git a/desktop/source/deployment/misc/db.cxx b/desktop/source/deployment/misc/db.cxx
index ce403181ab..e3f64063e8 100644
--- a/desktop/source/deployment/misc/db.cxx
+++ b/desktop/source/deployment/misc/db.cxx
@@ -152,7 +152,6 @@ int Db::del(Dbt *key, u_int32_t flags)
if ((err = db->del(db, 0, key, flags)) != 0) {
// DB_NOTFOUND is a "normal" return, so should not be
// thrown as an error
- //
if (err != DB_NOTFOUND) {
db_internal::check_error(err, "Db::del");
return (err);
diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx
index 345e4c248b..5c945df6b2 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.cxx
@@ -57,13 +57,25 @@ namespace css = ::com::sun::star;
static char const xmlNamespace[] =
"http://openoffice.org/extensions/description/2006";
-bool satisfiesMinimalVersion(::rtl::OUString const & version) {
- ::rtl::OUString v(
+bool
+lcl_versionIsNot(dp_misc::Order i_eOrder, ::rtl::OUString const& i_rVersion)
+{
+ ::rtl::OUString aVersion(
RTL_CONSTASCII_USTRINGPARAM(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version")
":Version:OOOPackageVersion}"));
- ::rtl::Bootstrap::expandMacros(v);
- return ::dp_misc::compareVersions(v, version) != ::dp_misc::LESS;
+ ::rtl::Bootstrap::expandMacros(aVersion);
+ return ::dp_misc::compareVersions(aVersion, i_rVersion) != i_eOrder;
+}
+
+bool satisfiesMinimalVersion(::rtl::OUString const& i_rVersion)
+{
+ return lcl_versionIsNot(dp_misc::LESS, i_rVersion);
+}
+
+bool satisfiesMaximalVersion(::rtl::OUString const& i_rVersion)
+{
+ return lcl_versionIsNot(dp_misc::GREATER, i_rVersion);
}
}
@@ -81,14 +93,14 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
unsatisfied(n);
::sal_Int32 unsat = 0;
for (::sal_Int32 i = 0; i < n; ++i) {
- static char const minimalVersion[] = "OpenOffice.org-minimal-version";
+ static rtl::OUString const minimalVersion(
+ RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org-minimal-version"));
css::uno::Reference< css::xml::dom::XElement > e(
deps->item(i), css::uno::UNO_QUERY_THROW);
bool sat = false;
if (e->getNamespaceURI().equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM(xmlNamespace))
- && e->getTagName().equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(minimalVersion)))
+ && (e->getTagName() == minimalVersion))
{
sat = satisfiesMinimalVersion(
e->getAttribute(
@@ -99,28 +111,18 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
RTL_CONSTASCII_STRINGPARAM(
"OpenOffice.org-maximal-version")))
{
- ::rtl::OUString v(
- RTL_CONSTASCII_USTRINGPARAM(
- "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version")
- ":Version:OOOBaseVersion}"));
- ::rtl::Bootstrap::expandMacros(v);
- sat =
- ::dp_misc::compareVersions(
- v,
+ sat = satisfiesMaximalVersion(
e->getAttribute(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))))
- != ::dp_misc::GREATER;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
} else if (e->hasAttributeNS(
::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)),
- ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(minimalVersion))))
+ minimalVersion))
{
sat = satisfiesMinimalVersion(
e->getAttributeNS(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)),
- ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(minimalVersion))));
+ minimalVersion));
}
if (!sat) {
unsatisfied[unsat++] = e;
@@ -135,6 +137,7 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
::rtl::OUString sReason;
::rtl::OUString sValue;
::rtl::OUString sVersion(RTL_CONSTASCII_USTRINGPARAM("%VERSION"));
+ ::rtl::OUString sProductName(RTL_CONSTASCII_USTRINGPARAM("%PRODUCTNAME"));
if ( dependency->getNamespaceURI().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( xmlNamespace ) )
&& dependency->getTagName().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OpenOffice.org-minimal-version" ) ) )
@@ -164,6 +167,9 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
sal_Int32 nPos = sReason.indexOf( sVersion );
if ( nPos >= 0 )
sReason = sReason.replaceAt( nPos, sVersion.getLength(), sValue );
+ nPos = sReason.indexOf( sProductName );
+ if ( nPos >= 0 )
+ sReason = sReason.replaceAt( nPos, sProductName.getLength(), BrandName::get() );
return sReason;
}
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 0efc0ae091..f42f2365a1 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -128,7 +128,7 @@ class ExtensionDescription
public:
/**throws an exception if the description.xml is not
available, cannot be read, does not contain the expected data,
- or any other error occured. Therefore it shoult only be used with
+ or any other error occurred. Therefore it shoult only be used with
new extensions.
Throws com::sun::star::uno::RuntimeException,
@@ -167,7 +167,6 @@ class FileDoesNotExistFilter
css::task::XInteractionHandler >
{
- //css::uno::Reference<css::task::XInteractionHandler> m_xHandler;
bool m_bExist;
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnv;
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index f0ac23d2fb..fd607888e1 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -160,7 +160,7 @@ bool compareExtensionFolderWithLastSynchronizedFile(
}
else if (err1 != ::osl::File::E_None)
{
- OSL_ENSURE(0, "Cannot access extension folder");
+ OSL_FAIL("Cannot access extension folder");
return true; //sync just in case
}
@@ -174,7 +174,7 @@ bool compareExtensionFolderWithLastSynchronizedFile(
}
else if (err2 != ::osl::File::E_None)
{
- OSL_ENSURE(0, "Cannot access file lastsynchronized");
+ OSL_FAIL("Cannot access file lastsynchronized");
return true; //sync just in case
}
@@ -389,7 +389,7 @@ bool office_is_running()
}
else
{
- OSL_ENSURE(0, "NOT osl_Process_E_None ");
+ OSL_FAIL("NOT osl_Process_E_None ");
//if osl_getExecutable file than we take the risk of creating a pipe
ret = existsOfficePipe();
}
@@ -419,7 +419,7 @@ oslProcess raiseProcess(
case osl_Process_E_NotFound:
throw RuntimeException( OUSTR("image not found!"), 0 );
case osl_Process_E_TimedOut:
- throw RuntimeException( OUSTR("timout occured!"), 0 );
+ throw RuntimeException( OUSTR("timout occurred!"), 0 );
case osl_Process_E_NoPermission:
throw RuntimeException( OUSTR("permission denied!"), 0 );
case osl_Process_E_Unknown:
diff --git a/desktop/source/deployment/misc/dp_misc.hrc b/desktop/source/deployment/misc/dp_misc.hrc
index e5d749fc62..e5d749fc62 100644..100755
--- a/desktop/source/deployment/misc/dp_misc.hrc
+++ b/desktop/source/deployment/misc/dp_misc.hrc
diff --git a/desktop/source/deployment/misc/dp_misc.src b/desktop/source/deployment/misc/dp_misc.src
index 78e87c2078..a6d1441d2a 100644
--- a/desktop/source/deployment/misc/dp_misc.src
+++ b/desktop/source/deployment/misc/dp_misc.src
@@ -32,9 +32,9 @@ String RID_DEPLYOMENT_DEPENDENCIES_UNKNOWN {
};
String RID_DEPLYOMENT_DEPENDENCIES_MIN {
- Text[en-US] = "Extensions requires at least OpenOffice.org %VERSION";
+ Text[en-US] = "Extension requires at least %PRODUCTNAME %VERSION";
};
String RID_DEPLYOMENT_DEPENDENCIES_MAX {
- Text[en-US] = "Extension doesn't support versions greater than: OpenOffice.org %VERSION";
+ Text[en-US] = "Extension doesn't support versions greater than: %PRODUCTNAME %VERSION";
};
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index 0e67097df5..8bf9d179d4 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -38,6 +38,7 @@
#define PLATFORM_ALL "all"
#define PLATFORM_WIN_X86 "windows_x86"
+#define PLATFORM_WIN_X86_64 "windows_x86_64"
#define PLATFORM_LINUX_X86 "linux_x86"
#define PLATFORM_LINUX_X86_64 "linux_x86_64"
#define PLATFORM_KFREEBSD_X86 "kfreebsd_x86"
@@ -70,6 +71,8 @@
#define PLATFORM_OS2_X86 "os2_x86"
#define PLATFORM_OPENBSD_X86 "openbsd_x86"
#define PLATFORM_OPENBSD_X86_64 "openbsd_x86_64"
+#define PLATFORM_DRAGONFLY_X86 "dragonfly_x86"
+#define PLATFORM_DRAGONFLY_X86_64 "dragonfly_x86_64"
#define PLATFORM_AIX_POWERPC "aix_powerpc"
@@ -113,9 +116,7 @@ namespace
::rtl::OUStringBuffer buf;
buf.append( StrOperatingSystem::get() );
buf.append( static_cast<sal_Unicode>('_') );
- OUString arch( RTL_CONSTASCII_USTRINGPARAM("$_ARCH") );
- ::rtl::Bootstrap::expandMacros( arch );
- buf.append( arch );
+ buf.append( StrCPU::get() );
return buf.makeStringAndClear();
}
};
@@ -133,6 +134,8 @@ namespace
ret = true;
else if (token.equals(OUSTR(PLATFORM_WIN_X86)))
ret = checkOSandCPU(OUSTR("Windows"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_WIN_X86_64)))
+ ret = checkOSandCPU(OUSTR("Windows"), OUSTR("x86_64"));
else if (token.equals(OUSTR(PLATFORM_LINUX_X86)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("x86"));
else if (token.equals(OUSTR(PLATFORM_LINUX_X86_64)))
@@ -193,9 +196,13 @@ namespace
ret = checkOSandCPU(OUSTR("OpenBSD"), OUSTR("x86"));
else if (token.equals(OUSTR(PLATFORM_OPENBSD_X86_64)))
ret = checkOSandCPU(OUSTR("OpenBSD"), OUSTR("X86_64"));
+ else if (token.equals(OUSTR(PLATFORM_DRAGONFLY_X86)))
+ ret = checkOSandCPU(OUSTR("DragonFly"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_DRAGONFLY_X86_64)))
+ ret = checkOSandCPU(OUSTR("DragonFly"), OUSTR("X86_64"));
else
{
- OSL_ENSURE(0, "Extension Manager: The extension supports an unknown platform. "
+ OSL_FAIL("Extension Manager: The extension supports an unknown platform. "
"Check the platform element in the description.xml");
ret = false;
}
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index eb92eabba3..c8c57ac01d 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -72,14 +72,14 @@ osl::Mutex s_mutex;
} // anon namespace
//==============================================================================
-ResId getResId( USHORT id )
+ResId getResId( sal_uInt16 id )
{
const osl::MutexGuard guard( s_mutex );
return ResId( id, *DeploymentResMgr::get() );
}
//==============================================================================
-String getResourceString( USHORT id )
+String getResourceString( sal_uInt16 id )
{
const osl::MutexGuard guard( s_mutex );
String ret( ResId( id, *DeploymentResMgr::get() ) );
diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx
index 170a403ddc..cbfde03cc8 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.cxx
@@ -161,7 +161,7 @@ bool create_folder(
}
catch (CommandFailedException &) {
// Interaction Handler already handled the error
- // that has occured...
+ // that has occurred...
}
catch (Exception &) {
if (throw_exc)
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index 531409f063..b22c4c5a60 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -98,7 +98,7 @@ void getOwnUpdateInfos(
bool & out_allFound)
{
bool allHaveOwnUpdateInformation = true;
- for (UpdateInfoMap::iterator i = inout_map.begin(); i != inout_map.end(); i++)
+ for (UpdateInfoMap::iterator i = inout_map.begin(); i != inout_map.end(); ++i)
{
OSL_ASSERT(i->second.extension.is());
Sequence<OUString> urls(i->second.extension->getUpdateInformationURLs());
@@ -187,11 +187,9 @@ void getDefaultUpdateInfos(
bool containsBundledOnly(Sequence<Reference<deployment::XPackage> > const & sameIdExtensions)
{
OSL_ASSERT(sameIdExtensions.getLength() == 3);
- if (!sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is())
- return true;
- else
- return false;
+ return !sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is();
}
+
/** Returns true if the list of extensions are bundled extensions and there are no
other extensions with the same identifier in the shared or user repository.
If extensionList is NULL, then it is checked if there are only bundled extensions.
@@ -205,17 +203,12 @@ bool onlyBundledExtensions(
if (extensionList)
{
typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT;
- for (CIT i = extensionList->begin(); i != extensionList->end(); i++)
+ for (CIT i(extensionList->begin()), aEnd(extensionList->end()); onlyBundled && i != aEnd; ++i)
{
Sequence<Reference<deployment::XPackage> > seqExt = xExtMgr->getExtensionsWithSameIdentifier(
dp_misc::getIdentifier(*i), (*i)->getName(), Reference<ucb::XCommandEnvironment>());
- if (!containsBundledOnly(seqExt))
- {
- onlyBundled = false;
- break;
- }
-
+ onlyBundled = containsBundledOnly(seqExt);
}
}
else
@@ -223,13 +216,9 @@ bool onlyBundledExtensions(
const uno::Sequence< uno::Sequence< Reference<deployment::XPackage > > > seqAllExt =
xExtMgr->getAllExtensions(Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>());
- for (int pos = seqAllExt.getLength(); pos --; )
+ for (int pos(0), nLen(seqAllExt.getLength()); onlyBundled && pos != nLen; ++pos)
{
- if (!containsBundledOnly(seqAllExt[pos]))
- {
- onlyBundled = false;
- break;
- }
+ onlyBundled = containsBundledOnly(seqAllExt[pos]);
}
}
return onlyBundled;
@@ -282,14 +271,6 @@ UPDATE_SOURCE isUpdateUserExtension(
retVal = UPDATE_SOURCE_ONLINE;
}
- //No update for bundled extensions, they are updated only by the setup
- //else if (bundledVersion.getLength())
- //{
- // int index = determineHighestVersion(
- // OUString(), OUString(), bundledVersion, onlineVersion);
- // if (index == 3)
- // retVal = UPDATE_SOURCE_ONLINE;
- //}
}
else
{
@@ -328,14 +309,6 @@ UPDATE_SOURCE isUpdateSharedExtension(
else if (index == 3)
retVal = UPDATE_SOURCE_ONLINE;
}
- //No update for bundled extensions, they are updated only by the setup
- //else if (bundledVersion.getLength())
- //{
- // int index = determineHighestVersion(
- // OUString(), OUString(), bundledVersion, onlineVersion);
- // if (index == 3)
- // retVal = UPDATE_SOURCE_ONLINE;
- //}
return retVal;
}
@@ -403,18 +376,20 @@ UpdateInfoMap getOnlineUpdateInfos(
UpdateInfoMap::value_type(
dp_misc::getIdentifier(extension), UpdateInfo(extension)));
OSL_ASSERT(insertRet.second == true);
+ (void)insertRet;
}
}
else
{
typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT;
- for (CIT i = extensionList->begin(); i != extensionList->end(); i++)
+ for (CIT i = extensionList->begin(); i != extensionList->end(); ++i)
{
OSL_ASSERT(i->is());
std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert(
UpdateInfoMap::value_type(
dp_misc::getIdentifier(*i), UpdateInfo(*i)));
OSL_ASSERT(insertRet.second == true);
+ (void)insertRet;
}
}
diff --git a/desktop/source/deployment/misc/makefile.mk b/desktop/source/deployment/misc/makefile.mk
index 3e4bd68cb4..3e4bd68cb4 100644..100755
--- a/desktop/source/deployment/misc/makefile.mk
+++ b/desktop/source/deployment/misc/makefile.mk
diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
index 09f06638ec..b103fe46ef 100644
--- a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
+++ b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
@@ -83,26 +83,29 @@ OUString ComponentBackendDb::getKeyElementName()
void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> componentNode = writeKeyElement(url);
- writeSimpleElement(OUSTR("java-type-library"),
- OUString::valueOf((sal_Bool) data.javaTypeLibrary),
- componentNode);
-
- writeSimpleList(
- data.implementationNames,
- OUSTR("implementation-names"),
- OUSTR("name"),
- componentNode);
-
- writeVectorOfPair(
- data.singletons,
- OUSTR("singletons"),
- OUSTR("item"),
- OUSTR("key"),
- OUSTR("value"),
- componentNode);
-
- save();
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> componentNode = writeKeyElement(url);
+ writeSimpleElement(OUSTR("java-type-library"),
+ OUString::valueOf((sal_Bool) data.javaTypeLibrary),
+ componentNode);
+
+ writeSimpleList(
+ data.implementationNames,
+ OUSTR("implementation-names"),
+ OUSTR("name"),
+ componentNode);
+
+ writeVectorOfPair(
+ data.singletons,
+ OUSTR("singletons"),
+ OUSTR("item"),
+ OUSTR("key"),
+ OUSTR("value"),
+ componentNode);
+
+ save();
+ }
}
catch(css::uno::Exception &)
{
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index b1e22d35c0..096d84f502 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -55,7 +55,7 @@
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/util/XMacroExpander.hpp"
#include <list>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
#include <memory>
#include <algorithm>
@@ -66,6 +66,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using ::rtl::OUString;
+namespace css = com::sun::star;
namespace dp_registry {
namespace backend {
@@ -122,14 +123,15 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
BackendImpl * getMyBackend() const;
const OUString m_loader;
- ComponentBackendDb::Data m_registeredComponentsDb;
-
+
enum reg {
REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED
} m_registered;
- Reference<loader::XImplementationLoader> getComponentInfo(
- t_stringlist * pImplNames, t_stringpairvec * pSingletons,
+ void getComponentInfo(
+ ComponentBackendDb::Data * data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > *
+ factories,
Reference<XComponentContext> const & xContext );
virtual void SAL_CALL disposing();
@@ -161,7 +163,31 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & identifier);
};
friend class ComponentPackageImpl;
-
+
+ class ComponentsPackageImpl : public ::dp_registry::backend::Package
+ {
+ BackendImpl * getMyBackend() const;
+
+ // Package
+ virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
+ ::osl::ResettableMutexGuard & guard,
+ ::rtl::Reference<AbortChannel> const & abortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ virtual void processPackage_(
+ ::osl::ResettableMutexGuard & guard,
+ bool registerPackage,
+ bool startup,
+ ::rtl::Reference<AbortChannel> const & abortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ public:
+ ComponentsPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier);
+ };
+ friend class ComponentsPackageImpl;
+
class TypelibraryPackageImpl : public ::dp_registry::backend::Package
{
BackendImpl * getMyBackend() const;
@@ -192,18 +218,66 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & identifier);
};
friend class TypelibraryPackageImpl;
+
+ /** Serves for unregistering packages that were registered on a
+ different platform. This can happen if one has remotely mounted
+ /home, for example.
+ */
+ class OtherPlatformPackageImpl : public ::dp_registry::backend::Package
+ {
+ public:
+ OtherPlatformPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier, OUString const& rPlatform);
+
+ private:
+ BackendImpl * getMyBackend() const;
+
+ const Reference<registry::XSimpleRegistry> impl_openRDB() const;
+ const Reference<XInterface> impl_createInstance(OUString const& rService) const;
+
+ // Package
+ virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
+ ::osl::ResettableMutexGuard & guard,
+ ::rtl::Reference<AbortChannel> const & abortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ virtual void processPackage_(
+ ::osl::ResettableMutexGuard & guard,
+ bool registerPackage,
+ bool startup,
+ ::rtl::Reference<AbortChannel> const & abortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+
+ private:
+ OUString const m_aPlatform;
+ };
+ friend class OtherPlatformPackageImpl;
t_stringlist m_jar_typelibs;
t_stringlist m_rdb_typelibs;
- t_stringlist & getTypelibs( bool jar ) {
- return jar ? m_jar_typelibs : m_rdb_typelibs;
+ t_stringlist m_components;
+
+ enum RcItem { RCITEM_JAR_TYPELIB, RCITEM_RDB_TYPELIB, RCITEM_COMPONENTS };
+
+ t_stringlist & getRcItemList( RcItem kind ) {
+ switch (kind)
+ {
+ case RCITEM_JAR_TYPELIB:
+ return m_jar_typelibs;
+ case RCITEM_RDB_TYPELIB:
+ return m_rdb_typelibs;
+ default: // case RCITEM_COMPONENTS
+ return m_components;
+ }
}
bool m_unorc_inited;
bool m_unorc_modified;
bool bSwitchedRdbFiles;
- typedef ::std::hash_map< OUString, Reference<XInterface>,
+ typedef ::boost::unordered_map< OUString, Reference<XInterface>,
::rtl::OUStringHash > t_string2object;
t_string2object m_backendObjects;
@@ -218,6 +292,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
const Reference<deployment::XPackageTypeInfo> m_xDynComponentTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xJavaComponentTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xPythonComponentTypeInfo;
+ const Reference<deployment::XPackageTypeInfo> m_xComponentsTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xRDBTypelibTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xJavaTypelibTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
@@ -232,8 +307,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
std::auto_ptr<ComponentBackendDb> m_backendDb;
void addDataToDb(OUString const & url, ComponentBackendDb::Data const & data);
- void deleteDataFromDb(OUString const & url);
ComponentBackendDb::Data readDataFromDb(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
//These rdbs are for writing new service entries. The rdb files are copies
@@ -255,14 +330,32 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & id, Reference<XInterface> const & xObject );
void releaseObject( OUString const & id );
- bool addToUnoRc( bool jarFile, OUString const & url,
+ bool addToUnoRc( RcItem kind, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
- bool removeFromUnoRc( bool jarFile, OUString const & url,
+ bool removeFromUnoRc( RcItem kind, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
- bool hasInUnoRc( bool jarFile, OUString const & url );
+ bool hasInUnoRc( RcItem kind, OUString const & url );
+
+ css::uno::Reference< css::registry::XRegistryKey > openRegistryKey(
+ css::uno::Reference< css::registry::XRegistryKey > const & base,
+ rtl::OUString const & path);
+
+ void extractComponentData(
+ css::uno::Reference< css::uno::XComponentContext > const & context,
+ css::uno::Reference< css::registry::XRegistryKey > const & registry,
+ ComponentBackendDb::Data * data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
+ css::uno::Reference< css::loader::XImplementationLoader > const *
+ componentLoader,
+ rtl::OUString const * componentUrl);
+
+ void componentLiveInsertion(
+ ComponentBackendDb::Data const & data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > const &
+ factories);
+
+ void componentLiveRemoval(ComponentBackendDb::Data const & data);
-
-
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
@@ -271,6 +364,10 @@ public:
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
using PackageRegistryBackend::disposing;
//Will be called from ComponentPackageImpl
@@ -292,13 +389,7 @@ BackendImpl::ComponentPackageImpl::ComponentPackageImpl(
xPackageType, bRemoved, identifier),
m_loader( loader ),
m_registered( REG_UNINIT )
-{
- if (bRemoved)
- {
- m_registeredComponentsDb = getMyBackend()->readDataFromDb(url);
- }
-}
-
+{}
const Reference<registry::XSimpleRegistry>
BackendImpl::ComponentPackageImpl::getRDB() const
@@ -357,7 +448,6 @@ BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const
//______________________________________________________________________________
void BackendImpl::ComponentPackageImpl::disposing()
{
-// m_xRemoteContext.clear();
Package::disposing();
}
@@ -458,7 +548,6 @@ void BackendImpl::initServiceRdbFiles()
m_xComponentContext ), UNO_QUERY_THROW );
m_xCommonRDB->open(
makeURL( expandUnoRcUrl(getCachePath()), m_commonRDB ),
-// m_readOnly, !m_readOnly );
false, true);
}
if (m_nativeRDB.getLength() > 0) {
@@ -469,7 +558,6 @@ void BackendImpl::initServiceRdbFiles()
m_xComponentContext ), UNO_QUERY_THROW );
m_xNativeRDB->open(
makeURL( expandUnoRcUrl(getCachePath()), m_nativeRDB ),
-// m_readOnly, !m_readOnly );
false, true);
}
}
@@ -520,16 +608,14 @@ BackendImpl::BackendImpl(
getPlatformString(),
OUSTR("*" SAL_DLLEXTENSION),
getResourceString(RID_STR_DYN_COMPONENT),
- RID_IMG_COMPONENT,
- RID_IMG_COMPONENT_HC ) ),
+ RID_IMG_COMPONENT) ),
m_xJavaComponentTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-component;"
"type=Java"),
OUSTR("*.jar"),
getResourceString(RID_STR_JAVA_COMPONENT),
- RID_IMG_JAVA_COMPONENT,
- RID_IMG_JAVA_COMPONENT_HC ) ),
+ RID_IMG_JAVA_COMPONENT) ),
m_xPythonComponentTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-component;"
@@ -537,30 +623,35 @@ BackendImpl::BackendImpl(
OUSTR("*.py"),
getResourceString(
RID_STR_PYTHON_COMPONENT),
- RID_IMG_COMPONENT,
- RID_IMG_COMPONENT_HC ) ),
+ RID_IMG_COMPONENT ) ),
+ m_xComponentsTypeInfo( new Package::TypeInfo(
+ OUSTR("application/"
+ "vnd.sun.star.uno-components"),
+ OUSTR("*.components"),
+ getResourceString(RID_STR_COMPONENTS),
+ RID_IMG_COMPONENT ) ),
m_xRDBTypelibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-typelibrary;"
"type=RDB"),
OUSTR("*.rdb"),
getResourceString(RID_STR_RDB_TYPELIB),
- RID_IMG_TYPELIB, RID_IMG_TYPELIB_HC ) ),
+ RID_IMG_TYPELIB ) ),
m_xJavaTypelibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-typelibrary;"
"type=Java"),
OUSTR("*.jar"),
getResourceString(RID_STR_JAVA_TYPELIB),
- RID_IMG_JAVA_TYPELIB,
- RID_IMG_JAVA_TYPELIB_HC ) ),
- m_typeInfos( 5 )
+ RID_IMG_JAVA_TYPELIB ) ),
+ m_typeInfos( 6 )
{
m_typeInfos[ 0 ] = m_xDynComponentTypeInfo;
m_typeInfos[ 1 ] = m_xJavaComponentTypeInfo;
m_typeInfos[ 2 ] = m_xPythonComponentTypeInfo;
- m_typeInfos[ 3 ] = m_xRDBTypelibTypeInfo;
- m_typeInfos[ 4 ] = m_xJavaTypelibTypeInfo;
+ m_typeInfos[ 3 ] = m_xComponentsTypeInfo;
+ m_typeInfos[ 4 ] = m_xRDBTypelibTypeInfo;
+ m_typeInfos[ 5 ] = m_xJavaTypelibTypeInfo;
const Reference<XCommandEnvironment> xCmdEnv;
@@ -602,12 +693,6 @@ void BackendImpl::addDataToDb(
m_backendDb->addEntry(url, data);
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
-{
- if (m_backendDb.get())
- m_backendDb->removeEntry(url);
-}
-
ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url)
{
ComponentBackendDb::Data data;
@@ -616,6 +701,12 @@ ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url)
return data;
}
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
+}
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -624,6 +715,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -698,16 +797,30 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
INetContentTypeParameter const * param = params.find(
ByteString("platform") );
- if (param == 0 || platform_fits( param->m_sValue )) {
+ bool bPlatformFits(param == 0);
+ String aPlatform;
+ if (!bPlatformFits) // platform is specified, we have to check
+ {
+ aPlatform = param->m_sValue;
+ bPlatformFits = platform_fits(aPlatform);
+ }
+ // If the package is being removed, do not care whether
+ // platform fits. We won't be using it anyway.
+ if (bPlatformFits || bRemoved) {
param = params.find( ByteString("type") );
if (param != 0)
{
String const & value = param->m_sValue;
if (value.EqualsIgnoreCaseAscii("native")) {
- return new BackendImpl::ComponentPackageImpl(
- this, url, name, m_xDynComponentTypeInfo,
- OUSTR("com.sun.star.loader.SharedLibrary"),
- bRemoved, identifier);
+ if (bPlatformFits)
+ return new BackendImpl::ComponentPackageImpl(
+ this, url, name, m_xDynComponentTypeInfo,
+ OUSTR("com.sun.star.loader.SharedLibrary"),
+ bRemoved, identifier);
+ else
+ return new BackendImpl::OtherPlatformPackageImpl(
+ this, url, name, m_xDynComponentTypeInfo,
+ bRemoved, identifier, aPlatform);
}
if (value.EqualsIgnoreCaseAscii("Java")) {
return new BackendImpl::ComponentPackageImpl(
@@ -725,6 +838,17 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
}
}
else if (subType.EqualsIgnoreCaseAscii(
+ "vnd.sun.star.uno-components"))
+ {
+ INetContentTypeParameter const * param = params.find(
+ ByteString("platform") );
+ if (param == 0 || platform_fits( param->m_sValue )) {
+ return new BackendImpl::ComponentsPackageImpl(
+ this, url, name, m_xComponentsTypeInfo, bRemoved,
+ identifier);
+ }
+ }
+ else if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.uno-typelibrary"))
{
INetContentTypeParameter const * param = params.find(
@@ -752,7 +876,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
-//##############################################################################
//______________________________________________________________________________
void BackendImpl::unorc_verify_init(
@@ -817,11 +940,50 @@ void BackendImpl::unorc_verify_init(
while (index >= 0);
}
if (readLine( &line, OUSTR("UNO_SERVICES="), ucb_content,
- RTL_TEXTENCODING_UTF8 )) {
- sal_Int32 start = sizeof ("UNO_SERVICES=?$ORIGIN/") - 1;
- sal_Int32 sep = line.indexOf( ' ', start );
- OSL_ASSERT( sep > 0 );
- m_commonRDB_RO = line.copy( start, sep - start );
+ RTL_TEXTENCODING_UTF8 ))
+ {
+ // The UNO_SERVICES line always has the BNF form
+ // "UNO_SERVICES="
+ // ("?$ORIGIN/" <common-rdb>)? -- first
+ // "${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}"? -- second
+ // ("?" ("BUNDLED_EXTENSIONS" | -- third
+ // "UNO_SHARED_PACKAGES_CACHE" | "UNO_USER_PACKAGES_CACHE")
+ // ...)*
+ // so can unambiguously be split into its thre parts:
+ int state = 1;
+ for (sal_Int32 i = RTL_CONSTASCII_LENGTH("UNO_SERVICES=");
+ i >= 0;)
+ {
+ rtl::OUString token(line.getToken(0, ' ', i));
+ if (token.getLength() != 0)
+ {
+ if (state == 1 &&
+ token.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("?$ORIGIN/")))
+ {
+ m_commonRDB_RO = token.copy(
+ RTL_CONSTASCII_LENGTH("?$ORIGIN/"));
+ state = 2;
+ }
+ else if (state <= 2 &&
+ token.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(
+ "${$ORIGIN/${_OS}_${_ARCH}rc:"
+ "UNO_SERVICES}")))
+ {
+ state = 3;
+ }
+ else
+ {
+ if (token[0] == '?')
+ {
+ token = token.copy(1);
+ }
+ m_components.push_back(token);
+ state = 3;
+ }
+ }
+ }
}
// native rc:
@@ -897,16 +1059,27 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
OUString sCommonRDB(m_commonRDB.getLength() > 0 ? m_commonRDB : m_commonRDB_RO);
OUString sNativeRDB(m_nativeRDB.getLength() > 0 ? m_nativeRDB : m_nativeRDB_RO);
- if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0)
+ if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0 ||
+ !m_components.empty())
{
- buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
- buf.append( ::rtl::OUStringToOString(
- sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=") );
+ bool space = false;
+ if (sCommonRDB.getLength() > 0)
+ {
+ buf.append( RTL_CONSTASCII_STRINGPARAM("?$ORIGIN/") );
+ buf.append( ::rtl::OUStringToOString(
+ sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+ space = true;
+ }
if (sNativeRDB.getLength() > 0)
{
+ if (space)
+ {
+ buf.append(' ');
+ }
buf.append( RTL_CONSTASCII_STRINGPARAM(
- " ${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
- buf.append(LF);
+ "${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
+ space = true;
// write native rc:
::rtl::OStringBuffer buf2;
@@ -928,6 +1101,18 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
xCmdEnv );
ucb_content.writeStream( xData, true /* replace existing */ );
}
+ for (t_stringlist::iterator i(m_components.begin());
+ i != m_components.end(); ++i)
+ {
+ if (space)
+ {
+ buf.append(' ');
+ }
+ buf.append('?');
+ buf.append(rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8));
+ space = true;
+ }
+ buf.append(LF);
}
// write unorc:
@@ -944,13 +1129,13 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
}
//______________________________________________________________________________
-bool BackendImpl::addToUnoRc( bool jarFile, OUString const & url_,
+bool BackendImpl::addToUnoRc( RcItem kind, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
unorc_verify_init( xCmdEnv );
- t_stringlist & rSet = getTypelibs(jarFile);
+ t_stringlist & rSet = getRcItemList(kind);
if (::std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
rSet.push_front( rcterm ); // prepend to list, thus overriding
// write immediately:
@@ -964,13 +1149,13 @@ bool BackendImpl::addToUnoRc( bool jarFile, OUString const & url_,
//______________________________________________________________________________
bool BackendImpl::removeFromUnoRc(
- bool jarFile, OUString const & url_,
+ RcItem kind, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
unorc_verify_init( xCmdEnv );
- getTypelibs(jarFile).remove( rcterm );
+ getRcItemList(kind).remove( rcterm );
// write immediately:
m_unorc_modified = true;
unorc_flush( xCmdEnv );
@@ -979,22 +1164,215 @@ bool BackendImpl::removeFromUnoRc(
//______________________________________________________________________________
bool BackendImpl::hasInUnoRc(
- bool jarFile, OUString const & url_ )
+ RcItem kind, OUString const & url_ )
{
const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
- t_stringlist const & rSet = getTypelibs(jarFile);
+ t_stringlist const & rSet = getRcItemList(kind);
return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end();
}
+css::uno::Reference< css::registry::XRegistryKey > BackendImpl::openRegistryKey(
+ css::uno::Reference< css::registry::XRegistryKey > const & base,
+ rtl::OUString const & path)
+{
+ OSL_ASSERT(base.is());
+ css::uno::Reference< css::registry::XRegistryKey > key(base->openKey(path));
+ if (!key.is()) {
+ throw css::deployment::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("missing registry entry ")) +
+ path + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" under ")) +
+ base->getKeyName()),
+ static_cast< OWeakObject * >(this), Any());
+ }
+ return key;
+}
+
+void BackendImpl::extractComponentData(
+ css::uno::Reference< css::uno::XComponentContext > const & context,
+ css::uno::Reference< css::registry::XRegistryKey > const & registry,
+ ComponentBackendDb::Data * data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
+ css::uno::Reference< css::loader::XImplementationLoader > const *
+ componentLoader,
+ rtl::OUString const * componentUrl)
+{
+ OSL_ASSERT(context.is() && registry.is() && data != 0 && factories != 0);
+ rtl::OUString registryName(registry->getKeyName());
+ sal_Int32 prefix = registryName.getLength();
+ if (!registryName.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) {
+ prefix += RTL_CONSTASCII_LENGTH("/");
+ }
+ css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+ keys(registry->openKeys());
+ css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
+ context->getServiceManager(), css::uno::UNO_QUERY_THROW);
+ for (sal_Int32 i = 0; i < keys.getLength(); ++i) {
+ rtl::OUString name(keys[i]->getKeyName().copy(prefix));
+ data->implementationNames.push_back(name);
+ css::uno::Reference< css::registry::XRegistryKey > singletons(
+ keys[i]->openKey(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO/SINGLETONS"))));
+ if (singletons.is()) {
+ sal_Int32 prefix2 = keys[i]->getKeyName().getLength() +
+ RTL_CONSTASCII_LENGTH("/UNO/SINGLETONS/");
+ css::uno::Sequence<
+ css::uno::Reference< css::registry::XRegistryKey > >
+ singletonKeys(singletons->openKeys());
+ for (sal_Int32 j = 0; j < singletonKeys.getLength(); ++j) {
+ data->singletons.push_back(
+ std::pair< rtl::OUString, rtl::OUString >(
+ singletonKeys[j]->getKeyName().copy(prefix2), name));
+ }
+ }
+ css::uno::Reference< css::loader::XImplementationLoader > loader;
+ if (componentLoader == 0) {
+ rtl::OUString activator(
+ openRegistryKey(
+ keys[i],
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("UNO/ACTIVATOR")))->
+ getAsciiValue());
+ loader.set(
+ smgr->createInstanceWithContext(activator, context),
+ css::uno::UNO_QUERY);
+ if (!loader.is()) {
+ throw css::deployment::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot instantiate loader ")) +
+ activator),
+ static_cast< OWeakObject * >(this), Any());
+ }
+ } else {
+ OSL_ASSERT(componentLoader->is());
+ loader = *componentLoader;
+ }
+ factories->push_back(
+ loader->activate(
+ name, rtl::OUString(),
+ (componentUrl == 0
+ ? (openRegistryKey(
+ keys[i],
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("UNO/LOCATION")))->
+ getAsciiValue())
+ : *componentUrl),
+ keys[i]));
+ }
+}
+
+void BackendImpl::componentLiveInsertion(
+ ComponentBackendDb::Data const & data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > const &
+ factories)
+{
+ css::uno::Reference< css::container::XSet > set(
+ getComponentContext()->getServiceManager(), css::uno::UNO_QUERY_THROW);
+ std::vector< css::uno::Reference< css::uno::XInterface > >::const_iterator
+ factory(factories.begin());
+ for (t_stringlist::const_iterator i(data.implementationNames.begin());
+ i != data.implementationNames.end(); ++i)
+ {
+ try {
+ set->insert(css::uno::Any(*factory++));
+ } catch (container::ElementExistException &) {
+ OSL_TRACE(
+ "implementation %s already registered",
+ rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+ if (!data.singletons.empty()) {
+ css::uno::Reference< css::container::XNameContainer >
+ rootContext(
+ getComponentContext()->getValueByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_root"))),
+ css::uno::UNO_QUERY);
+ if (rootContext.is()) {
+ for (t_stringpairvec::const_iterator i(data.singletons.begin());
+ i != data.singletons.end(); ++i)
+ {
+ rtl::OUString name(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/")) +
+ i->first);
+ try {
+ rootContext->removeByName(
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/arguments")));
+ } catch (container::NoSuchElementException &) {}
+ try {
+ rootContext->insertByName(
+ (name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/service"))),
+ css::uno::Any(i->second));
+ } catch (container::ElementExistException &) {
+ rootContext->replaceByName(
+ (name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/service"))),
+ css::uno::Any(i->second));
+ }
+ try {
+ rootContext->insertByName(name, css::uno::Any());
+ } catch (container::ElementExistException &) {
+ OSL_TRACE(
+ "singleton %s already registered",
+ rtl::OUStringToOString(
+ i->first, RTL_TEXTENCODING_UTF8).getStr());
+ rootContext->replaceByName(name, css::uno::Any());
+ }
+ }
+ }
+ }
+}
+
+void BackendImpl::componentLiveRemoval(ComponentBackendDb::Data const & data) {
+ css::uno::Reference< css::container::XSet > set(
+ getComponentContext()->getServiceManager(), css::uno::UNO_QUERY_THROW);
+ for (t_stringlist::const_iterator i(data.implementationNames.begin());
+ i != data.implementationNames.end(); ++i)
+ {
+ try {
+ set->remove(css::uno::Any(*i));
+ } catch (css::container::NoSuchElementException &) {
+ // ignore if factory has not been live deployed
+ }
+ }
+ if (!data.singletons.empty()) {
+ css::uno::Reference< css::container::XNameContainer > rootContext(
+ getComponentContext()->getValueByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_root"))),
+ css::uno::UNO_QUERY);
+ if (rootContext.is()) {
+ for (t_stringpairvec::const_iterator i(data.singletons.begin());
+ i != data.singletons.end(); ++i)
+ {
+ rtl::OUString name(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/")) +
+ i->first);
+ try {
+ rootContext->removeByName(
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/arguments")));
+ rootContext->removeByName(
+ name +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/service")));
+ rootContext->removeByName(name);
+ } catch (container::NoSuchElementException &) {}
+ }
+ }
+ }
+}
+
//______________________________________________________________________________
void BackendImpl::releaseObject( OUString const & id )
{
const ::osl::MutexGuard guard( getMutex() );
- if ( m_backendObjects.erase( id ) != 1 )
- {
- OSL_ASSERT( false );
- }
+ m_backendObjects.erase( id );
}
//______________________________________________________________________________
@@ -1077,66 +1455,45 @@ Reference<XComponentContext> raise_uno_process(
}
//------------------------------------------------------------------------------
-Reference<loader::XImplementationLoader>
-BackendImpl::ComponentPackageImpl::getComponentInfo(
- t_stringlist * pImplNames, t_stringpairvec * pSingletons,
+void BackendImpl::ComponentPackageImpl::getComponentInfo(
+ ComponentBackendDb::Data * data,
+ std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
Reference<XComponentContext> const & xContext )
{
const Reference<loader::XImplementationLoader> xLoader(
xContext->getServiceManager()->createInstanceWithContext(
m_loader, xContext ), UNO_QUERY );
if (! xLoader.is())
- return Reference<loader::XImplementationLoader>();
+ {
+ throw css::deployment::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot instantiate loader ")) +
+ m_loader),
+ static_cast< OWeakObject * >(this), Any());
+ }
// HACK: highly dependent on stoc/source/servicemanager
// and stoc/source/implreg implementation which rely on the same
// services.rdb format!
-
+ // .../UNO/LOCATION and .../UNO/ACTIVATOR appear not to be written by
+ // writeRegistryInfo, however, but are knwon, fixed values here, so
+ // can be passed into extractComponentData
+ rtl::OUString url(getURL());
const Reference<registry::XSimpleRegistry> xMemReg(
xContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.registry.SimpleRegistry"), xContext ),
UNO_QUERY_THROW );
xMemReg->open( OUString() /* in mem */, false, true );
- xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), getURL() );
-
- const Sequence< Reference<registry::XRegistryKey> > keys(
- xMemReg->getRootKey()->openKeys() );
- for ( sal_Int32 pos = keys.getLength(); pos--; )
- {
- Reference<registry::XRegistryKey> const & xImplKey = keys[ pos ];
- const OUString implName(
- xImplKey->getKeyName().copy( 1 /*leading slash*/ ) );
-
- // check for singletons:
- const Reference<registry::XRegistryKey> xSingletonKey(
- xImplKey->openKey( OUSTR("UNO/SINGLETONS") ) );
- if (xSingletonKey.is() && xSingletonKey->isValid())
- {
- const Sequence< Reference<registry::XRegistryKey> > singletonKeys(
- xSingletonKey->openKeys() );
- for ( sal_Int32 i = singletonKeys.getLength(); i--; )
- {
- Reference<registry::XRegistryKey> const & xSingleton =
- singletonKeys[ i ];
- pSingletons->push_back(
- ::std::pair<OUString, OUString>(
- xSingleton->getKeyName().copy(
- implName.getLength() +
- sizeof ("//UNO/SINGLETONS/") - 1 ),
- xSingleton->getStringValue() ) );
- }
- }
- else
- {
- pImplNames->push_back( implName );
- }
- }
-
- return xLoader;
+ xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), url );
+ getMyBackend()->extractComponentData(
+ xContext, xMemReg->getRootKey(), data, factories, &xLoader, &url);
}
// Package
//______________________________________________________________________________
+//We could use here BackendImpl::hasActiveEntry. However, this check is just as well.
+//And it also shows the problem if another extension has overwritten an implementation
+//entry, because it contains the same service implementation
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::ComponentPackageImpl::isRegistered_(
::osl::ResettableMutexGuard &,
@@ -1222,228 +1579,78 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- BackendImpl * that = getMyBackend();
-
-
- const bool java = m_loader.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") );
- const OUString url( getURL() );
- bool isJavaTypelib;
- if (m_bRemoved)
- isJavaTypelib = m_registeredComponentsDb.javaTypeLibrary;
- else
- isJavaTypelib = java &&
- !jarManifestHeaderPresent( url, OUSTR("UNO-Type-Path"), xCmdEnv );
-
- ComponentBackendDb::Data data;
- data.javaTypeLibrary = isJavaTypelib;
- if (doRegisterPackage)
- {
- Reference <uno::XComponentContext> context(that->getComponentContext());
- if (! startup)
- {
- context.set(
- that->getObject( url ), UNO_QUERY );
-
- if (! context.is()) {
+ BackendImpl * that = getMyBackend();
+ rtl::OUString url(getURL());
+ if (doRegisterPackage) {
+ ComponentBackendDb::Data data;
+ css::uno::Reference< css::uno::XComponentContext > context;
+ if (startup) {
+ context = that->getComponentContext();
+ } else {
+ context.set(that->getObject(url), css::uno::UNO_QUERY);
+ if (!context.is()) {
context.set(
- that->insertObject( url, raise_uno_process(
- that->getComponentContext(),
- abortChannel ) ),
- UNO_QUERY_THROW );
+ that->insertObject(
+ url,
+ raise_uno_process(
+ that->getComponentContext(), abortChannel)),
+ css::uno::UNO_QUERY_THROW);
}
}
-
- const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
- const Reference<registry::XImplementationRegistration> xImplReg(
+ css::uno::Reference< css::registry::XImplementationRegistration>(
context->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.registry.ImplementationRegistration"),
- context ), UNO_QUERY_THROW );
-
- xImplReg->registerImplementation( m_loader, url, xServicesRDB );
- //only write to unorc if registration was successful.
- //It may fail if there is no suitable java.
- if (isJavaTypelib)
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.registry.ImplementationRegistration")),
+ context),
+ css::uno::UNO_QUERY_THROW)->registerImplementation(
+ m_loader, url, getRDB());
+ // Only write to unorc after successful registration; it may fail if
+ // there is no suitable java
+ if (m_loader.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2")) &&
+ !jarManifestHeaderPresent(url, OUSTR("UNO-Type-Path"), xCmdEnv))
{
- that->addToUnoRc( java, url, xCmdEnv );
+ that->addToUnoRc(RCITEM_JAR_TYPELIB, url, xCmdEnv);
data.javaTypeLibrary = true;
}
-
- t_stringlist implNames;
- t_stringpairvec singletons;
- const Reference<loader::XImplementationLoader> xLoader(
- getComponentInfo( &implNames, &singletons, context ) );
- data.implementationNames = implNames;
- data.singletons = singletons;
-
- if (!startup)
- {
- // factories live insertion:
- const Reference<container::XSet> xSet(
- that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
- for ( t_stringlist::const_iterator iPos( implNames.begin() );
- iPos != implNames.end(); ++iPos )
- {
- checkAborted( abortChannel );
- OUString const & implName = *iPos;
- // activate factory:
- const Reference<XInterface> xFactory(
- xLoader->activate(
- implName, OUString(), url,
- xServicesRDB->getRootKey()->openKey(
- OUSTR("/IMPLEMENTATIONS/") + implName ) ) );
- try {
- xSet->insert( Any(xFactory) );
- } // ignore if factory has already been inserted:
- catch (container::ElementExistException &) {
- OSL_ENSURE( 0, "### factory already registered?" );
- }
- }
-
- if (! singletons.empty())
- {
- // singletons live insertion:
- const Reference<container::XNameContainer> xRootContext(
- that->getComponentContext()->getValueByName(
- OUSTR("_root") ), UNO_QUERY );
- if (xRootContext.is())
- {
- for ( t_stringpairvec::const_iterator iPos(
- singletons.begin() );
- iPos != singletons.end(); ++iPos )
- {
- ::std::pair<OUString, OUString> const & sp = *iPos;
- const OUString name( OUSTR("/singletons/") + sp.first );
- // assure no arguments:
- try {
- xRootContext->removeByName( name + OUSTR("/arguments"));
- } catch (container::NoSuchElementException &) {}
- // used service:
- try {
- xRootContext->insertByName(
- name + OUSTR("/service"), Any(sp.second) );
- } catch (container::ElementExistException &) {
- xRootContext->replaceByName(
- name + OUSTR("/service"), Any(sp.second) );
- }
- // singleton entry:
- try {
- xRootContext->insertByName( name, Any() );
- } catch (container::ElementExistException & exc) {
- (void) exc; // avoid warnings
- OSL_ENSURE(
- 0, OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- xRootContext->replaceByName( name, Any() );
- }
- }
- }
- }
+ std::vector< css::uno::Reference< css::uno::XInterface > > factories;
+ getComponentInfo(&data, &factories, context);
+ if (!startup) {
+ that->componentLiveInsertion(data, factories);
}
-
m_registered = REG_REGISTERED;
- getMyBackend()->addDataToDb(url, data);
- }
- else // revokePackage()
- {
- // set to VOID during revocation process:
+ that->addDataToDb(url, data);
+ } else { // revoke
m_registered = REG_VOID;
-
- //get the remote context. If it does not exist then use the local one
- Reference<XComponentContext> xContext(
- that->getObject( url ), UNO_QUERY );
- bool bRemoteContext = false;
- if (!xContext.is())
- xContext = that->getComponentContext();
- else
- bRemoteContext = true;
-
- t_stringlist implNames;
- t_stringpairvec singletons;
- if (m_bRemoved)
- {
- implNames = m_registeredComponentsDb.implementationNames;
- singletons = m_registeredComponentsDb.singletons;
+ ComponentBackendDb::Data data(that->readDataFromDb(url));
+ css::uno::Reference< css::uno::XComponentContext > context(
+ that->getObject(url), css::uno::UNO_QUERY);
+ bool remoteContext = context.is();
+ if (!remoteContext) {
+ context = that->getComponentContext();
}
- else
- {
- getComponentInfo( &implNames, &singletons, xContext );
+ if (!startup) {
+ that->componentLiveRemoval(data);
}
-
- if (!startup)
- {
- // factories live removal:
- const Reference<container::XSet> xSet(
- that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
- for ( t_stringlist::const_iterator iPos( implNames.begin() );
- iPos != implNames.end(); ++iPos )
- {
- OUString const & implName = *iPos;
- try {
- xSet->remove( Any(implName) );
- } // ignore if factory has not been live deployed:
- catch (container::NoSuchElementException &) {
- }
- }
-
- if (! singletons.empty())
- {
- // singletons live removal:
- const Reference<container::XNameContainer> xRootContext(
- that->getComponentContext()->getValueByName(
- OUSTR("_root") ), UNO_QUERY );
- if (xRootContext.is())
- {
- for ( t_stringpairvec::const_iterator iPos(
- singletons.begin() );
- iPos != singletons.end(); ++iPos )
- {
- ::std::pair<OUString, OUString> const & sp = *iPos;
- const OUString name( OUSTR("/singletons/") + sp.first );
- // arguments:
- try {
- xRootContext->removeByName( name + OUSTR("/arguments"));
- }
- catch (container::NoSuchElementException &) {}
- // used service:
- try {
- xRootContext->removeByName( name + OUSTR("/service") );
- }
- catch (container::NoSuchElementException &) {}
- // singleton entry:
- try {
- xRootContext->removeByName( name );
- }
- catch (container::NoSuchElementException & exc) {
- (void) exc; // avoid warnings
- OSL_ENSURE(
- 0, OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- }
- }
+ css::uno::Reference< css::registry::XImplementationRegistration >(
+ context->getServiceManager()->createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.registry.ImplementationRegistration")),
+ context),
+ css::uno::UNO_QUERY_THROW)->revokeImplementation(url, getRDB());
+ if (data.javaTypeLibrary) {
+ that->removeFromUnoRc(RCITEM_JAR_TYPELIB, url, xCmdEnv);
+ }
+ if (remoteContext) {
+ that->releaseObject(url);
}
-
- const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
- const Reference<registry::XImplementationRegistration> xImplReg(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.registry.ImplementationRegistration"),
- xContext ), UNO_QUERY_THROW );
- xImplReg->revokeImplementation( url, xServicesRDB );
-
- if (isJavaTypelib)
- that->removeFromUnoRc( java, url, xCmdEnv );
-
- if (bRemoteContext)
- that->releaseObject( url );
-
m_registered = REG_NOT_REGISTERED;
- getMyBackend()->deleteDataFromDb(url);
+ getMyBackend()->revokeEntryFromDb(url);
}
}
-//##############################################################################
BackendImpl::TypelibraryPackageImpl::TypelibraryPackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
@@ -1481,7 +1688,8 @@ BackendImpl::TypelibraryPackageImpl::isRegistered_(
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>(
- that->hasInUnoRc( m_jarFile, getURL() ),
+ that->hasInUnoRc(
+ m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB, getURL() ),
false /* IsAmbiguous */ ) );
}
@@ -1547,11 +1755,13 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_(
}
}
- that->addToUnoRc( m_jarFile, url, xCmdEnv );
+ that->addToUnoRc( m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB,
+ url, xCmdEnv );
}
else // revokePackage()
{
- that->removeFromUnoRc( m_jarFile, url, xCmdEnv );
+ that->removeFromUnoRc(
+ m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB, url, xCmdEnv );
// revoking types at runtime, possible, sensible?
if (!m_xTDprov.is())
@@ -1571,6 +1781,201 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_(
}
}
+BackendImpl::OtherPlatformPackageImpl::OtherPlatformPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier, OUString const& rPlatform)
+ : Package(myBackend, url, name, name, xPackageType, bRemoved, identifier)
+ , m_aPlatform(rPlatform)
+{
+ OSL_PRECOND(bRemoved, "this class can only be used for removing packages!");
+}
+
+BackendImpl *
+BackendImpl::OtherPlatformPackageImpl::getMyBackend() const
+{
+ BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
+ if (NULL == pBackend)
+ {
+ //Throws a DisposedException
+ check();
+ //We should never get here...
+ throw RuntimeException(
+ OUSTR("Failed to get the BackendImpl"),
+ static_cast<OWeakObject*>(const_cast<OtherPlatformPackageImpl*>(this)));
+ }
+ return pBackend;
+}
+
+Reference<registry::XSimpleRegistry> const
+BackendImpl::OtherPlatformPackageImpl::impl_openRDB() const
+{
+ OUString const aRDB(m_aPlatform + OUString(RTL_CONSTASCII_USTRINGPARAM(".rdb")));
+ OUString const aRDBPath(makeURL(getMyBackend()->getCachePath(), aRDB));
+
+ Reference<registry::XSimpleRegistry> xRegistry;
+
+ try
+ {
+ xRegistry.set(
+ impl_createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.SimpleRegistry"))),
+ UNO_QUERY)
+ ;
+ if (xRegistry.is())
+ xRegistry->open(expandUnoRcUrl(aRDBPath), false, false);
+ }
+ catch (registry::InvalidRegistryException const&)
+ {
+ // If the registry does not exist, we do not need to bother at all
+ xRegistry.set(0);
+ }
+
+ OSL_POSTCOND(xRegistry.is(), "could not create registry for the package's platform");
+ return xRegistry;
+}
+
+Reference<XInterface> const
+BackendImpl::OtherPlatformPackageImpl::impl_createInstance(OUString const& rService)
+const
+{
+ Reference<XComponentContext> const xContext(getMyBackend()->getComponentContext());
+ OSL_ASSERT(xContext.is());
+ Reference<XInterface> xService;
+ if (xContext.is())
+ xService.set(xContext->getServiceManager()->createInstanceWithContext(rService, xContext));
+ return xService;
+}
+
+beans::Optional<beans::Ambiguous<sal_Bool> >
+BackendImpl::OtherPlatformPackageImpl::isRegistered_(
+ ::osl::ResettableMutexGuard& /* guard */,
+ ::rtl::Reference<AbortChannel> const& /* abortChannel */,
+ Reference<XCommandEnvironment> const& /* xCmdEnv */ )
+{
+ return beans::Optional<beans::Ambiguous<sal_Bool> >(sal_True,
+ beans::Ambiguous<sal_Bool>(sal_True, sal_False));
+}
+
+void
+BackendImpl::OtherPlatformPackageImpl::processPackage_(
+ ::osl::ResettableMutexGuard& /* guard */,
+ bool bRegisterPackage,
+ bool /* bStartup */,
+ ::rtl::Reference<AbortChannel> const& /* abortChannel */,
+ Reference<XCommandEnvironment> const& /* xCmdEnv */)
+{
+ OSL_PRECOND(!bRegisterPackage, "this class can only be used for removing packages!");
+ (void) bRegisterPackage;
+
+ OUString const aURL(getURL());
+
+ Reference<registry::XSimpleRegistry> const xServicesRDB(impl_openRDB());
+ Reference<registry::XImplementationRegistration> const xImplReg(
+ impl_createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration"))),
+ UNO_QUERY)
+ ;
+ if (xImplReg.is() && xServicesRDB.is())
+ xImplReg->revokeImplementation(aURL, xServicesRDB);
+ if (xServicesRDB.is())
+ xServicesRDB->close();
+
+ getMyBackend()->revokeEntryFromDb(aURL);
+}
+
+BackendImpl * BackendImpl::ComponentsPackageImpl::getMyBackend() const
+{
+ BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
+ if (NULL == pBackend)
+ {
+ //Throws a DisposedException
+ check();
+ //We should never get here...
+ throw RuntimeException(
+ OUSTR("Failed to get the BackendImpl"),
+ static_cast<OWeakObject*>(const_cast<ComponentsPackageImpl *>(this)));
+ }
+ return pBackend;
+}
+
+beans::Optional< beans::Ambiguous<sal_Bool> >
+BackendImpl::ComponentsPackageImpl::isRegistered_(
+ ::osl::ResettableMutexGuard &,
+ ::rtl::Reference<AbortChannel> const &,
+ Reference<XCommandEnvironment> const & )
+{
+ return beans::Optional< beans::Ambiguous<sal_Bool> >(
+ true,
+ beans::Ambiguous<sal_Bool>(
+ getMyBackend()->hasInUnoRc(RCITEM_COMPONENTS, getURL()), false));
+}
+
+void BackendImpl::ComponentsPackageImpl::processPackage_(
+ ::osl::ResettableMutexGuard &,
+ bool doRegisterPackage,
+ bool startup,
+ ::rtl::Reference<AbortChannel> const & abortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv )
+{
+ BackendImpl * that = getMyBackend();
+ rtl::OUString url(getURL());
+ if (doRegisterPackage) {
+ ComponentBackendDb::Data data;
+ data.javaTypeLibrary = false;
+ std::vector< css::uno::Reference< css::uno::XInterface > > factories;
+ css::uno::Reference< css::uno::XComponentContext > context(
+ that->getObject(url), css::uno::UNO_QUERY);
+ if (!context.is()) {
+ context.set(
+ that->insertObject(
+ url,
+ raise_uno_process(
+ that->getComponentContext(), abortChannel)),
+ css::uno::UNO_QUERY_THROW);
+ }
+ css::uno::Reference< css::registry::XSimpleRegistry > registry(
+ css::uno::Reference< css::lang::XMultiComponentFactory >(
+ that->getComponentContext()->getServiceManager(),
+ css::uno::UNO_SET_THROW)->createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.registry.SimpleRegistry")),
+ that->getComponentContext()),
+ css::uno::UNO_QUERY_THROW);
+ registry->open(expandUnoRcUrl(url), true, false);
+ getMyBackend()->extractComponentData(
+ context,
+ that->openRegistryKey(
+ registry->getRootKey(),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IMPLEMENTATIONS"))),
+ &data, &factories, 0, 0);
+ registry->close();
+ if (!startup) {
+ that->componentLiveInsertion(data, factories);
+ }
+ that->addDataToDb(url, data);
+ that->addToUnoRc(RCITEM_COMPONENTS, url, xCmdEnv);
+ } else { // revoke
+ that->removeFromUnoRc(RCITEM_COMPONENTS, url, xCmdEnv);
+ if (!startup) {
+ that->componentLiveRemoval(that->readDataFromDb(url));
+ }
+ that->releaseObject(url);
+ that->revokeEntryFromDb(url);
+ }
+}
+
+BackendImpl::ComponentsPackageImpl::ComponentsPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier)
+ : Package( myBackend, url, name, name /* display-name */,
+ xPackageType, bRemoved, identifier)
+{}
+
} // anon namespace
namespace sdecl = comphelper::service_decl;
diff --git a/desktop/source/deployment/registry/component/dp_component.hrc b/desktop/source/deployment/registry/component/dp_component.hrc
index 5e9993ab12..82bb55068d 100644..100755
--- a/desktop/source/deployment/registry/component/dp_component.hrc
+++ b/desktop/source/deployment/registry/component/dp_component.hrc
@@ -33,6 +33,7 @@
#define RID_STR_DYN_COMPONENT (RID_DEPLOYMENT_COMPONENT_START+10)
#define RID_STR_JAVA_COMPONENT (RID_DEPLOYMENT_COMPONENT_START+11)
#define RID_STR_PYTHON_COMPONENT (RID_DEPLOYMENT_COMPONENT_START+12)
+#define RID_STR_COMPONENTS (RID_DEPLOYMENT_COMPONENT_START+13)
#define RID_STR_RDB_TYPELIB (RID_DEPLOYMENT_COMPONENT_START+20)
#define RID_STR_JAVA_TYPELIB (RID_DEPLOYMENT_COMPONENT_START+21)
diff --git a/desktop/source/deployment/registry/component/dp_component.src b/desktop/source/deployment/registry/component/dp_component.src
index 52dfa568eb..1b2a7c3641 100644
--- a/desktop/source/deployment/registry/component/dp_component.src
+++ b/desktop/source/deployment/registry/component/dp_component.src
@@ -42,6 +42,11 @@ String RID_STR_PYTHON_COMPONENT
Text [ en-US ] = "UNO Python Component";
};
+String RID_STR_COMPONENTS
+{
+ Text [ en-US ] = "UNO Components";
+};
+
String RID_STR_RDB_TYPELIB
{
Text [ en-US ] = "UNO RDB Type Library";
diff --git a/desktop/source/deployment/registry/component/makefile.mk b/desktop/source/deployment/registry/component/makefile.mk
index b7ee5c203c..b7ee5c203c 100644..100755
--- a/desktop/source/deployment/registry/component/makefile.mk
+++ b/desktop/source/deployment/registry/component/makefile.mk
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 2688a277f9..d3e8f349fd 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -132,16 +132,21 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
void configmgrini_verify_init(
Reference<XCommandEnvironment> const & xCmdEnv );
void configmgrini_flush( Reference<XCommandEnvironment> const & xCmdEnv );
-
- bool addToConfigmgrIni( bool isSchema, OUString const & url,
+
+ /* The paramter isURL is false in the case of adding the conf:ini-entry
+ value from the backend db. This entry already contains the path as it
+ is used in the configmgr.ini.
+ */
+ bool addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
bool removeFromConfigmgrIni( bool isSchema, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data);
::boost::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url);
- OUString deleteDataFromDb(OUString const & url);
- ::std::list<OUString> getAllIniEntries();
+ void revokeEntryFromDb(OUString const & url);
+ bool hasActiveEntry(OUString const & url);
+ bool activateEntry(OUString const & url);
public:
BackendImpl( Sequence<Any> const & args,
@@ -150,6 +155,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
using PackageRegistryBackend::disposing;
};
@@ -185,13 +193,13 @@ BackendImpl::BackendImpl(
"vnd.sun.star.configuration-data"),
OUSTR("*.xcu"),
getResourceString(RID_STR_CONF_DATA),
- RID_IMG_CONF_XML, RID_IMG_CONF_XML_HC ) ),
+ RID_IMG_CONF_XML ) ),
m_xConfSchemaTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.configuration-schema"),
OUSTR("*.xcs"),
getResourceString(RID_STR_CONF_SCHEMA),
- RID_IMG_CONF_XML, RID_IMG_CONF_XML_HC ) ),
+ RID_IMG_CONF_XML ) ),
m_typeInfos( 2 )
{
m_typeInfos[ 0 ] = m_xConfDataTypeInfo;
@@ -241,26 +249,24 @@ void BackendImpl::addDataToDb(
return data;
}
-OUString BackendImpl::deleteDataFromDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
- OUString url2(url);
- if (m_backendDb.get()) {
- boost::optional< ConfigurationBackendDb::Data > data(
- m_backendDb->getEntry(url));
- if (data) {
- url2 = expandUnoRcTerm(data->iniEntry);
- }
- m_backendDb->removeEntry(url);
- }
- return url2;
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
}
-::std::list<OUString> BackendImpl::getAllIniEntries()
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
- return m_backendDb->getAllIniEntries();
- else
- return ::std::list<OUString>();
+ return m_backendDb->hasActiveEntry(url);
+ return false;
+}
+
+bool BackendImpl::activateEntry(OUString const & url)
+{
+ if (m_backendDb.get())
+ return m_backendDb->activateEntry(url);
+ return false;
}
@@ -272,6 +278,13 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
//______________________________________________________________________________
@@ -342,7 +355,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
-//##############################################################################
//______________________________________________________________________________
void BackendImpl::configmgrini_verify_init(
@@ -458,10 +470,10 @@ void BackendImpl::configmgrini_flush(
}
//______________________________________________________________________________
-bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_,
+bool BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( dp_misc::makeRcTerm(url_) );
+ const OUString rcterm( isURL ? dp_misc::makeRcTerm(url_) : url_ );
const ::osl::MutexGuard guard( getMutex() );
configmgrini_verify_init( xCmdEnv );
t_stringlist & rSet = getFiles(isSchema);
@@ -506,10 +518,10 @@ bool BackendImpl::removeFromConfigmgrIni(
return true;
}
-//##############################################################################
// Package
//______________________________________________________________________________
+
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
@@ -535,7 +547,7 @@ BackendImpl::PackageImpl::isRegistered_(
const rtl::OUString url(getURL());
bool bReg = false;
- if (that->readDataFromDb(getURL()))
+ if (that->hasActiveEntry(getURL()))
bReg = true;
if (!bReg)
//fallback for user extension registered in berkeley DB
@@ -678,38 +690,48 @@ void BackendImpl::PackageImpl::processPackage_(
if (doRegisterPackage)
{
- ConfigurationBackendDb::Data data;
- if (!m_isSchema)
+ if (getMyBackend()->activateEntry(getURL()))
{
- const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
- bool out_replaced = false;
- url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced);
- if (out_replaced)
- data.dataUrl = sModFolder;
- else
- deleteTempFolder(sModFolder);
+ ::boost::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url);
+ OSL_ASSERT(data);
+ that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv );
}
- //No need for live-deployment for bundled extension, because OOo
- //restarts after installation
- if (that->m_eContext != CONTEXT_BUNDLED
- && !startup)
+ else
{
- if (m_isSchema)
+ ConfigurationBackendDb::Data data;
+ if (!m_isSchema)
{
- com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->insertExtensionXcsFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
+ bool out_replaced = false;
+ url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced);
+ if (out_replaced)
+ data.dataUrl = sModFolder;
+ else
+ deleteTempFolder(sModFolder);
}
- else
+ //No need for live-deployment for bundled extension, because OOo
+ //restarts after installation
+ if (that->m_eContext != CONTEXT_BUNDLED
+ && that->m_eContext != CONTEXT_BUNDLED_PREREG
+ && !startup)
{
- com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->insertExtensionXcuFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ if (m_isSchema)
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcsFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
+ else
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcuFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
}
+ that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv );
+ data.iniEntry = dp_misc::makeRcTerm(url);
+ that->addDataToDb(getURL(), data);
}
- that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
- data.iniEntry = dp_misc::makeRcTerm(url);
- that->addDataToDb(getURL(), data);
}
else // revoke
{
@@ -742,7 +764,7 @@ void BackendImpl::PackageImpl::processPackage_(
else
deleteTempFolder(sModFolder);
}
- that->addToConfigmgrIni(schema, url_replaced, xCmdEnv);
+ that->addToConfigmgrIni(schema, true, url_replaced, xCmdEnv);
data.iniEntry = dp_misc::makeRcTerm(url_replaced);
that->addDataToDb(url2, data);
}
@@ -760,12 +782,17 @@ void BackendImpl::PackageImpl::processPackage_(
OSL_ASSERT(0);
}
}
- url = that->deleteDataFromDb(url);
- if (!m_isSchema) {
+
+ ::boost::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url);
+ //If an xcu file was life deployed then always a data entry is written.
+ //If the xcu file was already in the configmr.ini then there is also
+ //a data entry
+ if (!m_isSchema && data)
+ {
com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->removeExtensionXcuFile(
- expandUnoRcUrl(url));
+ that->m_xComponentContext)->removeExtensionXcuFile(expandUnoRcTerm(data->iniEntry));
}
+ that->revokeEntryFromDb(url);
}
}
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.hrc b/desktop/source/deployment/registry/configuration/dp_configuration.hrc
index 479f50e20b..479f50e20b 100644..100755
--- a/desktop/source/deployment/registry/configuration/dp_configuration.hrc
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.hrc
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
index a0cafe0331..ecc09cb669 100644
--- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
@@ -84,12 +84,15 @@ OUString ConfigurationBackendDb::getKeyElementName()
void ConfigurationBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> helpNode
- = writeKeyElement(url);
-
- writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
- writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode);
- save();
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
+
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode);
+ save();
+ }
}
catch (css::deployment::DeploymentException& )
{
@@ -171,13 +174,6 @@ ConfigurationBackendDb::getEntry(::rtl::OUString const & url)
}
}
-::std::list<OUString> ConfigurationBackendDb::getAllIniEntries()
-{
- return getOneChildFromAllEntries(OUSTR("ini-entry"));
-}
-
-
-
} // namespace configuration
} // namespace backend
} // namespace dp_registry
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
index 7cb02edf55..a652184aec 100644
--- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
@@ -82,7 +82,6 @@ public:
::boost::optional<Data> getEntry(::rtl::OUString const & url);
::std::list< ::rtl::OUString> getAllDataUrls();
- ::std::list< ::rtl::OUString> getAllIniEntries();
};
diff --git a/desktop/source/deployment/registry/configuration/makefile.mk b/desktop/source/deployment/registry/configuration/makefile.mk
index 9bcbd50d42..9bcbd50d42 100644..100755
--- a/desktop/source/deployment/registry/configuration/makefile.mk
+++ b/desktop/source/deployment/registry/configuration/makefile.mk
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 957c55ef93..67141e7755 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -40,11 +40,13 @@
#include "ucbhelper/content.hxx"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
+#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
#include "com/sun/star/ucb/IOErrorCode.hpp"
#include "com/sun/star/beans/StringPair.hpp"
#include "com/sun/star/sdbc/XResultSet.hpp"
#include "com/sun/star/sdbc/XRow.hpp"
+#include "unotools/tempfile.hxx"
using namespace ::dp_misc;
@@ -100,6 +102,8 @@ PackageRegistryBackend::PackageRegistryBackend(
m_eContext = CONTEXT_BUNDLED;
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") ))
m_eContext = CONTEXT_TMP;
+ else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") ))
+ m_eContext = CONTEXT_BUNDLED_PREREG;
else if (m_context.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") ))
m_eContext = CONTEXT_DOCUMENT;
@@ -122,7 +126,7 @@ void PackageRegistryBackend::check()
void PackageRegistryBackend::disposing()
{
try {
- for ( t_string2ref::const_iterator i = m_bound.begin(); i != m_bound.end(); i++)
+ for ( t_string2ref::const_iterator i = m_bound.begin(); i != m_bound.end(); ++i)
i->second->removeEventListener(this);
m_bound.clear();
m_xComponentContext.clear();
@@ -223,42 +227,43 @@ OUString PackageRegistryBackend::createFolder(
OUString const & relUrl,
Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
- OUString sDataFolder = makeURL(getCachePath(), relUrl);
+ const OUString sDataFolder = makeURL(getCachePath(), relUrl);
//make sure the folder exist
ucbhelper::Content dataContent;
::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
- OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
-
- OUString tempEntry;
- if (::osl::File::createTempFile(
- &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None)
- throw RuntimeException(
- OUSTR("::osl::File::createTempFile() failed!"), 0 );
- tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
- OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_");
- ::ucbhelper::Content destFolderContent;
- dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv );
-
- return destFolder;
+ const OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
+ const String baseDir(sDataFolder);
+ const ::utl::TempFile aTemp(&baseDir, sal_True);
+ const OUString url = aTemp.GetURL();
+ return sDataFolder + url.copy(url.lastIndexOf('/'));
}
+//folderURL can have the extension .tmp or .tmp_
+//Before OOo 3.4 the created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
void PackageRegistryBackend::deleteTempFolder(
OUString const & folderUrl)
{
- OSL_ASSERT(folderUrl.getLength()
- && folderUrl[folderUrl.getLength() - 1] == '_');
- if (folderUrl.getLength()
- && folderUrl[folderUrl.getLength() - 1] == '_')
+ if (folderUrl.getLength())
{
- const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
erase_path( folderUrl, Reference<XCommandEnvironment>(),
false /* no throw: ignore errors */ );
- erase_path( tempFile, Reference<XCommandEnvironment>(),
- false /* no throw: ignore errors */ );
+
+ if (folderUrl[folderUrl.getLength() - 1] == '_')
+ {
+ const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
+ erase_path( tempFile, Reference<XCommandEnvironment>(),
+ false /* no throw: ignore errors */ );
+ }
}
}
+//usedFolders can contain folder names which have the extension .tmp or .tmp_
+//Before OOo 3.4 we created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
void PackageRegistryBackend::deleteUnusedFolders(
OUString const & relUrl,
::std::list< OUString> const & usedFolders)
@@ -271,11 +276,11 @@ void PackageRegistryBackend::deleteUnusedFolders(
Reference<sdbc::XResultSet> xResultSet(
tempFolder.createCursor(
Sequence<OUString>( &StrTitle::get(), 1 ),
- ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
+ ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
// get all temp directories:
::std::vector<OUString> tempEntries;
- char tmp[] = ".tmp";
+ const char tmp[] = ".tmp";
while (xResultSet->next())
{
@@ -284,21 +289,17 @@ void PackageRegistryBackend::deleteUnusedFolders(
xResultSet, UNO_QUERY_THROW )->getString(
1 /* Title */ ) );
- if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1))
+ if (title.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM(tmp)))
tempEntries.push_back(
makeURLAppendSysPathSegment(sDataFolder, title));
}
for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
{
- //usedFolders contains the urls to the folders which have
- //a trailing underscore
- const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_");
-
- if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) ==
+ if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) ==
usedFolders.end())
{
- deleteTempFolder(tempFolderName);
+ deleteTempFolder(tempEntries[pos]);
}
}
}
@@ -312,7 +313,6 @@ void PackageRegistryBackend::deleteUnusedFolders(
}
-//##############################################################################
//______________________________________________________________________________
Package::~Package()
@@ -524,6 +524,15 @@ OUString Package::getDescription() throw (
}
//______________________________________________________________________________
+OUString Package::getLicenseText() throw (
+ deployment::ExtensionRemovedException,RuntimeException)
+{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ return OUString();
+}
+
+//______________________________________________________________________________
Sequence<OUString> Package::getUpdateInformationURLs() throw (
deployment::ExtensionRemovedException, RuntimeException)
{
@@ -627,7 +636,7 @@ beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
catch (Exception &) {
Any exc( ::cppu::getCaughtException() );
throw deployment::DeploymentException(
- OUSTR("unexpected exception occured!"),
+ OUSTR("unexpected exception occurred!"),
static_cast<OWeakObject *>(this), exc );
}
}
@@ -669,7 +678,7 @@ void Package::processPackage_impl(
}
}
catch (RuntimeException &) {
- OSL_ENSURE( 0, "### unexpected RuntimeException!" );
+ OSL_FAIL( "### unexpected RuntimeException!" );
throw;
}
catch (CommandFailedException &) {
@@ -762,7 +771,6 @@ sal_Bool Package::isRemoved()
return m_bRemoved;
}
-//##############################################################################
//______________________________________________________________________________
Package::TypeInfo::~TypeInfo()
@@ -797,12 +805,19 @@ OUString Package::TypeInfo::getFileFilter() throw (RuntimeException)
}
//______________________________________________________________________________
-Any Package::TypeInfo::getIcon( sal_Bool highContrast, sal_Bool smallIcon )
+/**************************
+ * Get Icon
+ *
+ * @param highContrast NOTE: disabled the returning of high contrast icons.
+ * This bool is a noop now.
+ * @param smallIcon Return the small version of the icon
+ */
+Any Package::TypeInfo::getIcon( sal_Bool /*highContrast*/, sal_Bool smallIcon )
throw (RuntimeException)
{
if (! smallIcon)
return Any();
- const sal_uInt16 nIconId = (highContrast ? m_smallIcon_HC : m_smallIcon);
+ const sal_uInt16 nIconId = m_smallIcon;
return Any( &nIconId, getCppuType( static_cast<sal_uInt16 const *>(0) ) );
}
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx
index 730e848c50..4a84ee97c6 100644
--- a/desktop/source/deployment/registry/dp_backenddb.cxx
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -191,6 +191,74 @@ void BackendDb::removeEntry(::rtl::OUString const & url)
removeElement(sExpression.makeStringAndClear());
}
+void BackendDb::revokeEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ entry->setAttribute(OUSTR("revoked"), OUSTR("true"));
+ save();
+ }
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to revoke data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+bool BackendDb::activateEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ bool ret = false;
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ //no attribute "active" means it is active, that is, registered.
+ entry->removeAttribute(OUSTR("revoked"));
+ save();
+ ret = true;
+ }
+ return ret;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to revoke data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+bool BackendDb::hasActiveEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ bool ret = false;
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ OUString sActive = entry->getAttribute(OUSTR("revoked"));
+ if (!sActive.equals(OUSTR("true")))
+ ret = true;
+ }
+ return ret;
+
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to determine an active entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
Reference<css::xml::dom::XNode> BackendDb::getKeyElement(
::rtl::OUString const & url)
{
@@ -569,44 +637,43 @@ OUString BackendDb::readSimpleElement(
}
-
-//================================================================================
RegisteredDb::RegisteredDb(
Reference<XComponentContext> const & xContext,
::rtl::OUString const & url):BackendDb(xContext, url)
{
-
}
void RegisteredDb::addEntry(::rtl::OUString const & url)
{
try{
-
- const OUString sNameSpace = getDbNSName();
- const OUString sPrefix = getNSPrefix();
- const OUString sEntry = getKeyElementName();
-
- Reference<css::xml::dom::XDocument> doc = getDocument();
- Reference<css::xml::dom::XNode> root = doc->getFirstChild();
-
+ if (!activateEntry(url))
+ {
+ const OUString sNameSpace = getDbNSName();
+ const OUString sPrefix = getNSPrefix();
+ const OUString sEntry = getKeyElementName();
+
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
#if OSL_DEBUG_LEVEL > 0
- //There must not be yet an entry with the same url
- OUString sExpression(
- sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
- Reference<css::xml::dom::XNode> _extensionNode =
- getXPathAPI()->selectSingleNode(root, sExpression);
- OSL_ASSERT(! _extensionNode.is());
+ //There must not be yet an entry with the same url
+ OUString sExpression(
+ sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
+ Reference<css::xml::dom::XNode> _extensionNode =
+ getXPathAPI()->selectSingleNode(root, sExpression);
+ OSL_ASSERT(! _extensionNode.is());
#endif
- Reference<css::xml::dom::XElement> helpElement(
- doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry));
-
- helpElement->setAttribute(OUSTR("url"), url);
-
- Reference<css::xml::dom::XNode> helpNode(
- helpElement, UNO_QUERY_THROW);
- root->appendChild(helpNode);
-
- save();
+ Reference<css::xml::dom::XElement> helpElement(
+ doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry));
+
+ helpElement->setAttribute(OUSTR("url"), url);
+
+ Reference<css::xml::dom::XNode> helpNode(
+ helpElement, UNO_QUERY_THROW);
+ root->appendChild(helpNode);
+
+ save();
+ }
}
catch(css::uno::Exception &)
{
@@ -629,14 +696,10 @@ bool RegisteredDb::getEntry(::rtl::OUString const & url)
Reference<css::xml::dom::XNode> root = doc->getFirstChild();
Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
- //find the extension element that is to be removed
Reference<css::xml::dom::XNode> aNode =
xpathApi->selectSingleNode(root, sExpression);
- if (!aNode.is())
- {
- return false;
- }
- return true;
+
+ return aNode.is();
}
catch(css::uno::Exception &)
{
@@ -647,7 +710,6 @@ bool RegisteredDb::getEntry(::rtl::OUString const & url)
}
}
-
} // namespace backend
} // namespace dp_registry
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index a90f64b9cb..0b0f91a27f 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -50,9 +50,9 @@
#include "com/sun/star/util/XUpdatable.hpp"
#include "com/sun/star/container/XContentEnumerationAccess.hpp"
#include "com/sun/star/deployment/PackageRegistryBackend.hpp"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <set>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <memory>
using namespace ::dp_misc;
@@ -91,10 +91,10 @@ class PackageRegistryImpl : private MutexHolder, public t_helper
return str1.equalsIgnoreAsciiCase( str2 );
}
};
- typedef ::std::hash_map<
+ typedef ::boost::unordered_map<
OUString, Reference<deployment::XPackageRegistry>,
ci_string_hash, ci_string_equals > t_string2registry;
- typedef ::std::hash_map<
+ typedef ::boost::unordered_map<
OUString, OUString,
ci_string_hash, ci_string_equals > t_string2string;
typedef ::std::set<
@@ -136,6 +136,10 @@ public:
lang::IllegalArgumentException, RuntimeException);
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ RuntimeException);
+
};
//______________________________________________________________________________
@@ -186,11 +190,25 @@ OUString normalizeMediaType( OUString const & mediaType )
//______________________________________________________________________________
+void PackageRegistryImpl::packageRemoved(
+ ::rtl::OUString const & url, ::rtl::OUString const & mediaType)
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException)
+{
+ const t_string2registry::const_iterator i =
+ m_mediaType2backend.find(mediaType);
+
+ if (i != m_mediaType2backend.end())
+ {
+ i->second->packageRemoved(url, mediaType);
+ }
+}
+
void PackageRegistryImpl::insertBackend(
Reference<deployment::XPackageRegistry> const & xBackend )
{
m_allBackends.insert( xBackend );
- typedef ::std::hash_set<OUString, ::rtl::OUStringHash> t_stringset;
+ typedef ::boost::unordered_set<OUString, ::rtl::OUStringHash> t_stringset;
t_stringset ambiguousFilters;
const Sequence< Reference<deployment::XPackageTypeInfo> > packageTypes(
@@ -279,7 +297,7 @@ void PackageRegistryImpl::insertBackend(
xBackend, UNO_QUERY_THROW )->
getImplementationName() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
buf.makeStringAndClear(),
RTL_TEXTENCODING_UTF8 ) );
}
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index eb03c22464..035e21e236 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -72,6 +72,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
bool getFileAttributes(sal_uInt64& out_Attributes);
bool isUrlTargetInExtension();
+
public:
inline ExecutablePackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -84,7 +85,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
};
friend class ExecutablePackageImpl;
- typedef ::std::hash_map< OUString, Reference<XInterface>,
+ typedef ::boost::unordered_map< OUString, Reference<XInterface>,
::rtl::OUStringHash > t_string2object;
// PackageRegistryBackend
@@ -93,8 +94,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url);
- bool isRegisteredInDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
Reference<deployment::XPackageTypeInfo> m_xExecutableTypeInfo;
std::auto_ptr<ExecutableBackendDb> m_backendDb;
@@ -105,6 +106,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
using PackageRegistryBackend::disposing;
};
@@ -118,8 +122,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.executable"),
OUSTR(""),
OUSTR("Executable"),
- RID_IMG_COMPONENT,
- RID_IMG_COMPONENT_HC ) )
+ RID_IMG_COMPONENT ) )
{
if (!transientMode())
{
@@ -135,20 +138,20 @@ void BackendImpl::addDataToDb(OUString const & url)
m_backendDb->addEntry(url);
}
-bool BackendImpl::isRegisteredInDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
- bool ret = false;
if (m_backendDb.get())
- ret = m_backendDb->getEntry(url);
- return ret;
+ m_backendDb->revokeEntry(url);
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
}
+
// XPackageRegistry
Sequence< Reference<deployment::XPackageTypeInfo> >
BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
@@ -157,6 +160,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
& m_xExecutableTypeInfo, 1);
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
@@ -193,7 +204,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
return Reference<deployment::XPackage>();
}
-//##############################################################################
// Package
@@ -218,7 +228,7 @@ BackendImpl::ExecutablePackageImpl::isRegistered_(
::rtl::Reference<dp_misc::AbortChannel> const &,
Reference<XCommandEnvironment> const & )
{
- bool registered = getMyBackend()->isRegisteredInDb(getURL());
+ bool registered = getMyBackend()->hasActiveEntry(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
sal_True /* IsPresent */,
beans::Ambiguous<sal_Bool>(
@@ -249,7 +259,8 @@ void BackendImpl::ExecutablePackageImpl::processPackage_(
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe
| osl_File_Attribute_OthExe);
- else if (!getMyBackend()->m_context.equals(OUSTR("bundled")))
+ else if (!getMyBackend()->m_context.equals(OUSTR("bundled"))
+ && !getMyBackend()->m_context.equals(OUSTR("bundled_prereg")))
//Bundled extension are required to be in the properly
//installed. That is an executable must have the right flags
OSL_ASSERT(0);
@@ -262,7 +273,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_(
}
else
{
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
}
}
@@ -278,7 +289,8 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension()
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE"));
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE"));
- else if (getMyBackend()->m_context.equals(OUSTR("bundled")))
+ else if (getMyBackend()->m_context.equals(OUSTR("bundled"))
+ || getMyBackend()->m_context.equals(OUSTR("bundled_prereg")))
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS"));
else
OSL_ASSERT(0);
@@ -313,7 +325,6 @@ bool BackendImpl::ExecutablePackageImpl::getFileAttributes(sal_uInt64& out_Attri
return bSuccess;
}
-//##############################################################################
} // anon namespace
diff --git a/desktop/source/deployment/registry/executable/makefile.mk b/desktop/source/deployment/registry/executable/makefile.mk
index 81b2baa44e..81b2baa44e 100644..100755
--- a/desktop/source/deployment/registry/executable/makefile.mk
+++ b/desktop/source/deployment/registry/executable/makefile.mk
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 053929c4b1..6fdc9adaad 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@
#include "svl/inettype.hxx"
#include "unotools/pathoptions.hxx"
-#include <l10ntools/compilehelp.hxx>
+#include <l10ntools/compilehelp.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
@@ -67,8 +67,6 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
{
BackendImpl * getMyBackend() const;
-// HelpBackendDb::Data m_dbData;
-
// Package
virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
::osl::ResettableMutexGuard & guard,
@@ -81,7 +79,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
- bool extensionContainsCompiledHelp();
+
public:
PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -89,6 +87,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<deployment::XPackageTypeInfo> const & xPackageType,
bool bRemoved, OUString const & identifier);
+ bool extensionContainsCompiledHelp();
+
//XPackage
virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getRegistrationDataURL()
throw (deployment::ExtensionRemovedException, css::uno::RuntimeException);
@@ -101,14 +101,16 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
- void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
- bool compiledHelp, Reference<ucb::XCommandEnvironment> const & xCmdEnv);
+ void implProcessHelp( PackageImpl * package, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv);
void implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector );
void addDataToDb(OUString const & url, HelpBackendDb::Data const & data);
::boost::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
+ bool activateEntry(OUString const & url);
Reference< ucb::XSimpleFileAccess > getFileAccess( void );
Reference< ucb::XSimpleFileAccess > m_xSFA;
@@ -124,6 +126,10 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
};
//______________________________________________________________________________
@@ -135,7 +141,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.help"),
rtl::OUString(),
getResourceString(RID_STR_HELP),
- RID_IMG_HELP, RID_IMG_HELP_HC ) ),
+ RID_IMG_HELP ) ),
m_typeInfos( 1 )
{
m_typeInfos[ 0 ] = m_xHelpTypeInfo;
@@ -163,6 +169,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -194,7 +208,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
"vnd.sun.star.help"))
{
return new PackageImpl(
- this, url, name, m_xHelpTypeInfo, bRemoved,
+ this, url, name, m_xHelpTypeInfo, bRemoved,
identifier);
}
}
@@ -221,13 +235,27 @@ void BackendImpl::addDataToDb(
return data;
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
}
-//##############################################################################
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
+}
+
+bool BackendImpl::activateEntry(OUString const & url)
+{
+ if (m_backendDb.get())
+ return m_backendDb->activateEntry(url);
+ return false;
+}
+
+
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
@@ -236,13 +264,6 @@ BackendImpl::PackageImpl::PackageImpl(
: Package( myBackend, url, name, name, xPackageType, bRemoved,
identifier)
{
-// if (bRemoved)
-// {
-// ::boost::optional<HelpBackendDb::Data> opt =
-// getMyBackend()->readDataFromDb(url);
-// if (opt)
-// m_dbData = *opt;
-// }
}
// Package
@@ -250,23 +271,22 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
if (NULL == pBackend)
- {
+ {
//May throw a DisposedException
check();
//We should never get here...
throw RuntimeException(
- OUSTR("Failed to get the BackendImpl"),
+ OUSTR("Failed to get the BackendImpl"),
static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
}
return pBackend;
}
-
bool BackendImpl::PackageImpl::extensionContainsCompiledHelp()
{
bool bCompiled = true;
rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl(getURL());
-
+
::osl::Directory helpFolder(aExpandedHelpURL);
if ( helpFolder.open() == ::osl::File::E_None)
{
@@ -307,11 +327,12 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp()
{
//Error
OSL_ASSERT(0);
- bCompiled = false;
+ bCompiled = false;
}
}
return bCompiled;
}
+
//______________________________________________________________________________
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
@@ -322,7 +343,7 @@ BackendImpl::PackageImpl::isRegistered_(
BackendImpl * that = getMyBackend();
bool bReg = false;
- if (that->readDataFromDb(getURL()))
+ if (that->hasActiveEntry(getURL()))
bReg = true;
return beans::Optional< beans::Ambiguous<sal_Bool> >( true, beans::Ambiguous<sal_Bool>( bReg, false ) );
@@ -341,9 +362,7 @@ void BackendImpl::PackageImpl::processPackage_(
(void)xCmdEnv;
BackendImpl* that = getMyBackend();
- Reference< deployment::XPackage > xThisPackage( this );
- that->implProcessHelp( xThisPackage, doRegisterPackage,
- extensionContainsCompiledHelp(), xCmdEnv);
+ that->implProcessHelp( this, doRegisterPackage, xCmdEnv);
}
beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
@@ -356,241 +375,238 @@ beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
::boost::optional<HelpBackendDb::Data> data =
getMyBackend()->readDataFromDb(getURL());
- if (data)
+ if (data && getMyBackend()->hasActiveEntry(getURL()))
return beans::Optional<OUString>(true, data->dataUrl);
- return beans::Optional<OUString>(true, OUString());
+ return beans::Optional<OUString>(true, OUString());
}
+static rtl::OUString aSlash(RTL_CONSTASCII_USTRINGPARAM("/"));
+static rtl::OUString aHelpStr(RTL_CONSTASCII_USTRINGPARAM("help"));
-//##############################################################################
-
-static rtl::OUString aSlash( rtl::OUString::createFromAscii( "/" ) );
-static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) );
-
-
-void BackendImpl::implProcessHelp
-( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp,
- Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+void BackendImpl::implProcessHelp(
+ PackageImpl * package, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
+ Reference< deployment::XPackage > xPackage(package);
OSL_ASSERT(xPackage.is());
if (doRegisterPackage)
{
- HelpBackendDb::Data data;
-
- if (compiledHelp)
+ //revive already processed help if possible
+ if ( !activateEntry(xPackage->getURL()))
{
+ HelpBackendDb::Data data;
data.dataUrl = xPackage->getURL();
- }
- else
- {
- const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
- data.dataUrl = sHelpFolder;
-
- Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
- rtl::OUString aHelpURL = xPackage->getURL();
- rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
- rtl::OUString aName = xPackage->getName();
- if( !xSFA->isFolder( aExpandedHelpURL ) )
+ if (!package->extensionContainsCompiledHelp())
{
- rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
- aErrStr += rtl::OUString::createFromAscii( "No help folder" );
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
- }
-
- Reference<XComponentContext> const & xContext = getComponentContext();
- Reference< script::XInvocation > xInvocation;
- if( xContext.is() )
- {
- try
- {
- xInvocation = Reference< script::XInvocation >(
- xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
- }
- catch (Exception &)
+ const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
+ data.dataUrl = sHelpFolder;
+
+ Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
+ rtl::OUString aHelpURL = xPackage->getURL();
+ rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
+ rtl::OUString aName = xPackage->getName();
+ if( !xSFA->isFolder( aExpandedHelpURL ) )
{
- // i98680: Survive missing lucene
+ rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
+ aErrStr += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No help folder" ));
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
- }
-
- // Scan languages
- Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
- sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
- const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
- for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
- {
- rtl::OUString aLangURL = pSeq[iLang];
- if( xSFA->isFolder( aLangURL ) )
- {
- std::vector< rtl::OUString > aXhpFileVector;
-
- // calculate jar file URL
- sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
- // for example "/en"
- OUString langFolderURLSegment(
- aLangURL.copy(
- indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
-
- //create the folder in the "temporary folder"
- ::ucbhelper::Content langFolderContent;
- const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
- const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
- ::dp_misc::create_folder(
- &langFolderContent,
- langFolderDest, xCmdEnv);
- rtl::OUString aJarFile(
- makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
- OUSTR(".jar")));
- aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
-
- rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
- aJarFile, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 );
- rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" );
- aDestBasePath += aEncodedJarFilePath;
- aDestBasePath += rtl::OUString::createFromAscii( "/" );
-
- sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
-
- Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
- sal_Int32 nSubLangCount = aSubLangSeq.getLength();
- const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
- for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
- {
- rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
- if( !xSFA->isFolder( aSubFolderURL ) )
- continue;
-
- implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
-
- // Copy to package (later: move?)
- rtl::OUString aDestPath = aDestBasePath;
- rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
- aDestPath += aPureFolderName;
- xSFA->copy( aSubFolderURL, aDestPath );
- }
-
- // Call compiler
- sal_Int32 nXhpFileCount = aXhpFileVector.size();
- rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
+ Reference<XComponentContext> const & xContext = getComponentContext();
+ Reference< script::XInvocation > xInvocation;
+ if( xContext.is() )
+ {
+ try
{
- rtl::OUString aXhpFile = aXhpFileVector[iXhp];
- rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
- pXhpFiles[iXhp] = aXhpRelFile;
+ xInvocation = Reference< script::XInvocation >(
+ xContext->getServiceManager()->createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.help.HelpIndexer" )), xContext ) , UNO_QUERY );
}
-
- rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
- rtl::OUString aOfficeHelpPathFileURL;
- ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
-
- HelpProcessingErrorInfo aErrorInfo;
- bool bSuccess = compileExtensionHelp(
- aOfficeHelpPathFileURL, aHelpStr, aLangURL,
- nXhpFileCount, pXhpFiles,
- langFolderDestExpanded, aErrorInfo );
-
- if( bSuccess && xInvocation.is() )
+ catch (Exception &)
{
- Sequence<uno::Any> aParamsSeq( 6 );
-
- aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) );
-
- rtl::OUString aLang;
- sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
- if( nLastSlash != -1 )
- aLang = aLangURL.copy( nLastSlash + 1 );
- else
- aLang = rtl::OUString::createFromAscii( "en" );
- aParamsSeq[1] = uno::makeAny( aLang );
-
- aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) );
- aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) );
-
- aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
- rtl::OUString aSystemPath;
- osl::FileBase::getSystemPathFromFileURL(
- langFolderDestExpanded, aSystemPath );
- aParamsSeq[5] = uno::makeAny( aSystemPath );
-
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< uno::Any > aOutParam;
- uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ),
- aParamsSeq, aOutParamIndex, aOutParam );
+ // i98680: Survive missing lucene
}
-
- if( !bSuccess )
+ }
+
+ // Scan languages
+ Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
+ sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
+ const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
+ for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
+ {
+ rtl::OUString aLangURL = pSeq[iLang];
+ if( xSFA->isFolder( aLangURL ) )
{
- USHORT nErrStrId = 0;
- switch( aErrorInfo.m_eErrorClass )
+ std::vector< rtl::OUString > aXhpFileVector;
+
+ // calculate jar file URL
+ sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
+ // for example "/en"
+ OUString langFolderURLSegment(
+ aLangURL.copy(
+ indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
+
+ //create the folder in the "temporary folder"
+ ::ucbhelper::Content langFolderContent;
+ const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
+ const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
+ ::dp_misc::create_folder(
+ &langFolderContent,
+ langFolderDest, xCmdEnv);
+
+ rtl::OUString aJarFile(
+ makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
+ OUSTR(".jar")));
+ aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
+
+ rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
+ aJarFile, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aDestBasePath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.zip://" ));
+ aDestBasePath += aEncodedJarFilePath;
+ aDestBasePath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ));
+
+ sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
+
+ Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
+ sal_Int32 nSubLangCount = aSubLangSeq.getLength();
+ const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
+ for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
+ {
+ rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
+ if( !xSFA->isFolder( aSubFolderURL ) )
+ continue;
+
+ implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
+
+ // Copy to package (later: move?)
+ rtl::OUString aDestPath = aDestBasePath;
+ rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
+ aDestPath += aPureFolderName;
+ xSFA->copy( aSubFolderURL, aDestPath );
+ }
+
+ // Call compiler
+ sal_Int32 nXhpFileCount = aXhpFileVector.size();
+ rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
+ for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
{
- case HELPPROCESSING_GENERAL_ERROR:
- case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
- case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
- default: ;
- };
-
- rtl::OUString aErrStr;
- if( nErrStrId != 0 )
+ rtl::OUString aXhpFile = aXhpFileVector[iXhp];
+ rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
+ pXhpFiles[iXhp] = aXhpRelFile;
+ }
+
+ rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
+ rtl::OUString aOfficeHelpPathFileURL;
+ ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
+
+ HelpProcessingErrorInfo aErrorInfo;
+ bool bSuccess = compileExtensionHelp(
+ aOfficeHelpPathFileURL, aHelpStr, aLangURL,
+ nXhpFileCount, pXhpFiles,
+ langFolderDestExpanded, aErrorInfo );
+
+ if( bSuccess && xInvocation.is() )
{
- aErrStr = getResourceString( nErrStrId );
-
- // Remoce CR/LF
- rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
- sal_Unicode nCR = 13, nLF = 10;
- sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
- sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
- sal_Int32 nCopy;
- if( nSearchCR != -1 || nSearchLF != -1 )
+ Sequence<uno::Any> aParamsSeq( 6 );
+
+ aParamsSeq[0] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-lang" ) ));
+
+ rtl::OUString aLang;
+ sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
+ if( nLastSlash != -1 )
+ aLang = aLangURL.copy( nLastSlash + 1 );
+ else
+ aLang = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "en" ));
+ aParamsSeq[1] = uno::makeAny( aLang );
+
+ aParamsSeq[2] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-mod" ) ));
+ aParamsSeq[3] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "help" ) ));
+
+ aParamsSeq[4] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-zipdir" ) ));
+ rtl::OUString aSystemPath;
+ osl::FileBase::getSystemPathFromFileURL(
+ langFolderDestExpanded, aSystemPath );
+ aParamsSeq[5] = uno::makeAny( aSystemPath );
+
+ Sequence< sal_Int16 > aOutParamIndex;
+ Sequence< uno::Any > aOutParam;
+ uno::Any aRet = xInvocation->invoke( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "createIndex" )),
+ aParamsSeq, aOutParamIndex, aOutParam );
+ }
+
+ if( !bSuccess )
+ {
+ sal_uInt16 nErrStrId = 0;
+ switch( aErrorInfo.m_eErrorClass )
{
- if( nSearchCR == -1 )
- nCopy = nSearchLF;
- else if( nSearchLF == -1 )
- nCopy = nSearchCR;
- else
- nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
-
- aErrMsg = aErrMsg.copy( 0, nCopy );
- }
- aErrStr += aErrMsg;
- if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
+ case HELPPROCESSING_GENERAL_ERROR:
+ case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
+ case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
+ default: ;
+ };
+
+ rtl::OUString aErrStr;
+ if( nErrStrId != 0 )
{
- aErrStr += rtl::OUString::createFromAscii( " in " );
-
- rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
- rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- aErrStr += aDecodedFile;
- if( aErrorInfo.m_nXMLParsingLine != -1 )
+ aErrStr = getResourceString( nErrStrId );
+
+ // Remoce CR/LF
+ rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
+ sal_Unicode nCR = 13, nLF = 10;
+ sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
+ sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
+ sal_Int32 nCopy;
+ if( nSearchCR != -1 || nSearchLF != -1 )
{
- aErrStr += rtl::OUString::createFromAscii( ", line " );
- aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ if( nSearchCR == -1 )
+ nCopy = nSearchLF;
+ else if( nSearchLF == -1 )
+ nCopy = nSearchCR;
+ else
+ nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
+
+ aErrMsg = aErrMsg.copy( 0, nCopy );
+ }
+ aErrStr += aErrMsg;
+ if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
+ {
+ aErrStr += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( " in " ));
+
+ rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
+ rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ aErrStr += aDecodedFile;
+ if( aErrorInfo.m_nXMLParsingLine != -1 )
+ {
+ aErrStr += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ", line " ));
+ aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ }
}
}
+
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
-
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
}
}
+ //Writing the data entry replaces writing the flag file. If we got to this
+ //point the registration was successful.
+ addDataToDb(xPackage->getURL(), data);
}
- //Writing the data entry replaces writing the flag file. If we got to this
- //point the registration was successful.
- addDataToDb(xPackage->getURL(), data);
} //if (doRegisterPackage)
else
{
- deleteDataFromDb(xPackage->getURL());
+ revokeEntryFromDb(xPackage->getURL());
}
}
-
void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector )
{
@@ -613,7 +629,7 @@ void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir,
if( nLastDot != -1 )
{
rtl::OUString aExt = aURL.copy( nLastDot + 1 );
- if( aExt.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "xhp" ) ) )
+ if( aExt.equalsIgnoreAsciiCase( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "xhp" )) ) )
o_rXhpFileVector.push_back( aURL );
}
}
@@ -627,17 +643,17 @@ Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void )
Reference<XComponentContext> const & xContext = getComponentContext();
if( xContext.is() )
{
- m_xSFA = Reference< ucb::XSimpleFileAccess >(
+ m_xSFA = Reference< ucb::XSimpleFileAccess >(
xContext->getServiceManager()->createInstanceWithContext(
- rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" )),
xContext ), UNO_QUERY );
}
if( !m_xSFA.is() )
{
throw RuntimeException(
- ::rtl::OUString::createFromAscii(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"dp_registry::backend::help::BackendImpl::getFileAccess(), "
- "could not instatiate SimpleFileAccess." ),
+ "could not instatiate SimpleFileAccess." )),
Reference< XInterface >() );
}
}
diff --git a/desktop/source/deployment/registry/help/dp_help.hrc b/desktop/source/deployment/registry/help/dp_help.hrc
index 451144813f..451144813f 100644..100755
--- a/desktop/source/deployment/registry/help/dp_help.hrc
+++ b/desktop/source/deployment/registry/help/dp_help.hrc
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
index 92ce961de6..45aa70934c 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
@@ -84,11 +84,14 @@ OUString HelpBackendDb::getKeyElementName()
void HelpBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> helpNode
- = writeKeyElement(url);
-
- writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
- save();
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
+
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ save();
+ }
}
catch (css::deployment::DeploymentException& )
{
@@ -136,40 +139,9 @@ HelpBackendDb::getEntry(::rtl::OUString const & url)
::std::list<OUString> HelpBackendDb::getAllDataUrls()
{
- try
- {
- ::std::list<OUString> listRet;
- Reference<css::xml::dom::XDocument> doc = getDocument();
- Reference<css::xml::dom::XNode> root = doc->getFirstChild();
-
- Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
- const OUString sPrefix = getNSPrefix();
- OUString sExpression(
- sPrefix + OUSTR(":help/") + sPrefix + OUSTR(":data-url/text()"));
- Reference<css::xml::dom::XNodeList> nodes =
- xpathApi->selectNodeList(root, sExpression);
- if (nodes.is())
- {
- sal_Int32 length = nodes->getLength();
- for (sal_Int32 i = 0; i < length; i++)
- listRet.push_back(nodes->item(i)->getNodeValue());
- }
- return listRet;
- }
- catch (css::deployment::DeploymentException& )
- {
- throw;
- }
- catch(css::uno::Exception &)
- {
- Any exc( ::cppu::getCaughtException() );
- throw css::deployment::DeploymentException(
- OUSTR("Extension Manager: failed to read data entry in help backend db: ") +
- m_urlDb, 0, exc);
- }
+ return getOneChildFromAllEntries(OUString(RTL_CONSTASCII_USTRINGPARAM("data-url")));
}
-
} // namespace help
} // namespace backend
} // namespace dp_registry
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
index 4a2eb8ec59..4bfa93204c 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
@@ -77,6 +77,8 @@ public:
void addEntry(::rtl::OUString const & url, Data const & data);
::boost::optional<Data> getEntry(::rtl::OUString const & url);
+ //must also return the data urls for entries with @activ="false". That is,
+ //those are currently revoked.
::std::list< ::rtl::OUString> getAllDataUrls();
};
diff --git a/desktop/source/deployment/registry/help/makefile.mk b/desktop/source/deployment/registry/help/makefile.mk
index d4934f71a4..d4934f71a4 100644..100755
--- a/desktop/source/deployment/registry/help/makefile.mk
+++ b/desktop/source/deployment/registry/help/makefile.mk
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 53de2ef1da..656f81ff6d 100644..100755
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -43,7 +43,7 @@
#include "com/sun/star/deployment/XPackageManager.hpp"
#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
#include <memory>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
#include "dp_registry.hrc"
@@ -56,8 +56,7 @@ namespace css = ::com::sun::star;
class PackageRegistryBackend;
-char const* const BACKEND_SERVICE_NAME =
-"com.sun.star.deployment.PackageRegistryBackend";
+#define BACKEND_SERVICE_NAME "com.sun.star.deployment.PackageRegistryBackend"
typedef ::cppu::WeakComponentImplHelper1<
css::deployment::XPackage > t_PackageBase;
@@ -122,16 +121,16 @@ public:
const ::rtl::OUString m_mediaType;
const ::rtl::OUString m_fileFilter;
const ::rtl::OUString m_shortDescr;
- const sal_uInt16 m_smallIcon, m_smallIcon_HC;
+ const sal_uInt16 m_smallIcon;
public:
virtual ~TypeInfo();
TypeInfo( ::rtl::OUString const & mediaType,
::rtl::OUString const & fileFilter,
::rtl::OUString const & shortDescr,
- sal_uInt16 smallIcon, sal_uInt16 smallIcon_HC )
+ sal_uInt16 smallIcon)
: m_mediaType(mediaType), m_fileFilter(fileFilter),
m_shortDescr(shortDescr),
- m_smallIcon(smallIcon), m_smallIcon_HC(smallIcon_HC)
+ m_smallIcon(smallIcon)
{}
// XPackageTypeInfo
virtual ::rtl::OUString SAL_CALL getMediaType()
@@ -238,6 +237,9 @@ public:
virtual ::rtl::OUString SAL_CALL getDescription()
throw (css::deployment::ExtensionRemovedException,
css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLicenseText()
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
getUpdateInformationURLs()
throw (css::deployment::ExtensionRemovedException,
@@ -284,7 +286,7 @@ class PackageRegistryBackend
// XPackageManager::getDeployedPackages is called often. This results in a lot
//of bindPackage calls which are costly. Therefore we keep hard references in
//the map now.
- typedef ::std::hash_map<
+ typedef ::boost::unordered_map<
::rtl::OUString, css::uno::Reference<css::deployment::XPackage>,
::rtl::OUStringHash > t_string2ref;
t_string2ref m_bound;
@@ -295,9 +297,9 @@ protected:
::rtl::OUString m_context;
// currently only for library containers:
- enum context {
+ enum {
CONTEXT_UNKNOWN,
- CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP,
+ CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, CONTEXT_BUNDLED_PREREG,
CONTEXT_DOCUMENT
} m_eContext;
bool m_readOnly;
@@ -342,6 +344,18 @@ protected:
*/
static void deleteTempFolder(
::rtl::OUString const & folderUrl);
+
+ ::rtl::OUString getSharedRegistrationDataURL(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::deployment::XPackage> const & item);
+
+ /* The backends must implement this function, which is called
+ from XPackageRegistry::packageRemoved (also implemented here).
+ This ensure that the backends clean up their registration data
+ when an extension was removed.
+ */
+// virtual void deleteDbEntry( ::rtl::OUString const & url) = 0;
+
public:
@@ -371,6 +385,12 @@ public:
css::deployment::InvalidRemovedParameterException,
css::ucb::CommandFailedException,
css::lang::IllegalArgumentException, css::uno::RuntimeException);
+
+// virtual void SAL_CALL packageRemoved(
+// ::rtl::OUString const & url, ::rtl::OUString const & mediaType)
+// throw (css::deployment::DeploymentException,
+// css::uno::RuntimeException);
+
};
}
diff --git a/desktop/source/deployment/registry/inc/dp_backenddb.hxx b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
index 11dff5a510..2deb1c6e56 100644
--- a/desktop/source/deployment/registry/inc/dp_backenddb.hxx
+++ b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
@@ -140,14 +140,24 @@ protected:
*/
virtual ::rtl::OUString getKeyElementName()=0;
-
-
public:
BackendDb(css::uno::Reference<css::uno::XComponentContext> const & xContext,
::rtl::OUString const & url);
virtual ~BackendDb() {};
void removeEntry(::rtl::OUString const & url);
+
+ /* This is called to write the "revoked" attribute to the entry.
+ This is done when XPackage::revokePackage is called.
+ */
+ void revokeEntry(::rtl::OUString const & url);
+
+ /* returns false if the entry does not exist yet.
+ */
+ bool activateEntry(::rtl::OUString const & url);
+
+ bool hasActiveEntry(::rtl::OUString const & url);
+
};
class RegisteredDb: public BackendDb
@@ -164,7 +174,6 @@ public:
};
-
}
}
#endif
diff --git a/desktop/source/deployment/registry/inc/dp_registry.hrc b/desktop/source/deployment/registry/inc/dp_registry.hrc
index 7f8124b78d..7f8124b78d 100644..100755
--- a/desktop/source/deployment/registry/inc/dp_registry.hrc
+++ b/desktop/source/deployment/registry/inc/dp_registry.hrc
diff --git a/desktop/source/deployment/registry/makefile.mk b/desktop/source/deployment/registry/makefile.mk
index e45cec272c..e45cec272c 100644..100755
--- a/desktop/source/deployment/registry/makefile.mk
+++ b/desktop/source/deployment/registry/makefile.mk
diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
index c3b0c092c0..5f20628dc9 100644
--- a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
+++ b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
-#include "rtl/string.h"
#include "rtl/bootstrap.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
@@ -83,15 +82,19 @@ OUString ExtensionBackendDb::getKeyElementName()
void ExtensionBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> extensionNodeNode = writeKeyElement(url);
- writeVectorOfPair(
- data.items,
- OUSTR("extension-items"),
- OUSTR("item"),
- OUSTR("url"),
- OUSTR("media-type"),
- extensionNodeNode);
- save();
+ //reactive revoked entry if possible.
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> extensionNodeNode = writeKeyElement(url);
+ writeVectorOfPair(
+ data.items,
+ OUSTR("extension-items"),
+ OUSTR("item"),
+ OUSTR("url"),
+ OUSTR("media-type"),
+ extensionNodeNode);
+ save();
+ }
}
catch(css::uno::Exception &)
{
diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.hxx b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx
index ac57bd794e..f25203193a 100644
--- a/desktop/source/deployment/registry/package/dp_extbackenddb.hxx
+++ b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx
@@ -26,13 +26,14 @@
*
************************************************************************/
-
#if ! defined INCLUDED_DP_EXTBACKENDDB_HXX
#define INCLUDED_DP_EXTBACKENDDB_HXX
-#include "rtl/ustring.hxx"
-#include "rtl/string.hxx"
+#include <utility>
#include <vector>
+
+#include "rtl/ustring.hxx"
+
#include "dp_backenddb.hxx"
namespace css = ::com::sun::star;
@@ -74,11 +75,9 @@ public:
::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString> > items;
typedef ::std::vector<
::std::pair< ::rtl::OUString, ::rtl::OUString> >::const_iterator ITC_ITEMS;
-
};
public:
-
ExtensionBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
::rtl::OUString const & url);
@@ -88,8 +87,6 @@ public:
};
-
-
}
}
}
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index b084d87898..1291b8dadb 100755..100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -191,6 +191,9 @@ class BackendImpl : public ImplBaseT
virtual OUString SAL_CALL getDescription()
throw (deployment::ExtensionRemovedException, RuntimeException);
+ virtual OUString SAL_CALL getLicenseText()
+ throw (deployment::ExtensionRemovedException, RuntimeException);
+
virtual void SAL_CALL exportTo(
OUString const & destFolderURL, OUString const & newTitle,
sal_Int32 nameClashAction,
@@ -248,7 +251,7 @@ class BackendImpl : public ImplBaseT
void addDataToDb(OUString const & url, ExtensionBackendDb::Data const & data);
ExtensionBackendDb::Data readDataFromDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
@@ -274,7 +277,10 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
-
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
using ImplBaseT::disposing;
};
@@ -301,15 +307,13 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.package-bundle"),
OUSTR("*.oxt;*.uno.pkg"),
getResourceString(RID_STR_PACKAGE_BUNDLE),
- RID_IMG_DEF_PACKAGE_BUNDLE,
- RID_IMG_DEF_PACKAGE_BUNDLE_HC ) ),
+ RID_IMG_DEF_PACKAGE_BUNDLE ) ),
m_xLegacyBundleTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.legacy-package-bundle"),
OUSTR("*.zip"),
m_xBundleTypeInfo->getShortDescription(),
- RID_IMG_DEF_PACKAGE_BUNDLE,
- RID_IMG_DEF_PACKAGE_BUNDLE_HC ) ),
+ RID_IMG_DEF_PACKAGE_BUNDLE ) ),
m_typeInfos(2)
{
m_typeInfos[ 0 ] = m_xBundleTypeInfo;
@@ -347,7 +351,7 @@ Sequence<OUString> BackendImpl::getSupportedServiceNames()
throw (RuntimeException)
{
return comphelper::makeSequence(
- OUString::createFromAscii(BACKEND_SERVICE_NAME) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(BACKEND_SERVICE_NAME)) );
}
// XPackageRegistry
@@ -358,6 +362,21 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ //Notify the backend responsible for processing the different media
+ //types that this extension was removed.
+ ExtensionBackendDb::Data data = readDataFromDb(url);
+ for (ExtensionBackendDb::Data::ITC_ITEMS i = data.items.begin(); i != data.items.end(); i++)
+ {
+ m_xRootRegistry->packageRemoved(i->first, i->second);
+ }
+
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
@@ -458,14 +477,13 @@ ExtensionBackendDb::Data BackendImpl::readDataFromDb(
return data;
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ m_backendDb->revokeEntry(url);
}
-//##############################################################################
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -703,10 +721,6 @@ bool BackendImpl::PackageImpl::checkDependencies(
return true;
else
return false;
- //throw css::deployment::DeploymentException(
- // OUSTR("Extension Manager: User declined the license."),
- // static_cast<OWeakObject*>(this),
- // Any( css::deployment::LicenseException(OUSTR("User declined the license."), 0, m_name, sLicense)));
}
return true;
} catch (css::ucb::CommandFailedException&) {
@@ -903,7 +917,7 @@ void BackendImpl::PackageImpl::processPackage_(
}
catch (Exception &)
{
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
::comphelper::anyToString(
::cppu::getCaughtException() ),
RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -971,7 +985,7 @@ void BackendImpl::PackageImpl::processPackage_(
// selected
}
}
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
}
}
@@ -994,7 +1008,7 @@ OUString BackendImpl::PackageImpl::getDescription()
}
catch ( css::deployment::DeploymentException& )
{
- OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() );
+ OSL_FAIL( ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -1004,6 +1018,31 @@ OUString BackendImpl::PackageImpl::getDescription()
}
//______________________________________________________________________________
+OUString BackendImpl::PackageImpl::getLicenseText()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
+{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
+ OUString sLicense;
+ DescriptionInfoset aInfo = getDescriptionInfoset();
+
+ ::boost::optional< SimpleLicenseAttributes > aSimplLicAttr = aInfo.getSimpleLicenseAttributes();
+ if ( aSimplLicAttr )
+ {
+ OUString aLicenseURL = aInfo.getLocalizedLicenseURL();
+
+ if ( aLicenseURL.getLength() )
+ {
+ OUString aFullURL = m_url_expanded + OUSTR("/") + aLicenseURL;
+ sLicense = getTextFromURL( Reference< ucb::XCommandEnvironment >(), aFullURL);
+ }
+ }
+
+ return sLicense;
+}
+
+//______________________________________________________________________________
void BackendImpl::PackageImpl::exportTo(
OUString const & destFolderURL, OUString const & newTitle,
sal_Int32 nameClashAction, Reference<ucb::XCommandEnvironment> const & xCmdEnv )
@@ -1097,14 +1136,14 @@ void BackendImpl::PackageImpl::exportTo(
}
// xxx todo: think about exception specs:
catch (deployment::DeploymentException &) {
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
::comphelper::anyToString(
::cppu::getCaughtException() ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch (lang::IllegalArgumentException & exc) {
(void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ OSL_FAIL( ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
@@ -1173,7 +1212,7 @@ void BackendImpl::PackageImpl::exportTo(
makeURL( m_url_expanded, OUSTR("META-INF/manifest.xml") ),
xCmdEnv, false ) )
{
- OSL_ENSURE( 0, "### missing META-INF/manifest.xml file!" );
+ OSL_FAIL( "### missing META-INF/manifest.xml file!" );
return;
}
@@ -1397,7 +1436,7 @@ void BackendImpl::PackageImpl::scanBundle(
makeURL( m_url_expanded, OUSTR("META-INF/manifest.xml") ),
xCmdEnv, false /* no throw */ ))
{
- OSL_ENSURE( 0, "### missing META-INF/manifest.xml file!" );
+ OSL_FAIL( "### missing META-INF/manifest.xml file!" );
return;
}
diff --git a/desktop/source/deployment/registry/package/dp_package.hrc b/desktop/source/deployment/registry/package/dp_package.hrc
index 0b258a58cd..0b258a58cd 100644..100755
--- a/desktop/source/deployment/registry/package/dp_package.hrc
+++ b/desktop/source/deployment/registry/package/dp_package.hrc
diff --git a/desktop/source/deployment/registry/package/makefile.mk b/desktop/source/deployment/registry/package/makefile.mk
index 203ce176d2..203ce176d2 100644..100755
--- a/desktop/source/deployment/registry/package/makefile.mk
+++ b/desktop/source/deployment/registry/package/makefile.mk
diff --git a/desktop/source/deployment/registry/script/dp_lib_container.cxx b/desktop/source/deployment/registry/script/dp_lib_container.cxx
index 4dc71b7fd9..ccc2b29874 100644
--- a/desktop/source/deployment/registry/script/dp_lib_container.cxx
+++ b/desktop/source/deployment/registry/script/dp_lib_container.cxx
@@ -29,11 +29,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+
#include "dp_script.hrc"
#include "dp_resource.h"
#include "dp_xml.h"
#include "dp_lib_container.h"
+
+#include "rtl/ustring.hxx"
#include "ucbhelper/content.hxx"
+#include "xmlscript/xmllib_imexp.hxx"
using namespace ::dp_misc;
diff --git a/desktop/source/deployment/registry/script/dp_lib_container.h b/desktop/source/deployment/registry/script/dp_lib_container.h
index b0f29c1e80..009846a3c0 100644..100755
--- a/desktop/source/deployment/registry/script/dp_lib_container.h
+++ b/desktop/source/deployment/registry/script/dp_lib_container.h
@@ -29,11 +29,20 @@
#if ! defined INCLUDED_DP_LIB_CONTAINER_H
#define INCLUDED_DP_LIB_CONTAINER_H
-#include "rtl/ustring.hxx"
-#include "xmlscript/xmllib_imexp.hxx"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+#include <com/sun/star/uno/Reference.hxx>
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace ucb {
+ class XCommandEnvironment;
+ }
+}}}
+
+namespace rtl {
+ class OUString;
+}
namespace css = ::com::sun::star;
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index 45fb378f1c..437674a420 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -41,7 +41,6 @@
#include "svl/inettype.hxx"
#include "com/sun/star/util/XUpdatable.hpp"
#include "com/sun/star/script/XLibraryContainer3.hpp"
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <memory>
@@ -62,7 +61,6 @@ namespace {
typedef ::cppu::ImplInheritanceHelper1<
::dp_registry::backend::PackageRegistryBackend, util::XUpdatable > t_helper;
-//==============================================================================
class BackendImpl : public t_helper
{
class PackageImpl : public ::dp_registry::backend::Package
@@ -102,13 +100,8 @@ class BackendImpl : public t_helper
Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
- bool isRegisteredInDb(OUString const & url);
-
-
-
-// Reference< ucb::XSimpleFileAccess > getFileAccess( void );
-// Reference< ucb::XSimpleFileAccess > m_xSFA;
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
const Reference<deployment::XPackageTypeInfo> m_xBasicLibTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xDialogLibTypeInfo;
@@ -124,6 +117,10 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
};
//______________________________________________________________________________
@@ -164,13 +161,13 @@ BackendImpl::BackendImpl(
"vnd.sun.star.basic-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_BASIC_LIB),
- RID_IMG_SCRIPTLIB, RID_IMG_SCRIPTLIB_HC ) ),
+ RID_IMG_SCRIPTLIB) ),
m_xDialogLibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.dialog-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_DIALOG_LIB),
- RID_IMG_DIALOGLIB, RID_IMG_DIALOGLIB_HC ) ),
+ RID_IMG_DIALOGLIB) ),
m_typeInfos( 2 )
{
m_typeInfos[ 0 ] = m_xBasicLibTypeInfo;
@@ -192,18 +189,11 @@ void BackendImpl::addDataToDb(OUString const & url)
m_backendDb->addEntry(url);
}
-bool BackendImpl::isRegisteredInDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
- bool registered = false;
if (m_backendDb.get())
- registered = m_backendDb->getEntry(url);
- return registered;
-}
-
-void BackendImpl::deleteDataFromDb(OUString const & url)
-{
- if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
}
// XUpdatable
@@ -220,6 +210,19 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return m_typeInfos;
}
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
+}
+
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
//______________________________________________________________________________
@@ -293,7 +296,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
-//##############################################################################
// Package
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
@@ -310,34 +312,83 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
}
return pBackend;
}
-//______________________________________________________________________________
+
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
- ::osl::ResettableMutexGuard &,
- ::rtl::Reference<AbortChannel> const &,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ ::osl::ResettableMutexGuard & /* guard */,
+ ::rtl::Reference<AbortChannel> const & /* abortChannel */,
+ Reference<XCommandEnvironment> const & /* xCmdEnv */ )
{
- (void)xCmdEnv;
-
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- bool registered = that->isRegisteredInDb(getURL());
+ bool registered = that->hasActiveEntry(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>( registered, false /* IsAmbiguous */ ) );
}
-//______________________________________________________________________________
+void
+lcl_maybeRemoveScript(
+ bool const bExists,
+ OUString const& rName,
+ OUString const& rScriptURL,
+ Reference<css::script::XLibraryContainer3> const& xScriptLibs)
+{
+ if (bExists && xScriptLibs.is() && xScriptLibs->hasByName(rName))
+ {
+ const OUString sScriptUrl = xScriptLibs->getOriginalLibraryLinkURL(rName);
+ if (sScriptUrl.equals(rScriptURL))
+ xScriptLibs->removeLibrary(rName);
+ }
+}
+
+bool
+lcl_maybeAddScript(
+ bool const bExists,
+ OUString const& rName,
+ OUString const& rScriptURL,
+ Reference<css::script::XLibraryContainer3> const& xScriptLibs)
+{
+ if (bExists && xScriptLibs.is())
+ {
+ bool bCanAdd = true;
+ if (xScriptLibs->hasByName(rName))
+ {
+ const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(rName);
+ //We assume here that library names in extensions are unique, which may not be the case
+ //ToDo: If the script exist in another extension, then both extensions must have the
+ //same id
+ if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
+ {
+ xScriptLibs->removeLibrary(rName);
+ bCanAdd = true;
+ }
+ else
+ {
+ bCanAdd = false;
+ }
+ }
+
+ if (bCanAdd)
+ {
+ xScriptLibs->createLibraryLink(rName, rScriptURL, false);
+ return xScriptLibs->hasByName(rName);
+ }
+ }
+
+ return false;
+}
+
void BackendImpl::PackageImpl::processPackage_(
- ::osl::ResettableMutexGuard &,
+ ::osl::ResettableMutexGuard & /* guard */,
bool doRegisterPackage,
bool startup,
- ::rtl::Reference<AbortChannel> const &,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ ::rtl::Reference<AbortChannel> const & /* abortChannel */,
+ Reference<XCommandEnvironment> const & /* xCmdEnv */ )
{
- (void)xCmdEnv;
-
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
@@ -368,7 +419,7 @@ void BackendImpl::PackageImpl::processPackage_(
xComponentContext ), UNO_QUERY_THROW );
}
}
- bool bRegistered = getMyBackend()->isRegisteredInDb(getURL());
+ bool bRegistered = getMyBackend()->hasActiveEntry(getURL());
if( !doRegisterPackage )
{
//We cannot just call removeLibrary(name) because this could remove a
@@ -386,21 +437,10 @@ void BackendImpl::PackageImpl::processPackage_(
//we also prevent and live deployment at startup
if (!isRemoved() && !startup)
{
- if (bScript && xScriptLibs.is() && xScriptLibs->hasByName(m_name))
- {
- const OUString sScriptUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
- if (sScriptUrl.equals(m_scriptURL))
- xScriptLibs->removeLibrary(m_name);
- }
-
- if (bDialog && xDialogLibs.is() && xDialogLibs->hasByName(m_dialogName))
- {
- const OUString sDialogUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
- if (sDialogUrl.equals(m_dialogURL))
- xDialogLibs->removeLibrary(m_dialogName);
- }
+ lcl_maybeRemoveScript(bScript, m_name, m_scriptURL, xScriptLibs);
+ lcl_maybeRemoveScript(bDialog, m_dialogName, m_dialogURL, xDialogLibs);
}
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
return;
}
}
@@ -409,72 +449,14 @@ void BackendImpl::PackageImpl::processPackage_(
// Update LibraryContainer
bool bScriptSuccess = false;
- const bool bReadOnly = false;
-
bool bDialogSuccess = false;
if (!startup)
{
//If there is a bundled extension, and the user installes the same extension
//then the script from the bundled extension must be removed. If this does not work
//then live deployment does not work for scripts.
- if (bScript && xScriptLibs.is())
- {
- bool bCanAdd = true;
- if (xScriptLibs->hasByName(m_name))
- {
- const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
- //We assume here that library names in extensions are unique, which may not be the case
- //ToDo: If the script exist in another extension, then both extensions must have the
- //same id
- if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
- || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
- || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
- {
- xScriptLibs->removeLibrary(m_name);
- bCanAdd = true;
- }
- else
- {
- bCanAdd = false;
- }
- }
-
- if (bCanAdd)
- {
- xScriptLibs->createLibraryLink( m_name, m_scriptURL, bReadOnly );
- bScriptSuccess = xScriptLibs->hasByName( m_name );
- }
- }
-
-
- if (bDialog && xDialogLibs.is())
- {
- bool bCanAdd = true;
- if (xDialogLibs->hasByName(m_dialogName))
- {
- const OUString sOriginalUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
- //We assume here that library names in extensions are unique, which may not be the case
- //ToDo: If the script exist in another extension, then both extensions must have the
- //same id
- if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
- || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
- || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
- {
- xDialogLibs->removeLibrary(m_dialogName);
- bCanAdd = true;
- }
- else
- {
- bCanAdd = false;
- }
- }
-
- if (bCanAdd)
- {
- xDialogLibs->createLibraryLink( m_dialogName, m_dialogURL, bReadOnly );
- bDialogSuccess = xDialogLibs->hasByName(m_dialogName);
- }
- }
+ bScriptSuccess = lcl_maybeAddScript(bScript, m_name, m_scriptURL, xScriptLibs);
+ bDialogSuccess = lcl_maybeAddScript(bDialog, m_dialogName, m_dialogURL, xDialogLibs);
}
bool bSuccess = bScript || bDialog; // Something must have happened
if( bRunning && !startup)
diff --git a/desktop/source/deployment/registry/script/dp_script.hrc b/desktop/source/deployment/registry/script/dp_script.hrc
index f5b52f1b1f..f5b52f1b1f 100644..100755
--- a/desktop/source/deployment/registry/script/dp_script.hrc
+++ b/desktop/source/deployment/registry/script/dp_script.hrc
diff --git a/desktop/source/deployment/registry/script/makefile.mk b/desktop/source/deployment/registry/script/makefile.mk
index 708def3580..708def3580 100644..100755
--- a/desktop/source/deployment/registry/script/makefile.mk
+++ b/desktop/source/deployment/registry/script/makefile.mk
diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
index 9d66e80f71..4ac316e785 100644
--- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
@@ -99,9 +99,9 @@ ParcelDescDocHandler::startElement( const OUString& aName,
aName + OUSTR("\n"));
if ( !skipIndex )
{
- if ( aName.equals( OUString::createFromAscii( "parcel" ) ) )
+ if ( aName.equals( OUString(RTL_CONSTASCII_USTRINGPARAM( "parcel" )) ) )
{
- m_sLang = xAttribs->getValueByName( OUString::createFromAscii( "language" ) );
+ m_sLang = xAttribs->getValueByName( OUString(RTL_CONSTASCII_USTRINGPARAM( "language" )) );
}
++skipIndex;
}
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 0e8dc29d53..63b1fb8189 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -89,6 +89,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & identifier);
// XPackage
virtual OUString SAL_CALL getDescription() throw (RuntimeException);
+ virtual OUString SAL_CALL getLicenseText() throw (RuntimeException);
};
friend class PackageImpl;
@@ -99,6 +100,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XCommandEnvironment> const & xCmdEnv );
const Reference<deployment::XPackageTypeInfo> m_xTypeInfo;
+
public:
BackendImpl(
@@ -108,6 +110,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
};
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
@@ -134,6 +139,12 @@ OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException)
}
//______________________________________________________________________________
+OUString BackendImpl::PackageImpl::getLicenseText() throw (RuntimeException)
+{
+ return Package::getDescription();
+}
+
+//______________________________________________________________________________
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
OUString const & url, OUString const & libType, bool bRemoved,
@@ -168,50 +179,15 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.framework-script"),
OUString() /* no file filter */,
OUSTR("Scripting Framework Script Library"),
- RID_IMG_SCRIPTLIB, RID_IMG_SCRIPTLIB_HC ) )
+ RID_IMG_SCRIPTLIB ) )
{
if (! transientMode())
{
-/*
- if (office_is_running())
- {
- Reference<XComponentContext> xContext( getComponentContext() );
- m_xScriptLibs.set(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star."
- "script.ApplicationScriptLibraryContainer"),
- xContext ), UNO_QUERY_THROW );
- m_xDialogLibs.set(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star."
- "script.ApplicationDialogLibraryContainer"),
- xContext ), UNO_QUERY_THROW );
- }
- else
- {
- OUString basic_path(
- m_eContext == CONTEXT_USER
- ? OUSTR("vnd.sun.star.expand:${$BRAND_BASE_DIR/program/"
- SAL_CONFIGFILE("bootstrap")
- ":UserInstallation}/user/basic")
- : OUSTR("vnd.sun.star.expand:${$BRAND_BASE_DIR/program/"
- SAL_CONFIGFILE("bootstrap")
- ":BaseInstallation}/share/basic") );
- m_basic_script_libs.reset(
- new LibraryContainer(
- makeURL( basic_path, OUSTR("script.xlc") ),
- getMutex(),
- getComponentContext() ) );
- m_dialog_libs.reset(
- new LibraryContainer(
- makeURL( basic_path, OUSTR("dialog.xlc") ),
- getMutex(),
- getComponentContext() ) );
- }
-*/
}
}
+
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -220,6 +196,12 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return Sequence< Reference<deployment::XPackageTypeInfo> >(&m_xTypeInfo, 1);
}
+void BackendImpl::packageRemoved(OUString const & /*url*/, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -256,7 +238,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.framework-script"))
{
- OUString lang = OUString::createFromAscii("Script");
+ OUString lang = OUString(RTL_CONSTASCII_USTRINGPARAM("Script"));
OUString sParcelDescURL = makeURL(
url, OUSTR("parcel-descriptor.xml") );
@@ -310,7 +292,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
-//##############################################################################
void BackendImpl::PackageImpl:: initPackageHandler()
{
@@ -332,6 +313,11 @@ void BackendImpl::PackageImpl:: initPackageHandler()
{
aContext <<= OUSTR("bundled");
}
+ else if ( that->m_eContext == CONTEXT_BUNDLED_PREREG )
+ {
+ aContext <<= OUSTR("bundled_prereg");
+ }
+
else
{
OSL_ASSERT( 0 );
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc b/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc
index ed164251cc..ed164251cc 100644..100755
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc
diff --git a/desktop/source/deployment/registry/sfwk/makefile.mk b/desktop/source/deployment/registry/sfwk/makefile.mk
index a052296d5c..a052296d5c 100644..100755
--- a/desktop/source/deployment/registry/sfwk/makefile.mk
+++ b/desktop/source/deployment/registry/sfwk/makefile.mk
diff --git a/desktop/source/deployment/target.pmk b/desktop/source/deployment/target.pmk
index 82b41766b2..82b41766b2 100644..100755
--- a/desktop/source/deployment/target.pmk
+++ b/desktop/source/deployment/target.pmk
diff --git a/desktop/source/deployment/unopkg/makefile.mk b/desktop/source/deployment/unopkg/makefile.mk
index 06b39cd2d0..06b39cd2d0 100644..100755
--- a/desktop/source/deployment/unopkg/makefile.mk
+++ b/desktop/source/deployment/unopkg/makefile.mk