summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:03:16 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-21 13:19:17 +0100
commit01baeab99890e5650b3dabc15f8d900490a5a133 (patch)
tree64a1b30b20a53262605312fff4d035876fc7c811 /include/comphelper
parent0108cd51faf942b3fc3a292522d4b2f421f1cf45 (diff)
tdf#123936 Formatting files in module include with clang-format
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/anytostring.hxx9
-rw-r--r--include/comphelper/base64.hxx10
-rw-r--r--include/comphelper/comphelperdllapi.h4
-rw-r--r--include/comphelper/evtmethodhelper.hxx6
-rw-r--r--include/comphelper/extract.hxx22
-rw-r--r--include/comphelper/fileformat.h10
-rw-r--r--include/comphelper/fileurl.hxx7
-rw-r--r--include/comphelper/genericpropertyset.hxx13
-rw-r--r--include/comphelper/getexpandeduri.hxx18
-rw-r--r--include/comphelper/lok.hxx14
-rw-r--r--include/comphelper/make_shared_from_uno.hxx17
-rw-r--r--include/comphelper/namecontainer.hxx9
-rw-r--r--include/comphelper/profilezone.hxx16
-rw-r--r--include/comphelper/random.hxx1
-rw-r--r--include/comphelper/refcountedmutex.hxx2
-rw-r--r--include/comphelper/streamsection.hxx32
16 files changed, 105 insertions, 85 deletions
diff --git a/include/comphelper/anytostring.hxx b/include/comphelper/anytostring.hxx
index 21afda1a6cd1..6d100221e7d8 100644
--- a/include/comphelper/anytostring.hxx
+++ b/include/comphelper/anytostring.hxx
@@ -23,11 +23,13 @@
#include <rtl/ustring.hxx>
#include <comphelper/comphelperdllapi.h>
-namespace com::sun::star::uno { class Any; }
+namespace com::sun::star::uno
+{
+class Any;
+}
namespace comphelper
{
-
/** Creates a STRING representation out of an ANY value.
@param value
@@ -35,8 +37,7 @@ namespace comphelper
@return
STRING representation of given ANY value
*/
-COMPHELPER_DLLPUBLIC OUString anyToString( css::uno::Any const & value );
-
+COMPHELPER_DLLPUBLIC OUString anyToString(css::uno::Any const& value);
}
#endif
diff --git a/include/comphelper/base64.hxx b/include/comphelper/base64.hxx
index d962aabacda0..a77ac4ebe3b2 100644
--- a/include/comphelper/base64.hxx
+++ b/include/comphelper/base64.hxx
@@ -26,10 +26,13 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
-namespace com::sun::star::uno { template <class E> class Sequence; }
-
-namespace comphelper {
+namespace com::sun::star::uno
+{
+template <class E> class Sequence;
+}
+namespace comphelper
+{
class COMPHELPER_DLLPUBLIC Base64
{
public:
@@ -47,7 +50,6 @@ public:
static sal_Int32 decodeSomeChars(css::uno::Sequence<sal_Int8>& aPass, const OUString& sBuffer);
};
-
}
#endif // INCLUDED_COMPHELPER_BASE64_HXX
diff --git a/include/comphelper/comphelperdllapi.h b/include/comphelper/comphelperdllapi.h
index 3416513b94eb..361326a4e406 100644
--- a/include/comphelper/comphelperdllapi.h
+++ b/include/comphelper/comphelperdllapi.h
@@ -22,9 +22,9 @@
#include <sal/types.h>
#if defined(COMPHELPER_DLLIMPLEMENTATION)
-#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
#else
-#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#define COMPHELPER_DLLPRIVATE SAL_DLLPRIVATE
diff --git a/include/comphelper/evtmethodhelper.hxx b/include/comphelper/evtmethodhelper.hxx
index 7c900a1a8324..f420b1869422 100644
--- a/include/comphelper/evtmethodhelper.hxx
+++ b/include/comphelper/evtmethodhelper.hxx
@@ -24,9 +24,9 @@
namespace comphelper
{
- COMPHELPER_DLLPUBLIC css::uno::Sequence< OUString> getEventMethodsForType(const css::uno::Type& type);
+COMPHELPER_DLLPUBLIC css::uno::Sequence<OUString>
+getEventMethodsForType(const css::uno::Type& type);
-
-} // namespace comphelper
+} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/extract.hxx b/include/comphelper/extract.hxx
index 91682400d770..c8ab9c6e6e7b 100644
--- a/include/comphelper/extract.hxx
+++ b/include/comphelper/extract.hxx
@@ -30,7 +30,6 @@
namespace cppu
{
-
/**
* Sets enum from int32 value. This function does NOT check for valid enum values!
*
@@ -38,11 +37,10 @@ namespace cppu
* @param rType enum type
* @return enum or empty any.
*/
-inline css::uno::Any int2enum(
- sal_Int32 nEnum, const css::uno::Type & rType )
+inline css::uno::Any int2enum(sal_Int32 nEnum, const css::uno::Type& rType)
{
assert(rType.getTypeClass() == css::uno::TypeClass_ENUM);
- return css::uno::Any( &nEnum, rType );
+ return css::uno::Any(&nEnum, rType);
}
/**
@@ -53,11 +51,11 @@ inline css::uno::Any int2enum(
* @retval true if enum or int value was set
* @retval false otherwise
*/
-inline bool enum2int( sal_Int32 & rnEnum, const css::uno::Any & rAny )
+inline bool enum2int(sal_Int32& rnEnum, const css::uno::Any& rAny)
{
if (rAny.getValueTypeClass() == css::uno::TypeClass_ENUM)
{
- rnEnum = * static_cast< const sal_Int32 * >( rAny.getValue() );
+ rnEnum = *static_cast<const sal_Int32*>(rAny.getValue());
return true;
}
@@ -72,15 +70,14 @@ inline bool enum2int( sal_Int32 & rnEnum, const css::uno::Any & rAny )
* @param rAny enum or int
* @throws css::lang::IllegalArgumentException
*/
-template< typename E >
-inline void any2enum( E & eRet, const css::uno::Any & rAny )
+template <typename E> inline void any2enum(E& eRet, const css::uno::Any& rAny)
{
// check for typesafe enum
- if (! (rAny >>= eRet))
+ if (!(rAny >>= eRet))
{
// if not enum, maybe integer?
sal_Int32 nValue = 0;
- if (! (rAny >>= nValue))
+ if (!(rAny >>= nValue))
throw css::lang::IllegalArgumentException();
eRet = static_cast<E>(nValue);
@@ -94,7 +91,7 @@ inline void any2enum( E & eRet, const css::uno::Any & rAny )
*
* @throws css::lang::IllegalArgumentException
*/
-inline bool any2bool( const css::uno::Any & rAny )
+inline bool any2bool(const css::uno::Any& rAny)
{
bool b;
if (rAny >>= b)
@@ -104,12 +101,11 @@ inline bool any2bool( const css::uno::Any & rAny )
else
{
sal_Int32 nValue = 0;
- if (! (rAny >>= nValue))
+ if (!(rAny >>= nValue))
throw css::lang::IllegalArgumentException();
return nValue != 0;
}
}
-
}
#endif
diff --git a/include/comphelper/fileformat.h b/include/comphelper/fileformat.h
index fb9d8175f2e3..7eabf5829733 100644
--- a/include/comphelper/fileformat.h
+++ b/include/comphelper/fileformat.h
@@ -22,11 +22,11 @@
/* file format versions *************************************************/
-#define SOFFICE_FILEFORMAT_31 3450
-#define SOFFICE_FILEFORMAT_40 3580
-#define SOFFICE_FILEFORMAT_50 5050
-#define SOFFICE_FILEFORMAT_60 6200
-#define SOFFICE_FILEFORMAT_8 6800
+#define SOFFICE_FILEFORMAT_31 3450
+#define SOFFICE_FILEFORMAT_40 3580
+#define SOFFICE_FILEFORMAT_50 5050
+#define SOFFICE_FILEFORMAT_60 6200
+#define SOFFICE_FILEFORMAT_8 6800
#define SOFFICE_FILEFORMAT_CURRENT SOFFICE_FILEFORMAT_8
#endif
diff --git a/include/comphelper/fileurl.hxx b/include/comphelper/fileurl.hxx
index 9275d4abbfc4..27ac6b576b2e 100644
--- a/include/comphelper/fileurl.hxx
+++ b/include/comphelper/fileurl.hxx
@@ -25,11 +25,10 @@
#include <comphelper/comphelperdllapi.h>
#include <rtl/ustring.hxx>
-namespace comphelper {
-
+namespace comphelper
+{
// Return true iff url is an absolute URL of "file" scheme:
-COMPHELPER_DLLPUBLIC bool isFileUrl(OUString const & url);
-
+COMPHELPER_DLLPUBLIC bool isFileUrl(OUString const& url);
}
#endif
diff --git a/include/comphelper/genericpropertyset.hxx b/include/comphelper/genericpropertyset.hxx
index 8f61ac14befb..2450ef04799b 100644
--- a/include/comphelper/genericpropertyset.hxx
+++ b/include/comphelper/genericpropertyset.hxx
@@ -23,12 +23,19 @@
#include <com/sun/star/uno/Reference.h>
#include <comphelper/comphelperdllapi.h>
-namespace com::sun::star::beans { class XPropertySet; }
-namespace comphelper { class PropertySetInfo; }
+namespace com::sun::star::beans
+{
+class XPropertySet;
+}
+namespace comphelper
+{
+class PropertySetInfo;
+}
namespace comphelper
{
- COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance( PropertySetInfo* pInfo );
+COMPHELPER_DLLPUBLIC css::uno::Reference<css::beans::XPropertySet>
+GenericPropertySet_CreateInstance(PropertySetInfo* pInfo);
}
#endif // INCLUDED_COMPHELPER_GENERICPROPERTYSET_HXX
diff --git a/include/comphelper/getexpandeduri.hxx b/include/comphelper/getexpandeduri.hxx
index 90eb101b7b2c..5b75c43d48fe 100644
--- a/include/comphelper/getexpandeduri.hxx
+++ b/include/comphelper/getexpandeduri.hxx
@@ -15,11 +15,17 @@
#include <comphelper/comphelperdllapi.h>
#include <rtl/ustring.hxx>
-namespace com::sun::star::uno { class XComponentContext; }
-namespace com::sun::star::uno { template <typename > class Reference; }
-
-namespace comphelper {
+namespace com::sun::star::uno
+{
+class XComponentContext;
+}
+namespace com::sun::star::uno
+{
+template <typename> class Reference;
+}
+namespace comphelper
+{
/**
A helper function to expand vnd.sun.star.expand URLs.
@@ -28,9 +34,7 @@ namespace comphelper {
is returned unchanged.
*/
COMPHELPER_DLLPUBLIC OUString getExpandedUri(
- css::uno::Reference<css::uno::XComponentContext> const & context,
- OUString const & uri);
-
+ css::uno::Reference<css::uno::XComponentContext> const& context, OUString const& uri);
}
#endif
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 2391ceab3661..07b8ef6aa426 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -20,16 +20,20 @@ class LanguageTag;
namespace comphelper::LibreOfficeKit
{
-
// Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
// places in LibreOffice code.
COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
-enum class statusIndicatorCallbackType { Start, SetValue, Finish };
-
-COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data);
+enum class statusIndicatorCallbackType
+{
+ Start,
+ SetValue,
+ Finish
+};
+COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(
+ void (*callback)(void* data, statusIndicatorCallbackType type, int percent), void* data);
// Functions that can be called from arbitrary places in LibreOffice.
@@ -80,7 +84,6 @@ COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag);
/// Get compatibility flags
COMPHELPER_DLLPUBLIC bool isCompatFlagSet(Compat flag);
-
/// Check whether clients want viewId in visible cursor invalidation payload.
COMPHELPER_DLLPUBLIC bool isViewIdForVisCursorInvalidation();
/// Set whether clients want viewId in visible cursor invalidation payload.
@@ -104,7 +107,6 @@ COMPHELPER_DLLPUBLIC bool isAllowlistedLanguage(const OUString& lang);
COMPHELPER_DLLPUBLIC void statusIndicatorStart();
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
-
}
#endif // INCLUDED_COMPHELPER_LOK_HXX
diff --git a/include/comphelper/make_shared_from_uno.hxx b/include/comphelper/make_shared_from_uno.hxx
index b30dde09d115..7075e300042c 100644
--- a/include/comphelper/make_shared_from_uno.hxx
+++ b/include/comphelper/make_shared_from_uno.hxx
@@ -21,13 +21,15 @@
#include <memory>
-namespace comphelper {
-
+namespace comphelper
+{
/// @internal
-namespace detail {
+namespace detail
+{
/// @internal
-template <typename T> struct ReleaseFunc {
- void operator()( T * p ) const { p->release(); }
+template <typename T> struct ReleaseFunc
+{
+ void operator()(T* p) const { p->release(); }
};
} // namespace detail
@@ -53,11 +55,10 @@ template <typename T> struct ReleaseFunc {
@param p object pointer
@return shared_ptr to object
*/
-template <typename T>
-inline std::shared_ptr<T> make_shared_from_UNO( T * p )
+template <typename T> inline std::shared_ptr<T> make_shared_from_UNO(T* p)
{
p->acquire();
- return std::shared_ptr<T>( p, detail::ReleaseFunc<T>() );
+ return std::shared_ptr<T>(p, detail::ReleaseFunc<T>());
}
} // namespace comphelper
diff --git a/include/comphelper/namecontainer.hxx b/include/comphelper/namecontainer.hxx
index 86553e52ff6c..616b07f1a342 100644
--- a/include/comphelper/namecontainer.hxx
+++ b/include/comphelper/namecontainer.hxx
@@ -24,12 +24,15 @@
#include <com/sun/star/uno/Reference.h>
#include <comphelper/comphelperdllapi.h>
-namespace com::sun::star::container { class XNameContainer; }
+namespace com::sun::star::container
+{
+class XNameContainer;
+}
namespace comphelper
{
- COMPHELPER_DLLPUBLIC css::uno::Reference< css::container::XNameContainer >
- NameContainer_createInstance( const css::uno::Type& aType );
+COMPHELPER_DLLPUBLIC css::uno::Reference<css::container::XNameContainer>
+NameContainer_createInstance(const css::uno::Type& aType);
}
#endif // INCLUDED_COMPHELPER_NAMECONTAINER_HXX
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 81294a4c41c6..f1276e64cd67 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -22,13 +22,11 @@
namespace comphelper
{
-
namespace ProfileRecording
{
-
COMPHELPER_DLLPUBLIC void startRecording(bool bRecording);
-COMPHELPER_DLLPUBLIC long long addRecording(const char * aProfileId, long long aCreateTime);
+COMPHELPER_DLLPUBLIC long long addRecording(const char* aProfileId, long long aCreateTime);
COMPHELPER_DLLPUBLIC css::uno::Sequence<OUString> getRecordingAndClear();
@@ -37,11 +35,12 @@ COMPHELPER_DLLPUBLIC css::uno::Sequence<OUString> getRecordingAndClear();
class COMPHELPER_DLLPUBLIC ProfileZone
{
private:
- const char * m_sProfileId;
+ const char* m_sProfileId;
long long m_aCreateTime;
bool m_bConsole;
void startConsole();
void stopConsole();
+
public:
static std::atomic<bool> g_bRecording; // true during recording
@@ -60,10 +59,10 @@ public:
* Similar to the DEBUG macro in sal/log.hxx, don't forget to remove these lines before
* committing.
*/
- ProfileZone(const char *sProfileId, bool bConsole = false)
- : m_sProfileId(sProfileId),
- m_aCreateTime(g_bRecording ? ProfileRecording::addRecording(sProfileId, 0) : 0),
- m_bConsole(bConsole)
+ ProfileZone(const char* sProfileId, bool bConsole = false)
+ : m_sProfileId(sProfileId)
+ , m_aCreateTime(g_bRecording ? ProfileRecording::addRecording(sProfileId, 0) : 0)
+ , m_bConsole(bConsole)
{
if (m_bConsole)
{
@@ -83,7 +82,6 @@ public:
} // namespace comphelper
-
#endif // INCLUDED_COMPHELPER_PROFILEZONE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/random.hxx b/include/comphelper/random.hxx
index 4eee4ff2de1f..345d57c7158d 100644
--- a/include/comphelper/random.hxx
+++ b/include/comphelper/random.hxx
@@ -14,7 +14,6 @@
namespace comphelper::rng
{
-
// These functions obey the SAL_RAND_REPEATABLE environment
// variable: If it is set, use a fixed seed.
diff --git a/include/comphelper/refcountedmutex.hxx b/include/comphelper/refcountedmutex.hxx
index cda0c981890a..fcda72097988 100644
--- a/include/comphelper/refcountedmutex.hxx
+++ b/include/comphelper/refcountedmutex.hxx
@@ -26,10 +26,10 @@
namespace comphelper
{
-
class COMPHELPER_DLLPUBLIC RefCountedMutex final : public salhelper::SimpleReferenceObject
{
osl::Mutex m_aMutex;
+
public:
~RefCountedMutex() override;
diff --git a/include/comphelper/streamsection.hxx b/include/comphelper/streamsection.hxx
index c4f945966ab5..fa1fe8ac93f2 100644
--- a/include/comphelper/streamsection.hxx
+++ b/include/comphelper/streamsection.hxx
@@ -24,13 +24,21 @@
#include <com/sun/star/uno/Reference.h>
#include <comphelper/comphelperdllapi.h>
-namespace com::sun::star::io { class XDataInputStream; }
-namespace com::sun::star::io { class XDataOutputStream; }
-namespace com::sun::star::io { class XMarkableStream; }
+namespace com::sun::star::io
+{
+class XDataInputStream;
+}
+namespace com::sun::star::io
+{
+class XDataOutputStream;
+}
+namespace com::sun::star::io
+{
+class XMarkableStream;
+}
namespace comphelper
{
-
/** implements handling for compatibly reading/writing data from/into an input/output stream.
data written in a block secured by this class should be readable by older versions which
use the same mechanism.
@@ -38,25 +46,25 @@ namespace comphelper
class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OStreamSection
{
- css::uno::Reference< css::io::XMarkableStream > m_xMarkStream;
- css::uno::Reference< css::io::XDataInputStream > m_xInStream;
- css::uno::Reference< css::io::XDataOutputStream > m_xOutStream;
+ css::uno::Reference<css::io::XMarkableStream> m_xMarkStream;
+ css::uno::Reference<css::io::XDataInputStream> m_xInStream;
+ css::uno::Reference<css::io::XDataOutputStream> m_xOutStream;
- sal_Int32 m_nBlockStart;
- sal_Int32 m_nBlockLen;
+ sal_Int32 m_nBlockStart;
+ sal_Int32 m_nBlockLen;
public:
/** starts reading of a "skippable" section of data within the given input stream<BR>
@param _rxInput the stream to read from. Must support the
css::io::XMarkableStream interface
*/
- OStreamSection(const css::uno::Reference< css::io::XDataInputStream >& _rxInput);
+ OStreamSection(const css::uno::Reference<css::io::XDataInputStream>& _rxInput);
/** starts writing of a "skippable" section of data into the given output stream
@param _rxOutput the stream the stream to write to. Must support the
css::io::XMarkableStream interface
*/
- OStreamSection(const css::uno::Reference< css::io::XDataOutputStream >& _rxOutput);
+ OStreamSection(const css::uno::Reference<css::io::XDataOutputStream>& _rxOutput);
/** dtor. <BR>If constructed for writing, the section "opened" by this object will be "closed".<BR>
If constructed for reading, any remaining bytes 'til the end of the section will be skipped.
@@ -64,7 +72,7 @@ public:
~OStreamSection();
};
-} // namespace comphelper
+} // namespace comphelper
#endif // INCLUDED_COMPHELPER_STREAMSECTION_HXX