diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-28 18:00:14 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-28 18:00:14 +0000 |
commit | ee04fc300c5b7cf659cf2db89a535a1eface59bd (patch) | |
tree | bb6411b80c19f7ce5474ff41a5cccd8046387d33 /codemaker | |
parent | ff1eaa2c010230c37587660bf74431c26a8b4574 (diff) |
CWS-TOOLING: integrate CWS sb109
2009-04-21 13:42:45 +0200 sb r271035 : removed obsolete psprint dependency
2009-04-21 10:33:31 +0200 sb r271024 : changes to previous -c270971 so that build does not break for USE_SHELL!=bash (but instead resulting bridgetest_xxx scripts are nonfunctional)
2009-04-21 08:56:48 +0200 sb r271017 : merged in cws/sb107 -c 268250 (avoid warnings about format specifier and argument mismatch (on 64bit debug builds))
2009-04-20 16:42:27 +0200 sb r270995 : #i98625# add make_xxx functions for C++ representations of UNO polystructs; fixed and adapted tests (patch by thb, slightly adapted)
2009-04-20 14:23:45 +0200 sb r270981 : #i84751# selective performance improvements (patch by mmeeks, slightly adapted)
2009-04-20 13:39:50 +0200 sb r270978 : #i99711# removed dead code (patch by cmc, slightly modified)
2009-04-20 11:59:39 +0200 sb r270972 : #i97975# avoid crashes during shutdown (patch by cmc, slightly modified)
2009-04-20 11:57:52 +0200 sb r270971 : made tests work again after LD_LIBRARY_PATH clean up
2009-04-20 09:49:32 +0200 sb r270963 : #i95593# made tests work again after LD_LIBRARY_PATH cleanup
2009-04-17 13:52:33 +0200 sb r270941 : merged in cws/sb107 -c 270023 (added svn:ignore)
2009-04-15 13:46:24 +0200 sb r270841 : #i92131# dead code elimination (based on a patch by cmc)
2009-04-15 13:29:27 +0200 sb r270839 : #i100743# use a FastLess for the Data map (based on a patch my mmeeks)
2009-04-15 13:12:11 +0200 sb r270837 : #i100583# dead code elimination (patch by cmc)
2009-04-15 13:02:19 +0200 sb r270835 : avoid bogus Solaris C++ compiler warning when building with debug=x
2009-04-15 11:49:46 +0200 sb r270828 : adapted to cleared LD_LIBRARY_PATH
2009-04-15 10:49:48 +0200 sb r270826 : #i101101# for performance reasons, do not put ComponentContext in unsafe appartment
2009-04-15 10:08:20 +0200 sb r270824 : #i99113# removed duplicated stocservices.uno lib from basis layer
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 55 | ||||
-rw-r--r-- | codemaker/test/cppumaker/makefile.mk | 6 | ||||
-rw-r--r-- | codemaker/test/cppumaker/test_codemaker_cppumaker.cxx | 16 | ||||
-rw-r--r-- | codemaker/test/cppumaker/types.idl | 4 |
4 files changed, 68 insertions, 13 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 45977027c..d069bb7f8 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -2490,9 +2490,8 @@ sal_Bool StructureType::dumpHxxFile( RTFieldAccess access = RT_ACCESS_INVALID; OString fieldName; OString fieldType; - sal_uInt16 i = 0; - for (i=0; i < fieldCount; i++) + for (sal_uInt16 i=0; i < fieldCount; i++) { access = m_reader.getFieldFlags(i); @@ -2527,7 +2526,7 @@ sal_Bool StructureType::dumpHxxFile( sal_Bool superHasMember = dumpSuperMember(o, superType, sal_True); - for (i=0; i < fieldCount; i++) + for (sal_uInt16 i=0; i < fieldCount; i++) { access = m_reader.getFieldFlags(i); @@ -2565,7 +2564,7 @@ sal_Bool StructureType::dumpHxxFile( first = sal_False; } - for (i=0; i < fieldCount; i++) + for (sal_uInt16 i=0; i < fieldCount; i++) { access = m_reader.getFieldFlags(i); @@ -2590,6 +2589,54 @@ sal_Bool StructureType::dumpHxxFile( o << "{\n}\n\n"; } + if (isPolymorphic() && fieldCount > 0) { + o << indent(); + dumpTemplateHead(o); + o << "\n"; + o << indent(); + o << "inline " << m_name; + dumpTemplateParameters(o); + o << "\n"; + o << indent(); + o << "make_" << m_name << "("; + for (sal_uInt16 i = 0; i < fieldCount; ++i) { + if (i > 0) { + o << ", "; + } + rtl::OString type( + rtl::OUStringToOString( + m_reader.getFieldTypeName(i), RTL_TEXTENCODING_UTF8)); + if ((m_reader.getFieldFlags(i) & RT_ACCESS_PARAMETERIZED_TYPE) != 0) + { + dumpTypeParameterName(o, type); + o << " const &"; + } else { + dumpType(o, type, true, true); + } + o << " " + << rtl::OUStringToOString( + m_reader.getFieldName(i), RTL_TEXTENCODING_UTF8) + << "_"; + } + o << ") SAL_THROW(())\n"; + o << indent() << "{\n"; + inc(); + o << indent() << "return " << m_name; + dumpTemplateParameters(o); + o << "("; + for (sal_uInt16 i = 0; i < fieldCount; ++i) { + if (i > 0) { + o << ", "; + } + o << rtl::OUStringToOString( + m_reader.getFieldName(i), RTL_TEXTENCODING_UTF8) + << "_"; + } + o << ");\n"; + dec(); + o << indent() << "}\n\n"; + } + if (codemaker::cppumaker::dumpNamespaceClose(o, m_typeName, false)) { o << "\n"; } diff --git a/codemaker/test/cppumaker/makefile.mk b/codemaker/test/cppumaker/makefile.mk index db4227155..bab3dcbb3 100644 --- a/codemaker/test/cppumaker/makefile.mk +++ b/codemaker/test/cppumaker/makefile.mk @@ -59,8 +59,8 @@ $(SHL1OBJS): $(MISC)$/$(TARGET).cppumaker.flag $(MISC)$/$(TARGET).cppumaker.flag: $(BIN)$/cppumaker$(EXECPOST) $(MISC)$/$(TARGET).cppumaker.flag: $(MISC)$/$(TARGET).rdb - $(MKDIRHIER) $(MISC)$/$(TARGET)$/inc - $(BIN)$/cppumaker$(EXECPOST) -O$(MISC)$/$(TARGET)$/inc -BUCR -C $< \ - $(SOLARBINDIR)$/udkapi.rdb + $(AUGMENT_LIBRARY_PATH) $(BIN)$/cppumaker$(EXECPOST) \ + -O$(MISC)$/$(TARGET)$/inc -BUCR -C $< $(SOLARBINDIR)$/udkapi.rdb $(TOUCH) $@ $(MISC)$/$(TARGET).rdb: $(MISC)$/$(TARGET)$/types.urd @@ -72,4 +72,4 @@ $(MISC)$/$(TARGET)$/types.urd: types.idl $(IDLC) -O$(MISC)$/$(TARGET) -I$(SOLARIDLDIR) -cid -we $< test .PHONY: $(SHL1TARGETN) - testshl2 $< + $(AUGMENT_LIBRARY_PATH) testshl2 $< diff --git a/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx b/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx index 2d5e638c7..f22c1dcce 100644 --- a/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx +++ b/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx @@ -382,7 +382,7 @@ class Test: public CppUnit::TestFixture { public: void testBigStruct(); - void testPolyCharStruct(); + void testPolyStruct(); void testExceptions(); @@ -390,7 +390,7 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testBigStruct); - CPPUNIT_TEST(testPolyCharStruct); + CPPUNIT_TEST(testPolyStruct); CPPUNIT_TEST(testExceptions); CPPUNIT_TEST(testConstants); CPPUNIT_TEST_SUITE_END(); @@ -444,9 +444,13 @@ void Test::testBigStruct() { CPPUNIT_ASSERT_EQUAL(guard.p->m22.getLength(), static_cast< sal_Int32 >(0)); CPPUNIT_ASSERT_EQUAL(guard.p->m23.getLength(), static_cast< sal_Int32 >(0)); -#if defined __GNUC__ && __GNUC__ >= 3 +#if defined __GNUC__ && __GNUC__ >= 3 // see CPPU_GCC3_ALIGN CPPUNIT_ASSERT_EQUAL( +#if defined X86_64 + static_cast< std::size_t >(24), +#else static_cast< std::size_t >(16), +#endif sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct)); #endif @@ -464,7 +468,7 @@ void Test::testBigStruct() { CPPUNIT_ASSERT_EQUAL(typelib_TypeClass_CHAR, std->aBase.ppTypeRefs[10]->eTypeClass); // char m11; } -void Test::testPolyCharStruct() { +void Test::testPolyStruct() { CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -472,6 +476,10 @@ void Test::testPolyCharStruct() { (com::sun::star::uno::makeAny( test::codemaker::cppumaker::Struct< sal_Unicode, sal_Int16 >()). getValueType().getTypeName())); + CPPUNIT_ASSERT_EQUAL( + (test::codemaker::cppumaker::make_Struct< sal_uInt32, sal_Bool >(5, 0). + member1), + static_cast< sal_uInt32 >(5)); } namespace { diff --git a/codemaker/test/cppumaker/types.idl b/codemaker/test/cppumaker/types.idl index 972f5792f..d3685570d 100644 --- a/codemaker/test/cppumaker/types.idl +++ b/codemaker/test/cppumaker/types.idl @@ -28,8 +28,8 @@ * ************************************************************************/ -//TODO: Do not depend on types for which C++ header files are only generated -// later in the build process in offuh: +/*TODO: Do not depend on types for which C++ header files are only generated + later in the build process in offuh: */ #include "com/sun/star/lang/ClassNotFoundException.idl" #include "com/sun/star/lang/IllegalAccessException.idl" #include "com/sun/star/lang/Locale.idl" |