git: e9090c817e49 - main - editors/openoffice-*: Fix build error with clang 19

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Mon, 04 Nov 2024 09:31:24 UTC
The branch main has been updated by truckman:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e9090c817e496dd0e45b88b57bff0063385e8ad8

commit e9090c817e496dd0e45b88b57bff0063385e8ad8
Author:     Don Lewis <truckman@FreeBSD.org>
AuthorDate: 2024-11-04 09:15:33 +0000
Commit:     Don Lewis <truckman@FreeBSD.org>
CommitDate: 2024-11-04 09:31:14 +0000

    editors/openoffice-*: Fix build error with clang 19
    
    Fix this build error:
    
    In file included from /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.15/main/writerfilter/source/ooxml/OOXMLFactory.cxx:28:
    In file included from /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.15/main/writerfilter/source/ooxml/OOXMLFactory.hxx:39:
    In file included from /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.15/main/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx:38:
    /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.15/main/writerfilter/source/ooxml/RefAndPointer.hxx:104:18: error: no member named 'getHandler' in 'RefAndPointer<Interface, ChildClass>'; did you mean 'mpHandler'?
      104 |         set(rSrc.getHandler());
          |                  ^~~~~~~~~~
          |                  mpHandler
    /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.15/main/writerfilter/source/ooxml/RefAndPointer.hxx:39:26: note: 'mpHandler' declared here
       39 |     mutable ChildClass * mpHandler;
          |                          ^
    
    when building with:
    
    FreeBSD clang version 19.1.2 (https://github.com/llvm/llvm-project.git llvmorg-19.1.2-0-g7ba7d8e2f7b6)
    
    It appears that clang 19 does more sanity checks of unused class
    methods than gcc, old versions of Microsoft Visual C++ used by the
    AOO project, and older versions of clang.
    
    The assign method in the RefAndPointer class has been broken since
    forever and appears to be unused, so comment it out.
    
    This is only a build fix and does not affect the generated code with
    older compilers, so there is no PORTREVISION bump.
    
    Reported by:    pkg-fallout
---
 ...tch-writerfilter_source_ooxml_RefAndPointer.hxx | 24 ++++++++++++++++++++++
 ...tch-writerfilter_source_ooxml_RefAndPointer.hxx | 24 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/editors/openoffice-4/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx b/editors/openoffice-4/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx
new file mode 100644
index 000000000000..ca7a35f3d1e8
--- /dev/null
+++ b/editors/openoffice-4/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx
@@ -0,0 +1,24 @@
+--- writerfilter/source/ooxml/RefAndPointer.hxx.orig	2021-04-02 12:58:23 UTC
++++ writerfilter/source/ooxml/RefAndPointer.hxx
+@@ -98,13 +98,14 @@ class RefAndPointer (public)
+     ChildClass * getPointer() const { return mpHandler; }
+     const uno::Reference<Interface> getRef() const { return mRef; }
+ 
+-    RefAndPointer & operator=
+-    (const RefAndPointer & rSrc)
+-    {
+-        set(rSrc.getHandler());
+-
+-        return *this;
+-    }
++// ...RefAndPointer.hxx:104:18: error: no member named 'getHandler' in 'RefAndPointer<Interface, ChildClass>'; did you mean 'mpHandler'?
++//    RefAndPointer & operator=
++//    (const RefAndPointer & rSrc)
++//    {
++//        set(rSrc.getHandler());
++//
++//        return *this;
++//    }
+ 
+     bool is() { return getRef().is(); }
+ 
diff --git a/editors/openoffice-devel/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx b/editors/openoffice-devel/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx
new file mode 100644
index 000000000000..4222cbefefbe
--- /dev/null
+++ b/editors/openoffice-devel/files/patch-writerfilter_source_ooxml_RefAndPointer.hxx
@@ -0,0 +1,24 @@
+--- writerfilter/source/ooxml/RefAndPointer.hxx.orig	2019-09-17 22:55:25 UTC
++++ writerfilter/source/ooxml/RefAndPointer.hxx
+@@ -75,13 +75,14 @@ class RefAndPointer (public)
+     ChildClass * getPointer() const { return mpHandler; }
+     const uno::Reference<Interface> getRef() const { return mRef; }
+ 
+-    RefAndPointer & operator=
+-    (const RefAndPointer & rSrc)
+-    {
+-        set(rSrc.getHandler());
+-
+-        return *this;
+-    }
++// ...RefAndPointer.hxx:104:18: error: no member named 'getHandler' in 'RefAndPointer<Interface, ChildClass>'; did you mean 'mpHandler'?
++//    RefAndPointer & operator=
++//    (const RefAndPointer & rSrc)
++//    {
++//        set(rSrc.getHandler());
++//
++//        return *this;
++//    }
+ 
+     bool is() { return getRef().is(); }
+