summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-16 12:07:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-16 16:04:05 +0200
commit892bc8a15a09081b3de0afb9420abb5c2d110ea4 (patch)
treea9c2521f4ade3bbc4c9c6f69d3d999d089ddf871
parentClarify that SvtLanguageTable::GetLanguageType() expects the UI name (diff)
downloadcore-892bc8a15a09081b3de0afb9420abb5c2d110ea4.tar.gz
core-892bc8a15a09081b3de0afb9420abb5c2d110ea4.zip
-Werror=class-memaccess
gcc doesn't like memcpy here error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<short unsigned int, short unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] 1459 | memcpy(p, other.m_pairs, m_size * sizeof(WhichPair)); Change-Id: I44055d0d4dec589af7f98d62f106b701f1f5a4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119063 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svl/source/items/itemset.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index f96d0c9c8ef1..324cf6da69f0 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1418,7 +1418,8 @@ SfxItemSet SfxAllItemSet::CloneAsValue(bool , SfxItemPool * ) const
WhichRangesContainer::WhichRangesContainer( const WhichPair* wids, sal_Int32 nSize )
{
auto p = new WhichPair[nSize];
- memcpy(p, wids, nSize * sizeof(WhichPair));
+ for (int i=0; i<nSize; ++i)
+ p[i] = wids[i];
m_pairs = p;
m_size = nSize;
m_bOwnRanges = true;
@@ -1455,7 +1456,8 @@ WhichRangesContainer& WhichRangesContainer::operator=(WhichRangesContainer const
if (m_bOwnRanges)
{
auto p = new WhichPair[m_size];
- memcpy(p, other.m_pairs, m_size * sizeof(WhichPair));
+ for (int i=0; i<m_size; ++i)
+ p[i] = other.m_pairs[i];
m_pairs = p;
}
else