basic/source/basmgr/basmgr.cxx |    3 +--
 basic/source/classes/image.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit f336fc1835e89175257058ac7397a02b805e8170
Author:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
AuthorDate: Mon Apr 7 14:42:10 2025 +0200
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Mon Apr 7 17:59:19 2025 +0200

    Revert "tdf#163691 Replace memcpy with std::copy in basmgr.cxx and 
image.cxx"
    
    This reverts commit fa357e4a0a44471637373302c4391e6b0c2f1a20.
    
    Reason for revert: no license statement submitted
    
    Change-Id: I45f473c3185df5593a55017fcbaefd03dc5f43e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183790
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index d7f8e39fbe0d..3112021319da 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -45,7 +45,6 @@
 
 #include <memory>
 #include <vector>
-#include <algorithm>
 
 #define LIB_SEP         0x01
 #define LIBINFO_SEP     0x02
@@ -1757,7 +1756,7 @@ static uno::Sequence< sal_Int8 > implGetDialogData( 
SbxObject* pDialog )
     uno::Sequence< sal_Int8 > aData( nLen );
     sal_Int8* pDestData = aData.getArray();
     const sal_Int8* pSrcData = static_cast<const 
sal_Int8*>(aMemStream.GetData());
-    std::copy(pSrcData, pSrcData + nLen, pDestData);
+    memcpy( pDestData, pSrcData, nLen );
     return aData;
 }
 
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 5b041964678e..95e9a26ae6b2 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -229,7 +229,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                     if (GetToUnicodePoolData(r, nLen, nNext))
                     {
                         OUString s = read_uInt16s_ToOUString(r, nLen);
-                        std::copy(s.getStr(), s.getStr() + s.getLength(), 
pStrings.get());
+                        memcpy(pStrings.get(), s.getStr(), s.getLength() * 
sizeof(sal_Unicode));
                     }
                     else
                     {
@@ -239,7 +239,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                         {
                             sal_uInt16 nOff2 = 
static_cast<sal_uInt16>(mvStringOffsets[j]);
                             OUString aStr(pByteStrings.get() + nOff2, 
strlen(pByteStrings.get() + nOff2), eCharSet);
-                            std::copy(aStr.getStr(), aStr.getStr() + 
aStr.getLength() + 1, pStrings.get() + nOff2);
+                            memcpy(pStrings.get() + nOff2, aStr.getStr(), 
(aStr.getLength() + 1) * sizeof(sal_Unicode));
                         }
                     }
                 }
@@ -431,7 +431,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
         {
             sal_uInt16 nOff = static_cast<sal_uInt16>(mvStringOffsets[ i ]);
             OString aStr(OUStringToOString(std::u16string_view(pStrings.get() 
+ nOff), eCharSet));
-            std::copy(aStr.getStr(), aStr.getStr() + aStr.getLength() + 1, 
pByteStrings.get() + nOff);
+            memcpy( pByteStrings.get() + nOff, aStr.getStr(), 
(aStr.getLength() + 1) * sizeof( char ) );
         }
         r.WriteUInt32( nStringSize );
         r.WriteBytes(pByteStrings.get(), nStringSize);
@@ -570,7 +570,7 @@ void SbiImage::AddString( const OUString& r )
         sal_uInt32 nNewLen = needed + 1024;
         nNewLen &= 0xFFFFFC00;  // trim to 1K border
         std::unique_ptr<sal_Unicode[]> p(new sal_Unicode[nNewLen]);
-        std::copy(pStrings.get(), pStrings.get() + nStringSize, p.get());
+        memcpy( p.get(), pStrings.get(), nStringSize * sizeof( sal_Unicode ) );
         pStrings = std::move(p);
         nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen);
     }

Reply via email to