make UNO enums scoped for internal LO code
this modifies codemaker so that, for an UNO enum, we generate code that effectively looks like: #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR enum class XXX { ONE = 1 }; constexpr auto ONE = XXX_ONE; #else ...the old normal way.. #endif which means that for LO internal code, the enums are scoped. The "constexpr auto" trick acts like an alias so we don't have to use scoped naming everywhere. Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4 Reviewed-on: https://gerrit.libreoffice.org/34546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -441,18 +441,15 @@ void Test::testBigStruct() {
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m10, 0.0);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m11, static_cast< sal_Unicode >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
+guard.p->m13.getTypeClass(), +css::uno::TypeClass_VOID);
|
||||
CPPUNIT_ASSERT_EQUAL((sal_Int32)guard.p->m13.getTypeClass(), (sal_Int32)css::uno::TypeClass_VOID);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), false);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m15.getLength(), static_cast< sal_Int32 >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
+guard.p->m16, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||
CPPUNIT_ASSERT_EQUAL((int)guard.p->m16, (int)test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m1, sal_False);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m2.is(), false);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m18.is(), false);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m19, static_cast< sal_Int8 >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
+guard.p->m20, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||
CPPUNIT_ASSERT_EQUAL((sal_Int32)guard.p->m20, (sal_Int32)test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m21.getLength(), static_cast< sal_Int32 >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m22.getLength(), static_cast< sal_Int32 >(0));
|
||||
CPPUNIT_ASSERT_EQUAL(guard.p->m23.getLength(), static_cast< sal_Int32 >(0));
|
||||
|
Reference in New Issue
Block a user