Kaydet (Commit) dee53a32 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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.
üst 8907d159
......@@ -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"))
......
......@@ -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 ) );
}
//------------------------------------------------------------------------------
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment