[Libreoffice-commits] core.git: registry/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 3 15:37:15 UTC 2019


 registry/source/reflwrit.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6ad127ead70cc0942c9876556dda7f525d7d01a0
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Oct 3 16:48:04 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Oct 3 17:35:37 2019 +0200

    tdf#127766: Avoid ODR violation for class/struct FieldEntry
    
    We had a class FieldEntry in registry/source/reflwrit.cxx and a struct
    FieldEntry in sd/source/filter/eppt/text.hxx. That causes problems
    when code from both is linked into one binary, as in the iOS and
    Android apps. The wrong FieldEntry destructor got called from the code
    in sd which of course lead to a crash.
    
    Fix by putting the one in registry into an unnamed namespace. (I put a
    large chunk of the source file in it while at it.)
    
    Change-Id: I1b32075f7aba256129b36ceb38eba605c882b9ff
    Reviewed-on: https://gerrit.libreoffice.org/80141
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index afb01d96b213..25937eea8f8d 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -165,6 +165,7 @@ sal_uInt32 writeDouble(sal_uInt8* buffer, double v)
 
 **************************************************************************/
 
+namespace {
 
 /**************************************************************************
 
@@ -1098,6 +1099,7 @@ void TypeWriter::createBlop()
     m_blopSize = blopSize;
 }
 
+} // unnamed namespace
 
 /**************************************************************************
 


More information about the Libreoffice-commits mailing list