summaryrefslogtreecommitdiff
path: root/svx/source
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 /svx/source
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 'svx/source')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx2
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx2
3 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 32fd10661433..38a4c441f53c 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -326,7 +326,7 @@ static void GetTextAreaOutline(
{
FWCharacterData aCharacterData;
OUString aCharText( rText[ i ] );
- if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, aCharText, 0, 0, -1, nWidth, nullptr ) )
+ if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, aCharText, 0, 0, -1, nWidth, {} ) )
{
sal_Int32 nTextWidth = pVirDev->GetTextWidth( aCharText);
if ( aCharacterData.vOutlines.empty() )
@@ -372,7 +372,7 @@ static void GetTextAreaOutline(
pVirDev->SetFont( aFont );
}
FWCharacterData aCharacterData;
- if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, rText, 0, 0, -1, nWidth, aDXArry.empty() ? nullptr : aDXArry.data() ) )
+ if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, rText, 0, 0, -1, nWidth, { aDXArry.data(), aDXArry.size() } ) )
{
rParagraph.vCharacters.push_back( aCharacterData );
}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 5c225cf7948b..ce6fa2206326 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -223,7 +223,7 @@ namespace
// the text transformation), scale it to unit coordinates
::std::vector< double > aDXArray;
- if(rInfo.mpDXArray && rInfo.mnTextLen)
+ if(!rInfo.mpDXArray.empty() && rInfo.mnTextLen)
{
aDXArray.reserve(rInfo.mnTextLen);
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 65f7ac1eb505..4f3144d25851 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -79,7 +79,7 @@ namespace
maLocale(rInfo.mpLocale ? *rInfo.mpLocale : css::lang::Locale()),
mbRTL(!rInfo.mrFont.IsVertical() && rInfo.IsRTL())
{
- if(mnTextLength && rInfo.mpDXArray)
+ if(mnTextLength && !rInfo.mpDXArray.empty())
{
maDblDXArray.reserve(mnTextLength);