diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-01-16 16:42:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-01-16 16:53:49 +0200 |
commit | 081d76c3faa9f242e70f94a253d334e29b7e6595 (patch) | |
tree | a45bb8f581b1efcf187ad2cefd51eebb9fad251e /desktop | |
parent | 6c1852c5526a947f2fb6007dc6a85da588e04b61 (diff) |
Attempt to manage without Berkeley DB on iOS and Android
Berkeley DB is used for help index and extension database. (Possibly
only for a backward-compatible format of the latter, I am not sure.)
Neither use makes much sense on Android and iOS.
The existing help is for LO on desktop OSes anyway, help for LO-based
apps on iOS and Android will naturally be quite different.
On iOS there will definitely be no "extensions", and probably we don't
want to bother with such on Android either.
Diffstat (limited to 'desktop')
8 files changed, 72 insertions, 10 deletions
diff --git a/desktop/Library_deployment.mk b/desktop/Library_deployment.mk index 91561c8488e7..7e455ef66edb 100644 --- a/desktop/Library_deployment.mk +++ b/desktop/Library_deployment.mk @@ -44,7 +44,6 @@ $(eval $(call gb_Library_add_linked_libs,deployment,\ cppu \ cppuhelper \ deploymentmisc \ - helplinker \ sal \ svl \ tl \ @@ -54,15 +53,16 @@ $(eval $(call gb_Library_add_linked_libs,deployment,\ $(gb_STDLIBS) \ )) +ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) $(eval $(call gb_Library_use_externals,deployment,\ berkeleydb \ )) +endif $(eval $(call gb_Library_set_componentfile,deployment,desktop/source/deployment/deployment)) $(eval $(call gb_Library_add_exception_objects,deployment,\ desktop/source/deployment/dp_log \ - desktop/source/deployment/dp_persmap \ desktop/source/deployment/dp_services \ desktop/source/deployment/dp_xml \ desktop/source/deployment/manager/dp_activepackages \ @@ -92,4 +92,16 @@ $(eval $(call gb_Library_add_exception_objects,deployment,\ desktop/source/deployment/registry/sfwk/dp_sfwk \ )) +ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) + +$(eval $(call gb_Library_add_linked_libs,deployment,\ + helplinker \ +)) + +$(eval $(call gb_Library_add_exception_objects,deployment,\ + desktop/source/deployment/dp_persmap \ +)) + +endif + # vim: set ts=4 sw=4 et: diff --git a/desktop/Library_deploymentmisc.mk b/desktop/Library_deploymentmisc.mk index d4bf21128a27..abcc0e29e9c2 100644 --- a/desktop/Library_deploymentmisc.mk +++ b/desktop/Library_deploymentmisc.mk @@ -54,12 +54,19 @@ $(eval $(call gb_Library_add_linked_libs,deploymentmisc,\ $(gb_STDLIBS) \ )) +ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) $(eval $(call gb_Library_use_externals,deploymentmisc,\ berkeleydb \ )) +endif +ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) $(eval $(call gb_Library_add_exception_objects,deploymentmisc,\ desktop/source/deployment/misc/db \ +)) +endif + +$(eval $(call gb_Library_add_exception_objects,deploymentmisc,\ desktop/source/deployment/misc/dp_dependencies \ desktop/source/deployment/misc/dp_descriptioninfoset \ desktop/source/deployment/misc/dp_identifier \ diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx index 47a86c5008b2..b7b99f564d6f 100644 --- a/desktop/source/deployment/manager/dp_activepackages.cxx +++ b/desktop/source/deployment/manager/dp_activepackages.cxx @@ -43,8 +43,6 @@ #include <boost/unordered_map.hpp> #include "dp_identifier.hxx" -#include "dp_persmap.h" - #include "dp_activepackages.hxx" // Old format of database entry: @@ -126,7 +124,15 @@ namespace dp_manager { ActivePackages::ActivePackages() {} -ActivePackages::ActivePackages(::rtl::OUString const & url) : m_map(url) {} +ActivePackages::ActivePackages(::rtl::OUString const & url) +#if !defined(ANDROID) && !defined(IOS) + : m_map(url) +#endif +{ +#if defined(ANDROID) || defined(IOS) + (void)url; +#endif +} ActivePackages::~ActivePackages() {} @@ -140,6 +146,7 @@ bool ActivePackages::get( Data * data, ::rtl::OUString const & id, ::rtl::OUString const & fileName) const { +#if !defined(ANDROID) && !defined(IOS) ::rtl::OString v; if (m_map.get(&v, newKey(id))) { if (data != NULL) { @@ -154,10 +161,17 @@ bool ActivePackages::get( } else { return false; } +#else + (void) data; + (void) id; + (void) fileName; + return false; +#endif } ActivePackages::Entries ActivePackages::getEntries() const { Entries es; +#if !defined(ANDROID) && !defined(IOS) ::dp_misc::t_string2string_map m(m_map.getEntries()); for (::dp_misc::t_string2string_map::const_iterator i(m.begin()); i != m.end(); ++i) @@ -178,10 +192,12 @@ ActivePackages::Entries ActivePackages::getEntries() const { decodeOldData(fn, i->second))); } } +#endif return es; } void ActivePackages::put(::rtl::OUString const & id, Data const & data) { +#if !defined(ANDROID) && !defined(IOS) ::rtl::OStringBuffer b; b.append( ::rtl::OUStringToOString(data.temporaryName, RTL_TEXTENCODING_UTF8)); @@ -194,12 +210,21 @@ void ActivePackages::put(::rtl::OUString const & id, Data const & data) { b.append(separator); b.append(::rtl::OUStringToOString(data.failedPrerequisites, RTL_TEXTENCODING_UTF8)); m_map.put(newKey(id), b.makeStringAndClear()); +#else + (void) id; + (void) data; +#endif } void ActivePackages::erase( ::rtl::OUString const & id, ::rtl::OUString const & fileName) { +#if !defined(ANDROID) && !defined(IOS) m_map.erase(newKey(id), true) || m_map.erase(oldKey(fileName), true); +#else + (void) id; + (void) fileName; +#endif } } diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx index 61057bc9533e..b72484435aec 100644 --- a/desktop/source/deployment/manager/dp_activepackages.hxx +++ b/desktop/source/deployment/manager/dp_activepackages.hxx @@ -34,7 +34,9 @@ #include <utility> #include <vector> +#if !defined(ANDROID) && !defined(IOS) #include "dp_persmap.h" +#endif namespace rtl { class OUString; } @@ -91,8 +93,9 @@ public: private: ActivePackages(ActivePackages &); // not defined void operator =(ActivePackages &); // not defined - +#if !defined(ANDROID) && !defined(IOS) ::dp_misc::PersistentMap m_map; +#endif }; } diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 6c6bd5cb41f3..f1a99dbcef4c 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -40,6 +40,7 @@ #include "com/sun/star/deployment/XPackageManager.hpp" #include "osl/mutex.hxx" #include <list> +#include <boost/unordered_map.hpp> namespace css = ::com::sun::star; diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx index 2bd2fa74a0b5..701d1a6a91a5 100644 --- a/desktop/source/deployment/manager/dp_managerfac.cxx +++ b/desktop/source/deployment/manager/dp_managerfac.cxx @@ -32,6 +32,7 @@ #include "cppuhelper/compbase1.hxx" #include "comphelper/servicedecl.hxx" #include "com/sun/star/deployment/thePackageManagerFactory.hpp" +#include <boost/unordered_map.hpp> using namespace ::dp_misc; diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 85f404c44012..12e5f50984ea 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -32,7 +32,9 @@ #include "dp_configuration.hrc" #include "dp_backend.h" +#if !defined(ANDROID) && !defined(IOS) #include "dp_persmap.h" +#endif #include "dp_ucb.h" #include "rtl/string.hxx" #include "rtl/ustrbuf.hxx" @@ -118,10 +120,10 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv ); - +#if !defined(ANDROID) && !defined(IOS) // for backwards compatibility - nil if no (compatible) back-compat db present ::std::auto_ptr<PersistentMap> m_registeredPackages; - +#endif virtual void SAL_CALL disposing(); const Reference<deployment::XPackageTypeInfo> m_xConfDataTypeInfo; @@ -224,6 +226,8 @@ BackendImpl::BackendImpl( deleteUnusedFolders(OUString(), folders); configmgrini_verify_init( xCmdEnv ); + +#if !defined(ANDROID) && !defined(IOS) SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<PersistentMap> pMap; SAL_WNODEPRECATED_DECLARATIONS_POP @@ -247,6 +251,7 @@ BackendImpl::BackendImpl( } } m_registeredPackages = pMap; +#endif } } @@ -566,13 +571,14 @@ BackendImpl::PackageImpl::isRegistered_( bool bReg = false; if (that->hasActiveEntry(getURL())) bReg = true; +#if !defined(ANDROID) && !defined(IOS) if (!bReg && that->m_registeredPackages.get()) { // fallback for user extension registered in berkeley DB bReg = that->m_registeredPackages->has( rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 )); } - +#endif return beans::Optional< beans::Ambiguous<sal_Bool> >( true, beans::Ambiguous<sal_Bool>( bReg, false ) ); } @@ -754,6 +760,7 @@ void BackendImpl::PackageImpl::processPackage_( } else // revoke { +#if !defined(ANDROID) && !defined(IOS) if (!that->removeFromConfigmgrIni(m_isSchema, url, xCmdEnv) && that->m_registeredPackages.get()) { // Obsolete package database handling - should be removed for LibreOffice 4.0 @@ -803,7 +810,7 @@ void BackendImpl::PackageImpl::processPackage_( OSL_ASSERT(0); } } - +#endif ::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 diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 73f4601f6fae..d121833e2d00 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -39,7 +39,9 @@ #include "svl/inettype.hxx" #include "unotools/pathoptions.hxx" +#if !defined(ANDROID) && !defined(IOS) #include <l10ntools/compilehelp.hxx> +#endif #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> @@ -397,6 +399,7 @@ void BackendImpl::implProcessHelp( data.dataUrl = xPackage->getURL(); if (!package->extensionContainsCompiledHelp()) { +#if !defined(ANDROID) && !defined(IOS) const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); data.dataUrl = sHelpFolder; @@ -593,6 +596,9 @@ void BackendImpl::implProcessHelp( } } } +#else + (void) xCmdEnv; +#endif } //Writing the data entry replaces writing the flag file. If we got to this //point the registration was successful. |