diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-10-31 11:23:11 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-10-31 15:52:02 +0100 |
commit | b5e701d36ec16776e01597fd250dbde2e73fad3a (patch) | |
tree | c5f5fee0355dc6eca66dd4dcaca40a78e63dc6cf /vcl | |
parent | d4b63c4562ec4c612df675502fd35c7c88bc432d (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 'vcl')
-rw-r--r-- | vcl/source/control/calendar.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/eps/eps.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 6 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/textlayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 2 |
9 files changed, 14 insertions, 14 deletions
diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx index 1ce0c72b0687..7554d0d99a08 100644 --- a/vcl/source/control/calendar.cxx +++ b/vcl/source/control/calendar.cxx @@ -707,7 +707,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) std::vector<sal_Int32> aTmp; for (int k=0; k<6; ++k) aTmp.push_back(mnDayOfWeekAry[k+1]); - rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, {aTmp.data(), aTmp.size()}); + rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, aTmp); // display days sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx index f692071a8d92..ced4d9be1a9e 100644 --- a/vcl/source/filter/eps/eps.cxx +++ b/vcl/source/filter/eps/eps.cxx @@ -768,7 +768,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) OUString aUniStr = pA->GetText().copy( pA->GetIndex(), pA->GetLen() ); Point aPoint( pA->GetPoint() ); - ImplText( aUniStr, aPoint, { pA->GetDXArray().data(), pA->GetDXArray().size() }, 0, rVDev ); + ImplText( aUniStr, aPoint, pA->GetDXArray(), 0, rVDev ); } break; diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index f77e2aad2001..84a18beb63fe 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -881,7 +881,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, o else { nNormWidth = maVDev->GetTextArray( rText, &aOwnArray ); - pDX = { aOwnArray.data(), aOwnArray.size() }; + pDX = aOwnArray; } if( nLen > 1 ) @@ -893,7 +893,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, o if (!pDXArray.empty()) { aOwnArray.insert(aOwnArray.begin(), pDXArray.begin(), pDXArray.end()); - pDX = { aOwnArray.data(), aOwnArray.size() }; + pDX = aOwnArray; } const double fFactor = static_cast<double>(nWidth) / nNormWidth; @@ -1371,7 +1371,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) const OUString aText = pA->GetText().copy( pA->GetIndex(), std::min(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); ImplCheckTextAttr(); - ImplWriteTextRecord( pA->GetPoint(), aText, { pA->GetDXArray().data(), pA->GetDXArray().size() }, 0 ); + ImplWriteTextRecord( pA->GetPoint(), aText, pA->GetDXArray(), 0 ); } break; diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 339479b2b42c..6abd9f95d490 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1185,8 +1185,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); aSrcLineInfo = LineInfo(); SetAllAttr(); - if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, { pA->GetDXArray().data(), pA->GetDXArray().size() } ) ) - WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, { pA->GetDXArray().data(), pA->GetDXArray().size() } ); + if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, pA->GetDXArray() ) ) + WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, pA->GetDXArray() ); } break; @@ -1211,8 +1211,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) aDXAry.clear(); aSrcLineInfo = LineInfo(); SetAllAttr(); - if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, { aDXAry.data(), aDXAry.size() } ) ) - WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, { aDXAry.data(), aDXAry.size() } ); + if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, aDXAry ) ) + WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, aDXAry ); } } break; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 28cd535a1eb6..86e020b92dac 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1463,7 +1463,7 @@ tools::Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, tools::R tools::Rectangle aRect; // hdu said base = index aMapVDev->GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(), - 0, { pAct->GetDXArray().data(), pAct->GetDXArray().size() } ); + 0, pAct->GetDXArray() ); Point aPt( pAct->GetPoint() ); aRect.Move( aPt.X(), aPt.Y() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev->GetMapMode(), GetPrefMapMode() ), aClipStack, nullptr ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 0135afd9d626..25d51f276056 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -638,7 +638,7 @@ MetaTextArrayAction::~MetaTextArrayAction() void MetaTextArrayAction::Execute( OutputDevice* pOut ) { - pOut->DrawTextArray( maStartPt, maStr, { maDXAry.data(), maDXAry.size() }, mnIndex, mnLen ); + pOut->DrawTextArray( maStartPt, maStr, maDXAry, mnIndex, mnLen ); } rtl::Reference<MetaAction> MetaTextArrayAction::Clone() const diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 8bce2a37ba8c..8d1cc7310da3 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -809,7 +809,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case MetaActionType::TEXTARRAY: { const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pAction); - m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), { pA->GetDXArray().data(), pA->GetDXArray().size() }, pA->GetIndex(), pA->GetLen() ); + m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() ); } break; diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 0f63c969931d..416c68343f47 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -209,7 +209,7 @@ namespace vcl std::vector<sal_Int32> aCharWidths; tools::Long nTextWidth = GetTextArray( _rText, &aCharWidths, _nStartIndex, _nLength ); - m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, { aCharWidths.data(), aCharWidths.size() }, _nStartIndex, _nLength ); + m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, aCharWidths, _nStartIndex, _nLength ); m_aCompleteTextRect.Union( tools::Rectangle( _rStartPoint, Size( nTextWidth, m_rTargetDevice.GetTextHeight() ) ) ); } diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index a372439a4bb9..f747c04798fe 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -1193,7 +1193,7 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic // #105987# ImplLayout takes everything in logical coordinates std::unique_ptr<SalLayout> pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen(), rTextAct.GetPoint(), - 0, { rTextAct.GetDXArray().data(), rTextAct.GetDXArray().size() } ); + 0, rTextAct.GetDXArray()); if( pSalLayout ) { tools::Rectangle aBoundRect( rOut.ImplGetTextBoundRect( *pSalLayout ) ); |