ooo-build r15248 - in trunk: . patches/dev300
- From: thorstenb svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15248 - in trunk: . patches/dev300
- Date: Thu, 29 Jan 2009 20:43:49 +0000 (UTC)
Author: thorstenb
Date: Thu Jan 29 20:43:48 2009
New Revision: 15248
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15248&view=rev
Log:
* patches/dev300/apply:
* patches/dev300/codemaker-function-template-generators.diff: add
make_pair<>()-like type generator functions to generated header
files (as function templates auto-detect parameter types)
Added:
trunk/patches/dev300/codemaker-function-template-generators.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Thu Jan 29 20:43:48 2009
@@ -3343,6 +3343,8 @@
[ Fixes ]
# fix problem with calling private and protected members in layout code
sfx2-privateprotectedpublic.diff
+# add make_pair<>()-like type generator functions to generated header files
+codemaker-function-template-generators.diff, i#98625, thorsten
[ Fixes <= dev300-m39 ]
# several compile fixes for --enable-debug.
Added: trunk/patches/dev300/codemaker-function-template-generators.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/codemaker-function-template-generators.diff Thu Jan 29 20:43:48 2009
@@ -0,0 +1,107 @@
+diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
+index 69fa71a..5da6316 100644
+--- codemaker/source/cppumaker/cpputype.cxx
++++ codemaker/source/cppumaker/cpputype.cxx
+@@ -2389,7 +2389,7 @@ sal_Bool StructureType::dumpDeclaration(FileStream& o)
+ o << " {\n";
+ inc();
+ o << indent() << "inline " << m_name << "() SAL_THROW(());\n";
+- sal_uInt16 members = m_reader.getFieldCount();
++ const sal_uInt16 members = m_reader.getFieldCount();
+ if (members > 0 || getInheritedMemberCount() > 0) {
+ o << "\n" << indent() << "inline " << m_name << "(";
+ bool prev = dumpSuperMember(o, base, true);
+@@ -2445,6 +2445,58 @@ sal_Bool StructureType::dumpDeclaration(FileStream& o)
+ dec();
+ o << "};\n\n";
+
++ if (isPolymorphic() && (members > 0 || getInheritedMemberCount() > 0)) {
++ o << indent();
++ dumpTemplateHead(o);
++ o << "\n";
++ o << indent();
++ o << "inline " << m_name;
++ dumpTemplateParameters(o);
++ o << "\n";
++ o << indent();
++ o << "make_" << m_name << "(";
++ bool prev = dumpSuperMember(o, base, true);
++ for (sal_uInt16 i = 0; i < members; ++i) {
++ if (prev) {
++ o << ", ";
++ }
++ prev = true;
++ 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 << "(\n";
++ inc();
++ prev = dumpSuperMember(o, base, false);
++ for (sal_uInt16 i = 0; i < members; ++i) {
++ if (prev) {
++ o << ",\n";
++ }
++ prev = true;
++ o << indent() << rtl::OUStringToOString(
++ m_reader.getFieldName(i), RTL_TEXTENCODING_UTF8);
++ }
++ o << ");\n";
++ dec();
++ dec();
++ o << indent() << "}\n\n";
++ }
++
+ o << "#ifdef SAL_W32\n"
+ << "# pragma pack(pop)\n"
+ << "#elif defined(SAL_OS2)\n"
+diff --git a/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx b/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
+index 2d5e638..94f8569 100644
+--- codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
++++ codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
+@@ -444,10 +444,16 @@ 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
++# if !defined(X86_64)
+ CPPUNIT_ASSERT_EQUAL(
+ static_cast< std::size_t >(16),
+ sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
++# else
++ CPPUNIT_ASSERT_EQUAL(
++ static_cast< std::size_t >(24),
++ sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
++# endif
+ #endif
+
+ com::sun::star::uno::Type t(
+diff --git a/codemaker/test/cppumaker/types.idl b/codemaker/test/cppumaker/types.idl
+index 972f579..962aca8 100644
+--- codemaker/test/cppumaker/types.idl
++++ codemaker/test/cppumaker/types.idl
+@@ -28,8 +28,6 @@
+ *
+ ************************************************************************/
+
+-//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"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]