[Libreoffice-commits] .: Branch 'feature/gbuild_cppuhelper' - 3 commits - codemaker/source cppuhelper/Module_cppuhelper.mk forms/source odk/util xmlreader/Library_xmlreader.mk

Stephan Bergmann sbergmann at kemper.freedesktop.org
Fri Dec 23 09:46:39 PST 2011


 codemaker/source/cppumaker/cpputype.cxx |   91 +++++++++++++++++++++++++++++---
 cppuhelper/Module_cppuhelper.mk         |    2 
 forms/source/component/Grid.cxx         |    2 
 odk/util/check.pl                       |   31 ++++++----
 xmlreader/Library_xmlreader.mk          |    2 
 5 files changed, 106 insertions(+), 22 deletions(-)

New commits:
commit 3c92f54309df6b8b0008993962719e2d9ae7b94d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 23 18:41:52 2011 +0100

    Temporary hack around cppu_detail_getCppuType variants violating ODR.
    
    Which causes cppuhelper to pick wrong variant from other library, now that its own
    symbols are no longer reduced to private on Mac OS X.  As a temporary hack, emit
    cppu_detail_getCppuType for the relevant types always as fully comprehensive; should
    be revisited when improving types.rdb format (routinely generating C++ information
    for certain UNO types into a dedicated library?).  Requires a fix to xmlreader and
    a fix to forms that looks like a Mac OS X GCC bug.

diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 3a436ca..9636f61 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -79,6 +79,77 @@ rtl::OString translateSimpleUnoType(rtl::OString const & unoType, bool cppuUnoTy
     return trans[sort];
 }
 
+bool isBootstrapType(rtl::OString const & name) {
+    static char const * const names[] = {
+	    "com/sun/star/beans/PropertyAttribute",
+	    "com/sun/star/beans/PropertyValue",
+	    "com/sun/star/beans/XFastPropertySet",
+	    "com/sun/star/beans/XMultiPropertySet",
+	    "com/sun/star/beans/XPropertyAccess",
+	    "com/sun/star/beans/XPropertySet",
+	    "com/sun/star/beans/XPropertySetOption",
+	    "com/sun/star/bridge/UnoUrlResolver",
+	    "com/sun/star/bridge/XUnoUrlResolver",
+	    "com/sun/star/connection/SocketPermission",
+	    "com/sun/star/container/XElementAccess",
+	    "com/sun/star/container/XEnumerationAccess",
+	    "com/sun/star/container/XHierarchicalNameAccess",
+	    "com/sun/star/container/XNameAccess",
+	    "com/sun/star/container/XNameContainer",
+	    "com/sun/star/container/XNameReplace",
+	    "com/sun/star/container/XSet",
+	    "com/sun/star/io/FilePermission",
+	    "com/sun/star/io/IOException",
+	    "com/sun/star/lang/DisposedException",
+	    "com/sun/star/lang/WrappedTargetRuntimeException",
+	    "com/sun/star/lang/XComponent",
+	    "com/sun/star/lang/XEventListener",
+	    "com/sun/star/lang/XInitialization",
+	    "com/sun/star/lang/XMultiComponentFactory",
+	    "com/sun/star/lang/XMultiServiceFactory",
+	    "com/sun/star/lang/XServiceInfo",
+	    "com/sun/star/lang/XSingleComponentFactory",
+	    "com/sun/star/lang/XSingleServiceFactory",
+	    "com/sun/star/lang/XTypeProvider",
+	    "com/sun/star/loader/XImplementationLoader",
+	    "com/sun/star/reflection/XArrayTypeDescription",
+	    "com/sun/star/reflection/XCompoundTypeDescription",
+	    "com/sun/star/reflection/XEnumTypeDescription",
+	    "com/sun/star/reflection/XIdlClass",
+	    "com/sun/star/reflection/XIdlField2",
+	    "com/sun/star/reflection/XIdlReflection",
+	    "com/sun/star/reflection/XIndirectTypeDescription",
+	    "com/sun/star/reflection/XInterfaceAttributeTypeDescription",
+	    "com/sun/star/reflection/XInterfaceAttributeTypeDescription2",
+	    "com/sun/star/reflection/XInterfaceMemberTypeDescription",
+	    "com/sun/star/reflection/XInterfaceMethodTypeDescription",
+	    "com/sun/star/reflection/XInterfaceTypeDescription2",
+	    "com/sun/star/reflection/XMethodParameter",
+	    "com/sun/star/reflection/XStructTypeDescription",
+	    "com/sun/star/reflection/XTypeDescription",
+	    "com/sun/star/reflection/XUnionTypeDescription",
+	    "com/sun/star/registry/XImplementationRegistration",
+	    "com/sun/star/registry/XRegistryKey",
+	    "com/sun/star/registry/XSimpleRegistry",
+	    "com/sun/star/security/RuntimePermission",
+	    "com/sun/star/security/XAccessController",
+	    "com/sun/star/uno/DeploymentException",
+	    "com/sun/star/uno/RuntimeException",
+	    "com/sun/star/uno/XAggregation",
+	    "com/sun/star/uno/XComponentContext",
+	    "com/sun/star/uno/XCurrentContext",
+	    "com/sun/star/uno/XUnloadingPreference",
+	    "com/sun/star/uno/XWeak",
+	    "com/sun/star/util/XMacroExpander"
+    }; // cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies)
+    for (std::size_t i = 0; i < SAL_N_ELEMENTS(names); ++i) {
+        if (name.equals(names[i])) {
+            return true;
+        }
+    }
+    return false;
+}
+
 }
 
 //*************************************************************************
