download.lst                                        |    4 ++--
 external/librevenge/C2039-unique-shared_ptr.patch.0 |   11 +++++++++++
 external/librevenge/UnpackedTarball_librevenge.mk   |    1 +
 external/librevenge/tdf63130-improve-perf.patch.0   |   16 ++++++++--------
 4 files changed, 22 insertions(+), 10 deletions(-)

New commits:
commit 49a0203e7aa3a98bbed4412ab4364614505f88eb
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 9 18:02:59 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri May 10 15:27:16 2024 +0200

    librevenge: upgrade to 0.0.5
    
    * Add C2039-unique-shared_ptr.patch.0 to fix
    
    
C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/librevenge/src/lib/RVNGBinaryData.cpp(96):
 error C2039: 'unique': is not a member of 
'std::shared_ptr<librevenge::`anonymous-namespace'::DataImpl>'
    
C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/librevenge/src/lib/RVNGBinaryData.cpp(86):
 note: see declaration of 
'std::shared_ptr<librevenge::`anonymous-namespace'::DataImpl>'
    make[1]: *** 
[C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/solenv/gbuild/LinkTarget.mk:398:
 
C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/GenCxxObject/UnpackedTarball/librevenge/src/lib/RVNGBinaryData.o]
 Error 2
    
    on Windows
    
    Change-Id: I31023633426fc902e2298c696826d8371bb4d63b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167388
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/download.lst b/download.lst
index a7874c271ab2..c8146984bbf3 100644
--- a/download.lst
+++ b/download.lst
@@ -580,8 +580,8 @@ REDLAND_TARBALL := 
e5be03eda13ef68aabab6e42aa67715e-redland-1.0.17.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-REVENGE_SHA256SUM := 
c51601cd08320b75702812c64aae0653409164da7825fd0f451ac2c5dbe77cbf
-REVENGE_VERSION_MICRO := 4
+REVENGE_SHA256SUM := 
5892ca6796f7a2a93d580832e907e849b19d980b40d326a283b18877ab6de0c5
+REVENGE_VERSION_MICRO := 5
 REVENGE_TARBALL := librevenge-0.0.$(REVENGE_VERSION_MICRO).tar.bz2
 # three static lines
 # so that git cherry-pick
diff --git a/external/librevenge/C2039-unique-shared_ptr.patch.0 
b/external/librevenge/C2039-unique-shared_ptr.patch.0
new file mode 100644
index 000000000000..0dcec5058e89
--- /dev/null
+++ b/external/librevenge/C2039-unique-shared_ptr.patch.0
@@ -0,0 +1,11 @@
+--- src/lib/RVNGBinaryData.cpp 2024-05-10 13:20:09.278288686 +0200
++++ src/lib/RVNGBinaryData.cpp 2024-05-10 13:23:14.365139906 +0200
+@@ -93,7 +93,7 @@
+ 
+ void RVNGBinaryDataImpl::makeUnique()
+ {
+-      if (!m_ptr.unique())
++      if (!(m_ptr.use_count() == 1))
+       {
+               std::shared_ptr<DataImpl> ptr(new DataImpl());
+               ptr->m_buf = m_ptr->m_buf;
diff --git a/external/librevenge/UnpackedTarball_librevenge.mk 
b/external/librevenge/UnpackedTarball_librevenge.mk
index 5fcc2e33b060..316e961bd1ba 100644
--- a/external/librevenge/UnpackedTarball_librevenge.mk
+++ b/external/librevenge/UnpackedTarball_librevenge.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,librevenge,0))
 $(eval $(call gb_UnpackedTarball_add_patches,librevenge, \
     external/librevenge/rpath.patch \
     external/librevenge/tdf63130-improve-perf.patch.0 \
+    external/librevenge/C2039-unique-shared_ptr.patch.0 \
 ))
 
 ifneq ($(OS),MACOSX)
diff --git a/external/librevenge/tdf63130-improve-perf.patch.0 
b/external/librevenge/tdf63130-improve-perf.patch.0
index 02a8a6e1f94b..f8b972217c76 100644
--- a/external/librevenge/tdf63130-improve-perf.patch.0
+++ b/external/librevenge/tdf63130-improve-perf.patch.0
@@ -18,7 +18,7 @@
        /** Create a new string from  s as escaped XML.
 --- src/lib/RVNGBinaryData.cpp 2023-05-17 15:48:15.373159469 +0200
 +++ src/lib/RVNGBinaryData.cpp 2023-05-17 15:49:00.773411873 +0200
-@@ -67,9 +67,9 @@
+@@ -68,9 +68,9 @@
        boost::archive::iterators::transform_width<std::vector<unsigned 
char>::const_iterator, 6, 8 > > base64_encoder;
  
        // Encode the buffer and create a string
@@ -30,14 +30,14 @@
  
        result.append(numPadding, '=');  // add '=' for each padded character
  }
-@@ -150,10 +150,10 @@
+@@ -153,10 +153,10 @@
  {
        m_binaryDataImpl->makeUnique();
  
 -      unsigned long previousSize = m_binaryDataImpl->m_ptr->m_buf.size();
 -      m_binaryDataImpl->m_ptr->m_buf.reserve(previousSize + 
data.m_binaryDataImpl->m_ptr->m_buf.size());
--      for (unsigned long i = 0; i < 
data.m_binaryDataImpl->m_ptr->m_buf.size(); i++)
--              
m_binaryDataImpl->m_ptr->m_buf.push_back(data.m_binaryDataImpl->m_ptr->m_buf[i]);
+-      const auto &src = data.m_binaryDataImpl->m_ptr->m_buf;
+-      std::copy(src.begin(), src.end(), 
std::back_inserter(m_binaryDataImpl->m_ptr->m_buf));
 +      m_binaryDataImpl->m_ptr->m_buf.insert(
 +              m_binaryDataImpl->m_ptr->m_buf.end(),
 +              data.m_binaryDataImpl->m_ptr->m_buf.begin(),
@@ -45,7 +45,7 @@
  }
  
  void RVNGBinaryData::appendBase64Data(const RVNGString &base64)
-@@ -231,8 +231,9 @@
+@@ -234,8 +234,9 @@
  const RVNGString RVNGBinaryData::getBase64Data() const
  {
        std::string base64;
@@ -58,7 +58,7 @@
  RVNGInputStream *RVNGBinaryData::getDataStream() const
 --- src/lib/RVNGString.cpp     2023-05-17 15:48:15.373159469 +0200
 +++ src/lib/RVNGString.cpp     2023-05-17 15:49:00.773411873 +0200
-@@ -73,6 +73,7 @@
+@@ -76,6 +76,7 @@
  {
  public:
        RVNGStringImpl() : m_buf() {}
@@ -66,8 +66,8 @@
        bool empty() const
        {
                return m_buf.empty();
-@@ -157,6 +158,11 @@
-               m_stringImpl->m_buf = str;
+@@ -200,6 +201,11 @@
+               m_stringImpl->append(str);
  }
  
 +RVNGString::RVNGString(std::string&& str) :

Reply via email to