summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:08:05 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-21 13:18:11 +0100
commit2184efed3943fe9634e6e361e8b0306a374cbf59 (patch)
treeb34d82e48df968926f331cfa7bbd8cdcb1e9cb31 /odk
parentd0b3815392d1fb253ed05218422a7f9b37c9df24 (diff)
tdf#123936 Formatting files in module odk with clang-format
Change-Id: I427263ee98206c00cd2b3392fc9f2f55ad1ded5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105692 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h6
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx21
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx12
-rw-r--r--odk/examples/OLE/activex/SOComWindowPeer.cpp10
-rw-r--r--odk/examples/OLE/activex/StdAfx2.h2
-rw-r--r--odk/examples/OLE/activex/so_activex.cpp17
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx9
-rw-r--r--odk/qa/checkapi/checkapi.cxx7
9 files changed, 30 insertions, 60 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
index 81de2d9f1b31..99207192f796 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
@@ -47,16 +47,14 @@ extern "C" {
* Method: getNativeWindowSystemType
* Signature: ()I
*/
-JNIEXPORT jint JNICALL Java_NativeView_getNativeWindowSystemType
- (JNIEnv *, jobject);
+JNIEXPORT jint JNICALL Java_NativeView_getNativeWindowSystemType(JNIEnv*, jobject);
/*
* Class: org_openoffice_OpenOffice
* Method: getNativeWindow
* Signature: ()J
*/
-JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow
- (JNIEnv *, jobject);
+JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow(JNIEnv*, jobject);
#ifdef __cplusplus
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
index 81de2d9f1b31..99207192f796 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
@@ -47,16 +47,14 @@ extern "C" {
* Method: getNativeWindowSystemType
* Signature: ()I
*/
-JNIEXPORT jint JNICALL Java_NativeView_getNativeWindowSystemType
- (JNIEnv *, jobject);
+JNIEXPORT jint JNICALL Java_NativeView_getNativeWindowSystemType(JNIEnv*, jobject);
/*
* Class: org_openoffice_OpenOffice
* Method: getNativeWindow
* Signature: ()J
*/
-JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow
- (JNIEnv *, jobject);
+JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow(JNIEnv*, jobject);
#ifdef __cplusplus
}
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx
index ecb21116a00a..26162eeb3617 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx
@@ -53,35 +53,34 @@ SAL_IMPLEMENT_MAIN()
// give it an initial size, should be a good guess.
// stringbuffer extends if necessary
- OUStringBuffer buf( 128 );
+ OUStringBuffer buf(128);
// append an ascii string
- buf.append( "pi ( here " );
+ buf.append("pi ( here ");
// numbers can be simply appended
- buf.append( pi );
+ buf.append(pi);
// lets the compiler count the stringlength, so this is more efficient than
// the above appendAscii call, where length of the string must be calculated at
// runtime
- buf.append( " ) multiplied with " );
- buf.append( n );
- buf.append( " gives " );
- buf.append( (double)( n * pi ) );
- buf.append( "." );
+ buf.append(" ) multiplied with ");
+ buf.append(n);
+ buf.append(" gives ");
+ buf.append((double)(n * pi));
+ buf.append(".");
// now transfer the buffer into the string.
// afterwards buffer is empty and may be reused again !
OUString string = buf.makeStringAndClear();
// I could of course also used the OStringBuffer directly
- OString oString = rtl::OUStringToOString( string , RTL_TEXTENCODING_ASCII_US );
+ OString oString = rtl::OUStringToOString(string, RTL_TEXTENCODING_ASCII_US);
// just to print something
- printf( "%s\n" ,oString.getStr() );
+ printf("%s\n", oString.getStr());
return 0;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx
index f92731d37d88..86cd5b356cf5 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx
@@ -40,28 +40,26 @@
class MyOWeakObject : public ::cppu::OWeakObject
{
public:
- MyOWeakObject() { fprintf( stdout, "constructed\n" ); }
- ~MyOWeakObject() { fprintf( stdout, "destructed\n" ); }
+ MyOWeakObject() { fprintf(stdout, "constructed\n"); }
+ ~MyOWeakObject() { fprintf(stdout, "destructed\n"); }
};
-
void simple_object_creation_and_destruction()
{
// create the UNO object
- com::sun::star::uno::XInterface * p = new MyOWeakObject();
+ com::sun::star::uno::XInterface* p = new MyOWeakObject();
// acquire it, refcount becomes one
p->acquire();
- fprintf( stdout, "before release\n" );
+ fprintf(stdout, "before release\n");
// release it, refcount drops to zero
p->release();
- fprintf( stdout, "after release\n" );
+ fprintf(stdout, "after release\n");
}
-
int main()
{
simple_object_creation_and_destruction();
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.cpp b/odk/examples/OLE/activex/SOComWindowPeer.cpp
index 0045014fec81..7439593dd138 100644
--- a/odk/examples/OLE/activex/SOComWindowPeer.cpp
+++ b/odk/examples/OLE/activex/SOComWindowPeer.cpp
@@ -40,19 +40,15 @@
#include "SOComWindowPeer.h"
#include <sal/macros.h>
-
-
-
STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
{
- static const IID* arr[] =
- {
+ static const IID* arr[] = {
&IID_ISOComWindowPeer,
};
- for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
+ for (int i = 0; i < SAL_N_ELEMENTS(arr); i++)
{
- if (InlineIsEqualGUID(*arr[i],riid))
+ if (InlineIsEqualGUID(*arr[i], riid))
return S_OK;
}
return S_FALSE;
diff --git a/odk/examples/OLE/activex/StdAfx2.h b/odk/examples/OLE/activex/StdAfx2.h
index df14ccf949a0..39c84dc2fc14 100644
--- a/odk/examples/OLE/activex/StdAfx2.h
+++ b/odk/examples/OLE/activex/StdAfx2.h
@@ -47,7 +47,7 @@
#define _ATL_APARTMENT_THREADED
#define _ATL_STATIC_REGISTRY
-#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define min(a, b) (((a) < (b)) ? (a) : (b))
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
diff --git a/odk/examples/OLE/activex/so_activex.cpp b/odk/examples/OLE/activex/so_activex.cpp
index e546aeff56ec..b2cf16a80349 100644
--- a/odk/examples/OLE/activex/so_activex.cpp
+++ b/odk/examples/OLE/activex/so_activex.cpp
@@ -35,7 +35,6 @@
// so_activex.cpp : Implementation of DLL Exports.
-
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f so_activexps.mk in the project directory.
@@ -48,18 +47,15 @@
#include "so_activex_i.c"
#include "SOActiveX.h"
-
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_SOActiveX, CSOActiveX)
END_OBJECT_MAP()
-
// DLL Entry Point
-extern "C"
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
@@ -68,17 +64,12 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
- return TRUE; // ok
+ return TRUE; // ok
}
-
// Used to determine whether the DLL can be unloaded by OLE
-STDAPI DllCanUnloadNow(void)
-{
- return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
-}
-
+STDAPI DllCanUnloadNow(void) { return (_Module.GetLockCount() == 0) ? S_OK : S_FALSE; }
// Returns a class factory to create an object of the requested type
@@ -87,7 +78,6 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
return _Module.GetClassObject(rclsid, riid, ppv);
}
-
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
@@ -97,7 +87,6 @@ STDAPI DllRegisterServer(void)
return aResult;
}
-
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
diff --git a/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx b/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
index 38b3326c7754..0b5b0ca1e1ef 100644
--- a/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
@@ -17,16 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include "MyListener.h"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-void SAL_CALL CalcListener::notifyEvent( const ::com::sun::star::document::EventObject& aEvent )
-{
-}
+void SAL_CALL CalcListener::notifyEvent(const ::com::sun::star::document::EventObject& aEvent) {}
-void SAL_CALL CalcListener::disposing( const com::sun::star::lang::EventObject& aSource )
-{
-}
+void SAL_CALL CalcListener::disposing(const com::sun::star::lang::EventObject& aSource) {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/qa/checkapi/checkapi.cxx b/odk/qa/checkapi/checkapi.cxx
index 95cac2c042bf..fac7fbfc708a 100644
--- a/odk/qa/checkapi/checkapi.cxx
+++ b/odk/qa/checkapi/checkapi.cxx
@@ -23,15 +23,12 @@
#ifdef _MSC_VER
// deprecation warnings do not matter here
-#pragma warning (disable : 4996)
+#pragma warning(disable : 4996)
#endif
#include <allheaders.hxx>
CPPUNIT_PLUGIN_IMPLEMENT();
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool firstfunc(sal_Bool)
-{
- return true;
-}
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool firstfunc(sal_Bool) { return true; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */