diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-17 11:36:31 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-17 20:38:22 +0100 |
commit | 4f4d9c06355b64ae30e0c100be0ca55d01c16885 (patch) | |
tree | 1fe03b38c979e6fbd98b62df6a5bf21db226c54e /idl/source/objects | |
parent | ef87ff6680f79362a431db6e7ef2f40cfc576219 (diff) |
Avoid duplicate symbols in libmerged for Windows too.
This is working version of fc27a685d466dc380a8b68cd48f47db632ed3693
Change-Id: I48e861b5b7692ea051edf52d7ad9cc54ca989e22
Diffstat (limited to 'idl/source/objects')
-rw-r--r-- | idl/source/objects/types.cxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 1797fa2b3409..265be88a2a21 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -1398,7 +1398,7 @@ sal_uLong SvMetaType::MakeSfx( OStringBuffer& rAttrArray ) } void SvMetaType::WriteSfxItem( - const OString& rItemName, SvIdlDataBase &, SvStream & rOutStm ) + const OString& rItemName, SvIdlDataBase& rBase, SvStream& rOutStm ) { WriteStars( rOutStm ); OStringBuffer aVarName(" a"); @@ -1411,14 +1411,34 @@ void SvMetaType::WriteSfxItem( OString::number(nAttrCount)); aTypeName.append(aAttrCount); - rOutStm.WriteCharPtr( "extern " ).WriteCharPtr( aTypeName.getStr() ) + bool bExport = false, bReturn = false; + // these are exported from sfx library + if (rItemName == "SfxBoolItem" || + rItemName == "SfxStringItem" || + rItemName == "SfxUInt16Item" || + rItemName == "SfxUInt32Item" || + rItemName == "SfxVoidItem") + { + bExport = true; + if (!rBase.sSlotMapFile.endsWith("sfxslots.hxx")) + bReturn = true; + } + + rOutStm.WriteCharPtr( "extern " ); + if (bExport) + rOutStm.WriteCharPtr( "SFX2_DLLPUBLIC " ); + rOutStm.WriteCharPtr( aTypeName.getStr() ) .WriteCharPtr( aVarName.getStr() ).WriteChar( ';' ) << endl; + if (bReturn) + return; // write the implementation part rOutStm.WriteCharPtr( "#ifdef SFX_TYPEMAP" ) << endl; rOutStm.WriteCharPtr( "#if !defined(_WIN32) && ((defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS))) || STATIC_LINKING)" ) << endl; rOutStm.WriteCharPtr( "__attribute__((__weak__))" ) << endl; rOutStm.WriteCharPtr( "#endif" ) << endl; + if (bExport) + rOutStm.WriteCharPtr( "SFX2_DLLPUBLIC " ); rOutStm.WriteCharPtr( aTypeName.getStr() ).WriteCharPtr( aVarName.getStr() ) .WriteCharPtr( " = " ) << endl; rOutStm.WriteChar( '{' ) << endl; |