[Libreoffice-commits] core.git: 2 commits - cppu/source extras/source include/typelib
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 6 09:19:28 UTC 2020
cppu/source/typelib/static_types.cxx | 6 +++---
cppu/source/typelib/typelib.cxx | 15 +++++++--------
extras/source/palettes/standard.sob |binary
include/typelib/typedescription.h | 3 +++
4 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit af1a1587247d9aedba32ff48163f848ab9ab3ab5
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Mar 4 21:14:22 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Mar 6 10:18:58 2020 +0100
Make TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK constexpr
...and make dynamic verifications static where applicable
Change-Id: I3fb7ebe6885ee70e493ec1365601a1177d181347
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90002
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 622b52e2d020..6bbdf4c63eab 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -302,7 +302,7 @@ void SAL_CALL typelib_static_sequence_type_init(
{
OUString aTypeName = "[]" + OUString::unacquired(&pElementType->pTypeName);
- assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_SEQUENCE) );
+ static_assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_SEQUENCE) );
*ppRef = igetTypeByName( aTypeName.pData );
if (!*ppRef)
{
@@ -451,7 +451,7 @@ void SAL_CALL typelib_static_mi_interface_type_init(
MutexGuard aGuard( typelib_StaticInitMutex::get() );
if (! *ppRef)
{
- assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_INTERFACE) );
+ static_assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_INTERFACE) );
OUString aTypeName( OUString::createFromAscii( pTypeName ) );
*ppRef = igetTypeByName( aTypeName.pData );
if (!*ppRef)
@@ -514,7 +514,7 @@ void SAL_CALL typelib_static_enum_type_init(
MutexGuard aGuard( typelib_StaticInitMutex::get() );
if (! *ppRef)
{
- assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_ENUM) );
+ static_assert( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_ENUM) );
OUString aTypeName( OUString::createFromAscii( pTypeName ) );
*ppRef = igetTypeByName( aTypeName.pData );
if (!*ppRef)
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index d4a65a6f7b5e..1f7af60693e2 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -848,6 +848,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEnum(
pEnum->pEnumValues = new sal_Int32[ nEnumValues ];
::memcpy( pEnum->pEnumValues, pEnumValues, nEnumValues * sizeof(sal_Int32) );
+ static_assert(!TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_ENUM));
(*ppRet)->pWeakRef = reinterpret_cast<typelib_TypeDescriptionReference *>(*ppRet);
// sizeof(void) not allowed
(*ppRet)->nSize = typelib_typedescription_getAlignedUnoSize( (*ppRet), 0, (*ppRet)->nAlignment );
@@ -1041,8 +1042,8 @@ extern "C" void SAL_CALL typelib_typedescription_newMIInterface(
}
typelib_TypeDescription * pTmp = &pITD->aBase;
- if( !TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE ) )
- pTmp->pWeakRef = reinterpret_cast<typelib_TypeDescriptionReference *>(pTmp);
+ static_assert( !TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE ) );
+ pTmp->pWeakRef = reinterpret_cast<typelib_TypeDescriptionReference *>(pTmp);
pTmp->nSize = typelib_typedescription_getAlignedUnoSize( pTmp, 0, pTmp->nAlignment );
pTmp->nAlignment = adjustAlignment( pTmp->nAlignment );
pTmp->bComplete = false;
@@ -1111,7 +1112,6 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod(
typelib_typedescription_newEmpty(
reinterpret_cast<typelib_TypeDescription **>(ppRet), typelib_TypeClass_INTERFACE_METHOD, pTypeName );
- typelib_TypeDescription * pTmp = reinterpret_cast<typelib_TypeDescription *>(*ppRet);
rtl_uString_newFromStr_WithLength( &(*ppRet)->aBase.pMemberName,
pTypeName->buffer + nOffset +1,
@@ -1146,8 +1146,8 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod(
&& nAbsolutePosition < pInterface->nAllMembers);
(*ppRet)->nIndex = nAbsolutePosition
- (pInterface->nAllMembers - pInterface->nMembers);
- if( !TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE_METHOD ) )
- pTmp->pWeakRef = reinterpret_cast<typelib_TypeDescriptionReference *>(pTmp);
+ static_assert( TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE_METHOD ) );
+ assert(reinterpret_cast<typelib_TypeDescription *>(*ppRet)->pWeakRef == nullptr);
}
@@ -1203,7 +1203,6 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
typelib_typedescription_newEmpty(
reinterpret_cast<typelib_TypeDescription **>(ppRet), typelib_TypeClass_INTERFACE_ATTRIBUTE, pTypeName );
- typelib_TypeDescription * pTmp = reinterpret_cast<typelib_TypeDescription *>(*ppRet);
rtl_uString_newFromStr_WithLength( &(*ppRet)->aBase.pMemberName,
pTypeName->buffer + nOffset +1,
@@ -1224,8 +1223,8 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
(*ppRet)->nSetExceptions = nSetExceptions;
(*ppRet)->ppSetExceptions = copyExceptions(
nSetExceptions, ppSetExceptionNames);
- if( !TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE_ATTRIBUTE ) )
- pTmp->pWeakRef = reinterpret_cast<typelib_TypeDescriptionReference *>(pTmp);
+ static_assert( TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( typelib_TypeClass_INTERFACE_ATTRIBUTE ) );
+ assert(reinterpret_cast<typelib_TypeDescription *>(*ppRet)->pWeakRef == nullptr);
}
diff --git a/include/typelib/typedescription.h b/include/typelib/typedescription.h
index 329384c5d172..39ddbd702bd4 100644
--- a/include/typelib/typedescription.h
+++ b/include/typelib/typedescription.h
@@ -987,6 +987,9 @@ CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_complete(
description is not initialized.
@internal
*/
+#if defined LIBO_INTERNAL_ONLY && defined __cplusplus
+constexpr
+#endif
inline bool TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( _typelib_TypeClass eTypeClass )
{
return (eTypeClass == typelib_TypeClass_INTERFACE_METHOD) ||
commit 5e518d660863448924f6bb6d2a4f57d9d856c624
Author: andreas kainz <kainz.a at gmail.com>
AuthorDate: Fri Mar 6 00:54:19 2020 +0100
Commit: andreas_kainz <kainz.a at gmail.com>
CommitDate: Fri Mar 6 10:18:54 2020 +0100
tdf#130928 Area Fill update bitmap preset arrangement nothing more
Change-Id: I3825af6eea08fc80181fa5210f4a5ae0f5a20314
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90074
Tested-by: Jenkins
Reviewed-by: andreas_kainz <kainz.a at gmail.com>
diff --git a/extras/source/palettes/standard.sob b/extras/source/palettes/standard.sob
index f8ff573121dd..9fb99079d7a7 100644
Binary files a/extras/source/palettes/standard.sob and b/extras/source/palettes/standard.sob differ
More information about the Libreoffice-commits
mailing list