summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-28 09:27:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-29 12:38:51 +0200
commit894b4911ffb96ff667fdeb3aec7922316ab7230a (patch)
tree3942ed8088c058b70bb79984b186c5156284abf4 /include/editeng
parent5b0ae3b59cd2cccfb72d991657366eb2a69bff49 (diff)
pass DX array around using o3tl::span instead of pointer
so we get bounds checking in debug mode Note that I cannot just pass around the std::vectors involved because there is a place in editeng which calls with a subset of a vector. Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/editeng.hxx3
-rw-r--r--include/editeng/outliner.hxx6
-rw-r--r--include/editeng/svxfont.hxx3
3 files changed, 7 insertions, 5 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index db50eb2ac5ec..3006e178783c 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <o3tl/span.hxx>
#include <svl/typedwhich.hxx>
#include <editeng/editdata.hxx>
#include <editeng/editstat.hxx>
@@ -497,7 +498,7 @@ public:
virtual void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen,
- const tools::Long* pDXArray, const SvxFont& rFont,
+ o3tl::span<const tools::Long> pDXArray, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 5003a671d35e..98fc4ff41667 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -395,7 +395,7 @@ public:
sal_Int32 mnTextLen;
sal_Int32 mnPara;
const SvxFont& mrFont;
- const tools::Long* mpDXArray;
+ o3tl::span<const tools::Long> mpDXArray;
const EEngineData::WrongSpellVector* mpWrongSpellVector;
const SvxFieldData* mpFieldData;
@@ -421,7 +421,7 @@ public:
sal_Int32 nTxtLen,
const SvxFont& rFnt,
sal_Int32 nPar,
- const tools::Long* pDXArr,
+ o3tl::span<const tools::Long> pDXArr,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
const css::lang::Locale* pLocale,
@@ -813,7 +813,7 @@ public:
void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen,
- const tools::Long* pDXArray, const SvxFont& rFont,
+ o3tl::span<const tools::Long> pDXArray, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx
index fb0b8dbc97de..eabffc4f6301 100644
--- a/include/editeng/svxfont.hxx
+++ b/include/editeng/svxfont.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_EDITENG_SVXFONT_HXX
#include <editeng/svxenum.hxx>
+#include <o3tl/span.hxx>
#include <tools/long.hxx>
#include <vcl/font.hxx>
#include <editeng/editengdllapi.h>
@@ -95,7 +96,7 @@ public:
const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32) const;
void QuickDrawText( OutputDevice *pOut, const Point &rPos, const OUString &rTxt,
- const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32, const tools::Long* pDXArray = nullptr ) const;
+ const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32, o3tl::span<const tools::Long> pDXArray = {} ) const;
Size QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_Int32 nIdx, const sal_Int32 nLen, std::vector<tools::Long>* pDXArray = nullptr ) const;