diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-01 11:46:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-01 13:57:39 +0100 |
commit | 5d4321803007e683968b5622a1685d8aef1e932c (patch) | |
tree | cb16ec665127550888d3ccf4335e8dd70dbe771f /canvas/source | |
parent | c27280c512683a52a19af6448f84f0533655d8fa (diff) |
we only need aOffsets if maLogicalAdvancements.hasElements() is true
Change-Id: I79a1d406ed4f066e26bd9b2b090ce9b444e66a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143521
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index ab38c4458307..ebfcfe6dc11a 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -263,13 +263,11 @@ namespace cairocanvas ::osl::MutexGuard aGuard( m_aMutex ); setupLayoutMode( rOutDev, mnTextDirection ); - std::vector<sal_Int32> aOffsets(maLogicalAdvancements.getLength()); - - if( maLogicalAdvancements.hasElements() ) - setupTextOffsets( aOffsets.data(), maLogicalAdvancements, viewState, renderState ); - if (maLogicalAdvancements.hasElements()) { + std::vector<sal_Int32> aOffsets(maLogicalAdvancements.getLength()); + setupTextOffsets( aOffsets.data(), maLogicalAdvancements, viewState, renderState ); + rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets, {}, ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition), ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ); |