Fix error LNK2005 in MSVC after recent sd changes

Seen as:

isvl.lib(svllo.dll) : error LNK2005: "public: virtual class com::sun::star::uno::Any __cdecl cppu::WeakImplHelper<>::queryInterface(class com::sun::star::uno::Type const &)" (?queryInterface@?$WeakImplHelper@$$V@cppu@@UEAA?AVAny@uno@star@sun@com@@AEBVType@4567@@Z) already defined in Configuration.o
isvl.lib(svllo.dll) : error LNK2005: "public: virtual void __cdecl cppu::WeakImplHelper<>::acquire(void)" (?acquire@?$WeakImplHelper@$$V@cppu@@UEAAXXZ) already defined in Configuration.o
isvl.lib(svllo.dll) : error LNK2005: "public: virtual void __cdecl cppu::WeakImplHelper<>::release(void)" (?release@?$WeakImplHelper@$$V@cppu@@UEAAXXZ) already defined in Configuration.o
isvl.lib(svllo.dll) : error LNK2005: "public: virtual class com::sun::star::uno::Sequence<class com::sun::star::uno::Type> __cdecl cppu::WeakImplHelper<>::getTypes(void)" (?getTypes@?$WeakImplHelper@$$V@cppu@@UEAA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@XZ) already defined in Configuration.o
C:\lo\build\instdir\program\sdlo.dll : fatal error LNK1169: one or more multiply defined symbols found

Change-Id: I3d52651f37952cb5f7c68959e8b300c235a8bac5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187052
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Mike Kaganski
2025-06-26 18:12:14 +02:00
parent 41dcb22e68
commit f5667d1e3b
4 changed files with 25 additions and 7 deletions
+12 -2
View File
@@ -110,7 +110,12 @@ SfxStyleSheetHint( SfxHintId::StyleSheetErased, *p ) from:
SfxStyleSheetBasePool::Clear()
*/
class SVL_DLLPUBLIC SfxStyleSheetBase : public cppu::WeakImplHelper<>
// avoid LNK2005 duplicate WeakImplHelper definitions with MSVC
class SAL_DLLPUBLIC_TEMPLATE SfxStyleSheetBase_Base : public cppu::WeakImplHelper<>
{
};
class SVL_DLLPUBLIC SfxStyleSheetBase : public SfxStyleSheetBase_Base
{
private:
friend class SfxStyleSheetBasePool;
@@ -225,7 +230,12 @@ friend class SfxStyleSheetBasePool;
class SfxStyleSheetBasePool_Impl;
class SVL_DLLPUBLIC SfxStyleSheetBasePool: public SfxBroadcaster, public cppu::WeakImplHelper<>
// avoid LNK2005 duplicate WeakImplHelper definitions with MSVC
class SAL_DLLPUBLIC_TEMPLATE SfxStyleSheetBasePool_Base : public cppu::WeakImplHelper<>
{
};
class SVL_DLLPUBLIC SfxStyleSheetBasePool : public SfxBroadcaster, public SfxStyleSheetBasePool_Base
{
friend class SfxStyleSheetIterator;
friend class SfxStyleSheetBase;
@@ -55,7 +55,12 @@ The dialog gets this information from the registry on execute and writes it back
class ChineseTranslationDialog;
class TEXTCONVERSIONDLGS_DLLPUBLIC ChineseTranslation_UnoDialog final : public ::cppu::WeakImplHelper <>
// avoid LNK2005 duplicate WeakImplHelper definitions with MSVC
class SAL_DLLPUBLIC_TEMPLATE ChineseTranslation_UnoDialog_Base : public cppu::WeakImplHelper<>
{
};
class TEXTCONVERSIONDLGS_DLLPUBLIC ChineseTranslation_UnoDialog final : public ChineseTranslation_UnoDialog_Base
{
public:
ChineseTranslation_UnoDialog(const css::uno::Reference< css::awt::XWindow >& xParentWindow);
+6 -1
View File
@@ -33,6 +33,11 @@ namespace com::sun::star::uno { template <class interface_type> class WeakRefere
namespace sd::framework {
// avoid LNK2005 duplicate WeakImplHelper definitions with MSVC
class SAL_DLLPUBLIC_TEMPLATE ResourceId_Base : public cppu::WeakImplHelper<>
{
};
/** A resource id uses a set of URLs to unambiguously specify a resource of
the drawing framework.
<p>Resources of the drawing framework are panes, views, tool bars, and
@@ -48,7 +53,7 @@ namespace sd::framework {
method on its creation. Arguments are only available through the
getFullResourceURL(). The getResourceURL() method strips them away.</p>
*/
class SD_DLLPUBLIC ResourceId final : public ::cppu::WeakImplHelper<>
class SD_DLLPUBLIC ResourceId final : public ResourceId_Base
{
public:
/** Create a new, empty resource id.
+1 -3
View File
@@ -120,8 +120,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const OUString& rName, SfxStyleSheetBasePo
}
SfxStyleSheetBase::SfxStyleSheetBase( const SfxStyleSheetBase& r )
: WeakImplHelper()
, m_pPool( r.m_pPool )
: m_pPool( r.m_pPool )
, nFamily( r.nFamily )
, aName( r.aName )
, aParent( r.aParent )
@@ -566,7 +565,6 @@ SfxStyleSheetBasePool::SfxStyleSheetBasePool( SfxItemPool& r ) :
SfxStyleSheetBasePool::SfxStyleSheetBasePool( const SfxStyleSheetBasePool& r ) :
SfxBroadcaster( r ),
WeakImplHelper(),
pImpl(new SfxStyleSheetBasePool_Impl),
rPool(r.rPool)
{