summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-31 11:23:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-10-31 15:52:02 +0100
commitb5e701d36ec16776e01597fd250dbde2e73fad3a (patch)
treec5f5fee0355dc6eca66dd4dcaca40a78e63dc6cf /canvas
parentd4b63c4562ec4c612df675502fd35c7c88bc432d (diff)
add o3tl::span ctor from std::vector
Makes code simpler, and std::span can be constructed from std::vector too. Change-Id: Iae26b53c52148c19d9068a63126a7393d098d654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124507 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx2
-rw-r--r--canvas/source/directx/dx_textlayout_drawhelper.cxx6
-rw-r--r--canvas/source/opengl/ogl_canvashelper.cxx2
-rw-r--r--canvas/source/vcl/textlayout.cxx4
4 files changed, 7 insertions, 7 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 7dc992a8c360..fd116745e7a8 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -270,7 +270,7 @@ namespace cairocanvas
if (maLogicalAdvancements.hasElements())
{
- rOutDev.DrawTextArray( rOutpos, maText.Text, { aOffsets.data(), aOffsets.size() },
+ rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index e7623219c798..cd50cb4878ed 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -206,14 +206,14 @@ namespace dxcanvas
{
// create the DXArray
const sal_Int32 nLen( rLogicalAdvancements.getLength() );
- std::unique_ptr<sal_Int32[]> pDXArray( std::make_unique<sal_Int32[]>(nLen) );
+ std::vector<sal_Int32> DXArray( nLen );
for( sal_Int32 i=0; i<nLen; ++i )
- pDXArray[i] = basegfx::fround( rLogicalAdvancements[i] );
+ DXArray[i] = basegfx::fround( rLogicalAdvancements[i] );
// draw the String
xVirtualDevice->DrawTextArray( aEmptyPoint,
aText,
- o3tl::span( pDXArray.get(), nLen ),
+ DXArray,
rText.StartPosition,
rText.Length,
bIsRTL ? SalLayoutFlags::BiDiRtl : SalLayoutFlags::NONE);
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index b3c79bd4f6e8..9835cea5b237 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -740,7 +740,7 @@ namespace oglcanvas
rTxt.StartPosition,
rTxt.Length,
0,
- { aDXArray.data(), aDXArray.size() } );
+ aDXArray);
}
else
{
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index b5c2ffce5154..efc772228390 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -129,7 +129,7 @@ namespace vclcanvas
maText.StartPosition,
maText.Length,
0,
- {aOffsets.data(), aOffsets.size()}))
+ aOffsets))
{
aOutlineSequence.reserve(aOutlines.size());
sal_Int32 nIndex (0);
@@ -343,7 +343,7 @@ namespace vclcanvas
rOutDev.DrawTextArray( rOutpos,
maText.Text,
- { aOffsets.data(), aOffsets.size() },
+ aOffsets,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}