summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-14 10:49:08 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-14 11:06:48 +0000
commit218cd09611583437c05c33e2aa3b2b81cb416f98 (patch)
tree1b3b99677e6acff1f6224f9bd7441f161fcf2596 /include
parentf7965b0bcd559451c471a26bf5fd6f542887d95e (diff)
inline some use-once macros
Change-Id: I7ebd8fe70b083a772118a1aab8cdfbf795d6f1e5 Reviewed-on: https://gerrit.libreoffice.org/23235 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/canvas/verbosetrace.hxx32
-rw-r--r--include/oox/core/relations.hxx5
-rw-r--r--include/sfx2/childwin.hxx24
-rw-r--r--include/tools/mempool.hxx24
-rw-r--r--include/tools/pstm.hxx5
-rw-r--r--include/ucbhelper/macros.hxx33
-rw-r--r--include/vbahelper/vbahelperinterface.hxx43
7 files changed, 35 insertions, 131 deletions
diff --git a/include/canvas/verbosetrace.hxx b/include/canvas/verbosetrace.hxx
deleted file mode 100644
index a5bc61ba7fe8..000000000000
--- a/include/canvas/verbosetrace.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_CANVAS_VERBOSETRACE_HXX
-#define INCLUDED_CANVAS_VERBOSETRACE_HXX
-
-#include <sal/config.h>
-
-#include <sal/detail/log.h>
-
-#define VERBOSE_TRACE(...) \
- SAL_DETAIL_INFO_IF_FORMAT(true, "canvas.level2", __VA_ARGS__)
-
-#endif /* INCLUDED_CANVAS_VERBOSETRACE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/relations.hxx b/include/oox/core/relations.hxx
index 018634972535..7663cb5a0597 100644
--- a/include/oox/core/relations.hxx
+++ b/include/oox/core/relations.hxx
@@ -39,11 +39,6 @@ namespace core {
#define CREATE_OFFICEDOC_RELATION_TYPE_STRICT( ascii ) \
( "http://purl.oclc.org/ooxml/officeDocument/relationships/" ascii )
-/** Expands to an OUString containing a 'package' relation type created from
- the passed literal(!) ASCII(!) character array. */
-#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \
- ( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii )
-
/** Expands to an OUString containing an MS Office specific relation type
created from the passed literal(!) ASCII(!) character array. */
#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 1afc54dbd3e6..8469fbc1974d 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -215,36 +215,12 @@ public:
};
-//! soon obsolete !
-#define SFX_DECL_CHILDWINDOW_CONTEXT(Class) \
- static SfxChildWindowContext* CreateImpl(vcl::Window *pParent, \
- SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
- static void RegisterChildWindowContext(SfxModule *pMod=nullptr); \
-
//! The Macro of the future ...
#define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
static SfxChildWindowContext* CreateImpl(vcl::Window *pParent, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindowContext(sal_uInt16, SfxModule *pMod=nullptr); \
-//! soon obsolete !
-#define SFX_IMPL_CHILDWINDOW_CONTEXT(Class, MyID, ShellClass) \
- SfxChildWindowContext* Class::CreateImpl( vcl::Window *pParent, \
- SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
- { \
- SfxChildWindowContext *pContext = new Class(pParent, \
- /* cast is safe here! */static_cast< sal_uInt16 >(ShellClass::GetInterfaceId()), \
- pBindings,pInfo); \
- return pContext; \
- } \
- void Class::RegisterChildWindowContext(SfxModule* pMod) \
- { \
- SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( \
- Class::CreateImpl, \
- /* cast is safe here! */static_cast< sal_uInt16 >(ShellClass::GetInterfaceId()) ); \
- SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, pFact); \
- }
-
//! The Macro of the future ...
// As a parameter and because of ContextId, CreateImpl must be handed the
// factory. As long as Id is set to 0 and patched in
diff --git a/include/tools/mempool.hxx b/include/tools/mempool.hxx
index ef3fe6c92f5f..4ff29d2d950d 100644
--- a/include/tools/mempool.hxx
+++ b/include/tools/mempool.hxx
@@ -43,9 +43,6 @@ public:
#define DECL_FIXEDMEMPOOL_NEW_DECL() \
static void * operator new( size_t n )
-#define DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
-void * Class::operator new( size_t n )
-
#define IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
{ \
if ( n == sizeof( Class ) ) \
@@ -54,16 +51,9 @@ void * Class::operator new( size_t n )
return ::operator new(n); \
}
-#define DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
-DECL_FIXEDMEMPOOL_NEW_DECL() \
-IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool )
-
#define DECL_FIXEDMEMPOOL_DEL_DECL() \
static void operator delete( void * p, size_t n )
-#define DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
-void Class::operator delete( void * p, size_t n )
-
#define IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool ) \
{ \
if ( n == sizeof( Class ) ) \
@@ -72,16 +62,14 @@ void Class::operator delete( void * p, size_t n )
::operator delete(p); \
}
-#define DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool ) \
-DECL_FIXEDMEMPOOL_DEL_DECL() \
-IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
-
#define DECL_FIXEDMEMPOOL_NEWDEL( Class ) \
private: \
static FixedMemPool aPool; \
public: \
- DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
- DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool )
+ DECL_FIXEDMEMPOOL_NEW_DECL() \
+ IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
+ DECL_FIXEDMEMPOOL_DEL_DECL() \
+ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
#define IMPL_FIXEDMEMPOOL_NEWDEL( Class ) \
FixedMemPool Class::aPool( SAL_STRINGIFY( Class ), sizeof( Class ) );
@@ -95,9 +83,9 @@ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
#define IMPL_FIXEDMEMPOOL_NEWDEL_DLL( Class ) \
FixedMemPool Class::aPool( SAL_STRINGIFY( Class ), sizeof( Class ) ); \
- DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
+ void * Class::operator new( size_t n ) \
IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
- DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
+ void Class::operator delete( void * p, size_t n ) \
IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
#endif
diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx
index ffbaac1c0d9f..b948f15b24e8 100644
--- a/include/tools/pstm.hxx
+++ b/include/tools/pstm.hxx
@@ -59,7 +59,7 @@ public:
virtual void Load( SvPersistStream & ) override; \
virtual void Save( SvPersistStream & ) override;
-#define PRV_SV_IMPL_PERSIST( Class ) \
+#define SV_IMPL_PERSIST1( Class, Super1 ) \
void * Class::CreateInstance( SvPersistBase ** ppBase )\
{ \
Class * p = new Class(); \
@@ -76,9 +76,6 @@ public:
return rStm; \
}
-#define SV_IMPL_PERSIST1( Class, Super1 ) \
- PRV_SV_IMPL_PERSIST( Class )
-
class SvPersistStream;
class SvPersistBase : public SvRttiBase
diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx
index 483be3405336..57de0edcc725 100644
--- a/include/ucbhelper/macros.hxx
+++ b/include/ucbhelper/macros.hxx
@@ -185,16 +185,6 @@ Class::getSupportedServiceNames() \
return getSupportedServiceNames_Static(); \
}
-#define XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
-static css::uno::Reference< css::uno::XInterface > SAL_CALL \
-Class##_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr ) \
- throw( css::uno::Exception ) \
-{ \
- css::lang::XServiceInfo* pX = \
- static_cast<css::lang::XServiceInfo*>(new Class( rSMgr )); \
- return css::uno::Reference< css::uno::XInterface >::query( pX ); \
-}
-
#define XSERVICEINFO_CREATE_INSTANCE_IMPL_CTX( Class ) \
static css::uno::Reference< css::uno::XInterface > SAL_CALL \
Class##_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr ) \
@@ -254,15 +244,20 @@ Class::getSupportedServiceNames_Static()
// 1 service name
#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
-XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
-XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
- \
-css::uno::Sequence< OUString > \
-Class::getSupportedServiceNames_Static() \
-{ \
- css::uno::Sequence< OUString > aSNS { Service1 }; \
- return aSNS; \
-}
+ XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+ static css::uno::Reference< css::uno::XInterface > SAL_CALL \
+ Class##_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr ) \
+ throw( css::uno::Exception ) \
+ { \
+ css::lang::XServiceInfo* pX = \
+ static_cast<css::lang::XServiceInfo*>(new Class( rSMgr )); \
+ return css::uno::Reference< css::uno::XInterface >::query( pX ); \
+ } \
+ css::uno::Sequence< OUString > \
+ Class::getSupportedServiceNames_Static() \
+ { \
+ return css::uno::Sequence< OUString > { Service1 }; \
+ }
// 1 service name
#define XSERVICEINFO_IMPL_1_CTX( Class, ImplName, Service1 ) \
diff --git a/include/vbahelper/vbahelperinterface.hxx b/include/vbahelper/vbahelperinterface.hxx
index 1ec99155e270..d72200771350 100644
--- a/include/vbahelper/vbahelperinterface.hxx
+++ b/include/vbahelper/vbahelperinterface.hxx
@@ -108,33 +108,6 @@ public:
};
-/** Helper macro to implement the method 'getServiceImplName()' of the
- 'ooo.vba.XHelperInterface' interface. Will return the class name as service
- implementation name.
- */
-#define VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
-OUString classname::getServiceImplName() \
-{ \
- return OUString( #classname ); \
-}
-
-
-/** Helper macro to implement the method 'getServiceNames()' for a single
- service name.
- */
-#define VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename ) \
-css::uno::Sequence< OUString > classname::getServiceNames() \
-{ \
- static css::uno::Sequence< OUString > saServiceNames; \
- if( saServiceNames.getLength() == 0 ) \
- { \
- saServiceNames.realloc( 1 ); \
- saServiceNames[ 0 ] = servicename; \
- } \
- return saServiceNames; \
-}
-
-
/** Helper macro to declare the methods 'getServiceImplName()' and
'getServiceNames()' of the 'ooo.vba.XHelperInterface' interface in a class
declaration.
@@ -149,8 +122,20 @@ css::uno::Sequence< OUString > classname::getServiceNames() \
return the class name as service implementation name.
*/
#define VBAHELPER_IMPL_XHELPERINTERFACE( classname, servicename ) \
-VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
-VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename )
+OUString classname::getServiceImplName() \
+{ \
+ return OUString( #classname ); \
+} \
+css::uno::Sequence< OUString > classname::getServiceNames() \
+{ \
+ static css::uno::Sequence< OUString > saServiceNames; \
+ if( saServiceNames.getLength() == 0 ) \
+ { \
+ saServiceNames.realloc( 1 ); \
+ saServiceNames[ 0 ] = servicename; \
+ } \
+ return saServiceNames; \
+}
#endif