[Libreoffice-commits] core.git: include/vcl

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 22 10:08:55 UTC 2020


 include/vcl/weldutils.hxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 5a5bb1b02dca3960ba58c70e3b595fa678550604
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Sep 22 11:42:41 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Sep 22 12:08:04 2020 +0200

    Fix symbols already defined MSVC link error
    
    ... after af90b8089405d6f042207f5639e750f08798ae92, which made VCL
    to instantiate exported implementation of the template.
    
    Fixes the error:
      ivcl.lib(vcllo.dll) : error LNK2005: "public: virtual void __cdecl cppu::WeakImplHelper<class com::sun::star::frame::XStatusListener>::acquire(void)" (?acquire@?$WeakImplHelper at VXStatusListener@frame at star@sun at com@@@cppu@@UEAAXXZ) already defined in helpinterceptor.o
    
    Modelled after 013f84d06f7ad76d72b863170891589c3504508c.
    
    Change-Id: I40ba226d95ad2f1fda177839d9468d6861ca54c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103144
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx
index 7d22a456119e..0c892427f45d 100644
--- a/include/vcl/weldutils.hxx
+++ b/include/vcl/weldutils.hxx
@@ -159,9 +159,14 @@ public:
     }
 };
 
-class VCL_DLLPUBLIC WidgetStatusListener final
+// don't export to avoid duplicate WeakImplHelper definitions with MSVC
+class SAL_DLLPUBLIC_TEMPLATE WidgetStatusListener_Base
     : public cppu::WeakImplHelper<css::frame::XStatusListener>
 {
+};
+
+class VCL_DLLPUBLIC WidgetStatusListener final : public WidgetStatusListener_Base
+{
 public:
     WidgetStatusListener(weld::Widget* widget, const OUString& rCommand);
 


More information about the Libreoffice-commits mailing list