summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2023-07-03 13:16:42 +0100
committerHossein <hossein@libreoffice.org>2023-12-08 17:13:53 +0100
commit9924561a094f1b3b2b78700bd1f1638d9608f881 (patch)
tree0afa3dd6b4e71d17b2d38a15e5371100cf292ae5 /include
parent9fb3970a1a599eae2447f6746597843434ee758b (diff)
tdf#147021 Use std::span to avoid SAL_N_ELEMENTS in CustomShape
EnhancedCustomShapeGeometry has a set of predefined shapes defined with classic arrays and each is used in a structure initialisation like: const mso_CustomShape msoArc = { - const_cast<SvxMSDffVertPair*>(mso_sptArcVert), SAL_N_ELEMENTS( mso_sptArcVert ), by using a span we can turn that into: + std::span<const SvxMSDffVertPair>(mso_sptArcVert), There's potential to get rid of some numbered loops later as well. The patch is large mostly because of mechanical replacement Loading EnhancedCustomShapeGeometry.cxx into vim then: into register A put: :+2,+2s/const_cast<SvxMSDffVertPair\*>[(]\([^)]*\)[)],.*/o3tl::span<const SvxMSDffVertPair>(\1),/ and do: :%g/^const mso_C.*=/@a (since fixed up to std:: ) Change-Id: Ia670b6aa7cc9f662650de2af76ee271a4469f1f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153882 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r--include/svx/EnhancedCustomShapeGeometry.hxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx
index a52dc4820b6e..db8fe5a5944f 100644
--- a/include/svx/EnhancedCustomShapeGeometry.hxx
+++ b/include/svx/EnhancedCustomShapeGeometry.hxx
@@ -70,8 +70,7 @@ struct SvxMSDffHandle
};
struct mso_CustomShape
{
- SvxMSDffVertPair* pVertices;
- sal_uInt32 nVertices;
+ std::span<const SvxMSDffVertPair> pVertices;
sal_uInt16* pElements;
sal_uInt32 nElements;
SvxMSDffCalculationData* pCalculation;