summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-23 19:06:58 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-26 18:45:04 +0200
commit5a5c8e253abbef5626dab70f8978275ac3c742f8 (patch)
tree86c65cdfbff8ea0140937dee1311f65619f9aaf7 /desktop
parent3ee3e7946c4a772fd13eada4b235479581190dce (diff)
Check feature test macros instead of ANDROID and/or IOS
Pass -DLIBO_FEATURE_FOO to compiler for some elements in BUILD_TYPE. BUILD_TYPE has at least two kinds of elements: Those that indicate building a bundled copy of some 3rd-party library, and those that indicate some specific feature of the LibreOffice platform or build-time configuration choice. This is for the latter kind. Change many of the checks for Android and/or iOS in the source code to check LIBO_FEATURE_DESKTOP, LIBO_FEATURE_HELP or DISABLE_EXTENSIONS instead, in cases where that is what is meant, not Android or iOS specifically. Change-Id: I2cd3f3bb99e953c7754dcea76a426f8f9d61e4db
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx8
-rw-r--r--desktop/source/app/cmdlineargs.cxx2
-rw-r--r--desktop/source/app/officeipcthread.cxx10
-rw-r--r--desktop/source/app/userinstall.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.cxx17
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.hxx4
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx13
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx4
8 files changed, 32 insertions, 28 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d3e7b26f37ff..6a3e3deddfc5 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1386,7 +1386,8 @@ int Desktop::Main()
new DesktopContext( com::sun::star::uno::getCurrentContext() ) );
CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
-#if !defined(ANDROID) && !defined(IOS)
+
+#ifdef LIBO_FEATURE_DESKTOP
OUString aUnknown( rCmdLineArgs.GetUnknown() );
if ( !aUnknown.isEmpty() )
{
@@ -1450,7 +1451,8 @@ int Desktop::Main()
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
m_xLockfile.reset(new Lockfile);
-#if !defined(ANDROID) && !defined(IOS)
+
+#ifdef LIBO_FEATURE_DESKTOP
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() &&
!rCmdLineArgs.IsNoLockcheck() && !m_xLockfile->check( Lockfile_execWarning ))
{
@@ -1537,7 +1539,7 @@ int Desktop::Main()
*/
Application::GetDefaultDevice();
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
// Check if bundled or shared extensions were added /removed
// and process those extensions (has to be done before checking
// the extension dependencies!
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 6ebe54eef62d..b8cf15302128 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -442,7 +442,7 @@ bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg
{
m_nologo = true;
}
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
else if ( oArg == "nolockcheck" )
{
m_nolockcheck = true;
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index af4499052195..071e2bb851ef 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -59,7 +59,7 @@ namespace {
static char const ARGUMENT_PREFIX[] = "InternalIPC::Arguments";
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
static char const SEND_ARGUMENTS[] = "InternalIPC::SendArguments";
static char const PROCESSING_DONE[] = "InternalIPC::ProcessingDone";
@@ -105,7 +105,7 @@ namespace desktop
namespace {
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
class Parser: public CommandLineArgs::Supplier {
public:
@@ -451,7 +451,7 @@ void OfficeIPCThread::RequestsCompleted( int nCount )
OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
::osl::MutexGuard aGuard( GetMutex() );
if( pGlobalOfficeIPCThread.is() )
@@ -613,7 +613,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
void OfficeIPCThread::DisableOfficeIPCThread(bool join)
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
osl::ClearableMutexGuard aMutex( GetMutex() );
if( pGlobalOfficeIPCThread.is() )
@@ -673,7 +673,7 @@ void OfficeIPCThread::SetReady(
void OfficeIPCThread::execute()
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
do
{
osl::StreamPipe aStreamPipe;
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 1ae05ceaad09..ec5c5ca09a37 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -116,7 +116,7 @@ namespace desktop {
}
}
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_DESKTOP
static osl::FileBase::RC copy_recursive( const rtl::OUString& srcUnqPath, const rtl::OUString& dstUnqPath)
{
FileBase::RC err;
diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx
index 619aed1987c6..1a4081f252ee 100644
--- a/desktop/source/deployment/manager/dp_activepackages.cxx
+++ b/desktop/source/deployment/manager/dp_activepackages.cxx
@@ -43,7 +43,7 @@
// key: 0xFF UTF8(identifier)
// value: UTF8(tempname) 0xFF UTF8(filename) 0xFF UTF8(mediatype)
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
namespace {
@@ -117,13 +117,12 @@ namespace dp_manager {
ActivePackages::ActivePackages() {}
ActivePackages::ActivePackages(::rtl::OUString const & url, bool readOnly)
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
: m_map(url, readOnly)
#endif
{
-#if defined(ANDROID) || defined(IOS)
- (void)url; (void)readOnly;
-#endif
+ (void) url;
+ (void) readOnly;
}
ActivePackages::~ActivePackages() {}
@@ -138,7 +137,7 @@ bool ActivePackages::get(
Data * data, ::rtl::OUString const & id, ::rtl::OUString const & fileName)
const
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
::rtl::OString v;
if (m_map.get(&v, newKey(id))) {
if (data != NULL) {
@@ -163,7 +162,7 @@ bool ActivePackages::get(
ActivePackages::Entries ActivePackages::getEntries() const {
Entries es;
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
::dp_misc::t_string2string_map m(m_map.getEntries());
for (::dp_misc::t_string2string_map::const_iterator i(m.begin());
i != m.end(); ++i)
@@ -189,7 +188,7 @@ ActivePackages::Entries ActivePackages::getEntries() const {
}
void ActivePackages::put(::rtl::OUString const & id, Data const & data) {
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
::rtl::OStringBuffer b;
b.append(
::rtl::OUStringToOString(data.temporaryName, RTL_TEXTENCODING_UTF8));
@@ -211,7 +210,7 @@ void ActivePackages::put(::rtl::OUString const & id, Data const & data) {
void ActivePackages::erase(
::rtl::OUString const & id, ::rtl::OUString const & fileName)
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
m_map.erase(newKey(id), true) || m_map.erase(oldKey(fileName), true);
#else
(void) id;
diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx
index 254d09acdf65..fa2d909d3d97 100644
--- a/desktop/source/deployment/manager/dp_activepackages.hxx
+++ b/desktop/source/deployment/manager/dp_activepackages.hxx
@@ -25,7 +25,7 @@
#include <utility>
#include <vector>
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
#include "dp_persmap.h"
#endif
@@ -84,7 +84,7 @@ public:
private:
ActivePackages(ActivePackages &); // not defined
void operator =(ActivePackages &); // not defined
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
::dp_misc::PersistentMap m_map;
#endif
};
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 74fd3987133f..7c5b5d0b4a3a 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -23,7 +23,7 @@
#include "dp_configuration.hrc"
#include "dp_backend.h"
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
#include "dp_persmap.h"
#endif
#include "dp_ucb.h"
@@ -110,10 +110,12 @@ 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)
+
+#ifndef DISABLE_EXTENSIONS
// 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;
@@ -215,7 +217,7 @@ BackendImpl::BackendImpl(
configmgrini_verify_init( xCmdEnv );
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<PersistentMap> pMap;
SAL_WNODEPRECATED_DECLARATIONS_POP
@@ -551,7 +553,8 @@ BackendImpl::PackageImpl::isRegistered_(
bool bReg = false;
if (that->hasActiveEntry(getURL()))
bReg = true;
-#if !defined(ANDROID) && !defined(IOS)
+
+#ifndef DISABLE_EXTENSIONS
if (!bReg && that->m_registeredPackages.get())
{
// fallback for user extension registered in berkeley DB
@@ -740,7 +743,7 @@ void BackendImpl::PackageImpl::processPackage_(
}
else // revoke
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifndef DISABLE_EXTENSIONS
if (!that->removeFromConfigmgrIni(m_isSchema, url, xCmdEnv) &&
that->m_registeredPackages.get()) {
// Obsolete package database handling - should be removed for LibreOffice 4.0
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 67598b91a96a..5c660fb3d393 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -31,7 +31,7 @@
#include "uno/current_context.hxx"
#include "unotools/pathoptions.hxx"
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_HELP
#include <helpcompiler/compilehelp.hxx>
#include <helpcompiler/HelpIndexer.hxx>
#endif
@@ -386,7 +386,7 @@ void BackendImpl::implProcessHelp(
data.dataUrl = xPackage->getURL();
if (!package->extensionContainsCompiledHelp())
{
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef LIBO_FEATURE_HELP
const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
data.dataUrl = sHelpFolder;