@@ -221,14 +292,18 @@ sal_Bool CppuType::dump(CppuOptions* pOptions)
     }
     addSpecialDependencies();
 
-    // -CS was used as an undocumented option to generate static getCppuType
-    // functions; since the introduction of cppu::UnoType this no longer is
-    // meaningful (getCppuType is just a forward to cppu::UnoType::get now), and
-    // -CS is handled the same way as -C now:
-    if (pOptions->isValid("-L"))
-        m_cppuTypeLeak = sal_True;
-    if (pOptions->isValid("-C") || pOptions->isValid("-CS"))
-        m_cppuTypeDynamic = sal_False;
+    if (isBootstrapType(m_typeName)) {
+        m_cppuTypeDynamic = false;
+    } else {
+        // -CS was used as an undocumented option to generate static getCppuType
+        // functions; since the introduction of cppu::UnoType this no longer is
+        // meaningful (getCppuType is just a forward to cppu::UnoType::get now),
+        // and -CS is handled the same way as -C now:
+        if (pOptions->isValid("-L"))
+            m_cppuTypeLeak = sal_True;
+        if (pOptions->isValid("-C") || pOptions->isValid("-CS"))
+            m_cppuTypeDynamic = sal_False;
+    }
 
     OString outPath;
     if (pOptions->isValid("-O"))
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index f268c2c..01e0c0d 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -377,7 +377,7 @@ void OGridControlModel::removeSelectionChangeListener(const Reference< XSelectio
 Reference<XPropertySet> SAL_CALL OGridControlModel::createColumn(const ::rtl::OUString& ColumnType) throw ( :: com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
 {
     const Sequence< ::rtl::OUString >& rColumnTypes = frm::getColumnTypes();
-    return createColumn( detail::findPos( ColumnType, rColumnTypes ) );
+    return createColumn( ::detail::findPos( ColumnType, rColumnTypes ) );
 }
 
 //------------------------------------------------------------------------------
diff --git a/xmlreader/Library_xmlreader.mk b/xmlreader/Library_xmlreader.mk
index 24ebbc1..7e5d9b5 100644
--- a/xmlreader/Library_xmlreader.mk
+++ b/xmlreader/Library_xmlreader.mk
@@ -35,9 +35,11 @@ $(eval $(call gb_Library_add_defs,xmlreader,\
 ))
 
 $(eval $(call gb_Library_add_linked_libs,xmlreader,\
+    cppu \
 	sal \
     $(gb_STDLIBS) \
 ))
+    # cppu is only needed due to the cppumaker -C hack
 
 $(eval $(call gb_Library_add_exception_objects,xmlreader,\
 	xmlreader/source/pad \
commit b39be7981095913b17567c31efb6769faac784e7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 23 18:33:32 2011 +0100

    Temporary hack to work around autodoc bug
    
    ...where autodoc fails to parse "class CPPUHELPER_DLLPUBLIC xxx" correctly.
    Best fixed by replacing autodoc with something mature (that hopefully does
    not have such a bug).

diff --git a/odk/util/check.pl b/odk/util/check.pl
index 490210c..6598291 100644
--- a/odk/util/check.pl
+++ b/odk/util/check.pl
@@ -189,9 +189,11 @@ if (-d "$StartDir") {
         $return++;
     }
 
+    # The commented out types from cppuhelper are missed by autodoc due to
+    # CPPUHELPER_DLLPUBLIC annotations:
     my @dir_list = ( "com","com/sun","com/sun/star","com/sun/star/uno",
              "com/sun/star/uno/Any","com/sun/star/uno/Type",
-             "com/sun/star/uno/Array","com/sun/star/uno/WeakReferenceHelper",
+             "com/sun/star/uno/Array",#"com/sun/star/uno/WeakReferenceHelper",
              "com/sun/star/uno/Reference","com/sun/star/uno/WeakReference",
              "com/sun/star/uno/Environment","com/sun/star/uno/Sequence",
              "com/sun/star/uno/BaseReference","com/sun/star/uno/Mapping",
@@ -212,31 +214,35 @@ if (-d "$StartDir") {
              "cppu/WeakAggImplHelper5","cppu/WeakAggImplHelper6",
              "cppu/WeakAggImplHelper7","cppu/WeakAggImplHelper8",
              "cppu/WeakAggImplHelper9",
-             "cppu/OMultiTypeInterfaceContainerHelperInt32","cppu/AccessControl",
-             "cppu/OPropertyArrayHelper","cppu/ImplHelper1","cppu/ImplHelper2",
+             #"cppu/OMultiTypeInterfaceContainerHelperInt32","cppu/AccessControl",
+             #"cppu/OPropertyArrayHelper",
+             "cppu/ImplHelper1","cppu/ImplHelper2",
              "cppu/ImplHelper3","cppu/ImplHelper4","cppu/ImplHelper5",
              "cppu/ImplHelper6","cppu/ImplHelper7","cppu/ImplHelper8",
              "cppu/ImplHelper9","cppu/WeakComponentImplHelper10",
              "cppu/WeakComponentImplHelper11","cppu/WeakComponentImplHelper12",
-             "cppu/UnoUrl","cppu/WeakComponentImplHelper1",
+             #"cppu/UnoUrl",
+             "cppu/WeakComponentImplHelper1",
              "cppu/WeakComponentImplHelper2","cppu/WeakComponentImplHelper3",
              "cppu/WeakComponentImplHelper4","cppu/WeakComponentImplHelper5",
              "cppu/WeakComponentImplHelper6","cppu/WeakComponentImplHelper7",
              "cppu/WeakComponentImplHelper8","cppu/WeakComponentImplHelper9",
-             "cppu/OInterfaceIteratorHelper",
-             "cppu/OMultiTypeInterfaceContainerHelper","cppu/UnoUrlDescriptor",
-             "cppu/IPropertyArrayHelper","cppu/OBroadcastHelperVar",
-             "cppu/OComponentHelper","cppu/OWeakAggObject",
+             #"cppu/OInterfaceIteratorHelper",
+             #"cppu/OMultiTypeInterfaceContainerHelper","cppu/UnoUrlDescriptor",
+             #"cppu/IPropertyArrayHelper",
+             "cppu/OBroadcastHelperVar",
+             #"cppu/OComponentHelper","cppu/OWeakAggObject",
              "cppu/ImplementationEntry","cppu/WeakImplHelper10",
              "cppu/WeakImplHelper11","cppu/WeakImplHelper12",
-             "cppu/OPropertySetHelper","cppu/ImplHelper10","cppu/ImplHelper11",
+             #"cppu/OPropertySetHelper",
+             "cppu/ImplHelper10","cppu/ImplHelper11",
              "cppu/ImplHelper12","cppu/WeakAggImplHelper10",
              "cppu/WeakAggImplHelper11","cppu/WeakAggImplHelper12",
              "cppu/ImplInheritanceHelper1","cppu/ImplInheritanceHelper2",
              "cppu/ImplInheritanceHelper3","cppu/ImplInheritanceHelper4",
              "cppu/ImplInheritanceHelper5","cppu/ImplInheritanceHelper6",
              "cppu/ImplInheritanceHelper7","cppu/ImplInheritanceHelper8",
-             "cppu/ImplInheritanceHelper9","cppu/OTypeCollection",
+             "cppu/ImplInheritanceHelper9",#"cppu/OTypeCollection",
              "cppu/WeakAggComponentImplHelper10",
              "cppu/WeakAggComponentImplHelper11",
              "cppu/WeakAggComponentImplHelper12",
@@ -250,7 +256,7 @@ if (-d "$StartDir") {
              "cppu/WeakAggComponentImplHelper8",
              "cppu/WeakAggComponentImplHelper9",
              "cppu/OMultiTypeInterfaceContainerHelperVar",
-             "cppu/OInterfaceContainerHelper","cppu/OImplementationId",
+             #"cppu/OInterfaceContainerHelper","cppu/OImplementationId",
              "cppu/AggImplInheritanceHelper1","cppu/AggImplInheritanceHelper2",
              "cppu/AggImplInheritanceHelper3","cppu/AggImplInheritanceHelper4",
              "cppu/AggImplInheritanceHelper5","cppu/AggImplInheritanceHelper6",
@@ -260,7 +266,8 @@ if (-d "$StartDir") {
              "cppu/WeakImplHelper1","cppu/WeakImplHelper2","cppu/WeakImplHelper3",
              "cppu/WeakImplHelper4","cppu/WeakImplHelper5","cppu/WeakImplHelper6",
              "cppu/WeakImplHelper7","cppu/WeakImplHelper8","cppu/WeakImplHelper9",
-             "cppu/OWeakObject","__store_FindData","_rtl_StandardModuleCount",
+             #"cppu/OWeakObject",
+             "__store_FindData","_rtl_StandardModuleCount",
              "RTUik","RTConstValue","_typelib_TypeDescriptionReference",
              "_typelib_InterfaceMethodTypeDescription","store","RegistryKey",
              "_typelib_Union_Init","_sal_Sequence","_typelib_Parameter_Init",
commit 7575dbd49623f0fff2f514ae5f415f4ba60ff314
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 23 18:29:49 2011 +0100

    CppunitTest_cppuhelper_qa_weak depends on module bridges
    
    ...through a call to cppu::getCaughtException.

diff --git a/cppuhelper/Module_cppuhelper.mk b/cppuhelper/Module_cppuhelper.mk
index f2472d5..e547e0b 100644
--- a/cppuhelper/Module_cppuhelper.mk
+++ b/cppuhelper/Module_cppuhelper.mk
@@ -38,8 +38,8 @@ $(eval $(call gb_Module_add_targets,cppuhelper,\
 $(eval $(call gb_Module_add_check_targets,cppuhelper,\
 	CppunitTest_cppuhelper_cppu_ifcontainer \
 	CppunitTest_cppuhelper_cppu_unourl \
-	CppunitTest_cppuhelper_qa_weak \
 ))
+# CppunitTest_cppuhelper_qa_weak depends on module bridges
 
 # TODO ? (I don't think OOO_SUBSEQUENT_TESTS != "" can be true..
 # someone would have to do it on command line)


More information about the Libreoffice-commits mailing list