diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-04-08 14:35:34 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-04-09 00:37:21 +0200 |
commit | 7cc4b06fc44c06866cdabb4a8856c7cee3fcfe2d (patch) | |
tree | 5f9aaf40c26666555c77f669cc4bce98d04d665b /sw | |
parent | bc0acc7bd02057f3c04af39530ee0fe235353576 (diff) |
use helper GetTextArray() in all places
Change-Id: Icec4326cf614574d7dabe6752f985b3ac4462fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132744
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/fntcache.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 14 |
2 files changed, 7 insertions, 14 deletions
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx index 3b8934013059..4f58be568951 100644 --- a/sw/source/core/inc/fntcache.hxx +++ b/sw/source/core/inc/fntcache.hxx @@ -78,13 +78,6 @@ class SwFntObj final : public SwCacheObj bool m_bSymbol : 1; bool m_bPaintBlank : 1; - static void GetTextArray(const OutputDevice& rOutputDevice, const OUString& rStr, - std::vector<sal_Int32>& rDXAry, sal_Int32 nIndex, sal_Int32 nLen, - const vcl::text::TextLayoutCache* layoutCache = nullptr); - static void GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry, - sal_Int32 nLen); - static void GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry); - static tools::Long s_nPixWidth; static MapMode *s_pPixMap; diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 39e23613e669..65a4332b462d 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -756,20 +756,20 @@ static void lcl_DrawLineForWrongListData( rInf.GetOut().Pop(); } -void SwFntObj::GetTextArray(const OutputDevice& rDevice, const OUString& rStr, std::vector<sal_Int32>& rDXAry, - sal_Int32 nIndex, sal_Int32 nLen, const vcl::text::TextLayoutCache* layoutCache) +static void GetTextArray(const OutputDevice& rDevice, const OUString& rStr, std::vector<sal_Int32>& rDXAry, + sal_Int32 nIndex, sal_Int32 nLen, const vcl::text::TextLayoutCache* layoutCache = nullptr) { const SalLayoutGlyphs* pLayoutCache = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(&rDevice, rStr, nIndex, nLen, 0, layoutCache); rDevice.GetTextArray(rStr, &rDXAry, nIndex, nLen, layoutCache, pLayoutCache); } -void SwFntObj::GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry) +static void GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry) { return GetTextArray(rOutputDevice, rInf.GetText(), rDXAry, rInf.GetIdx().get(), rInf.GetLen().get(), rInf.GetVclCache()); } -void SwFntObj::GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry, sal_Int32 nLen) +static void GetTextArray(const OutputDevice& rOutputDevice, const SwDrawTextInfo& rInf, std::vector<sal_Int32>& rDXAry, sal_Int32 nLen) { // Substring is fine. assert( nLen <= rInf.GetLen().get()); @@ -2246,7 +2246,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, tools::Long nTe const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc); std::vector<sal_Int32> aKernArray; - rInf.GetOut().GetTextArray( rInf.GetText(), &aKernArray, + GetTextArray( rInf.GetOut(), rInf.GetText(), aKernArray, sal_Int32(rInf.GetIdx()), sal_Int32(rInf.GetLen())); tools::Long nAvgWidthPerChar = aKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen()); @@ -2277,7 +2277,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, tools::Long nTe const tools::Long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf ); std::vector<sal_Int32> aKernArray; - rInf.GetOut().GetTextArray( rInf.GetText(), &aKernArray, + GetTextArray( rInf.GetOut(), rInf.GetText(), aKernArray, sal_Int32(rInf.GetIdx()), sal_Int32(rInf.GetLen())); tools::Long nCurrPos = aKernArray[sal_Int32(nTextBreak)] + nGridWidthAdd; while (++nTextBreak < rInf.GetLen() && nTextWidth >= nCurrPos) @@ -2394,7 +2394,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, tools::Long nTe else if (nLn > nTextBreak2 + nTextBreak2) nLn = nTextBreak2 + nTextBreak2; std::vector<sal_Int32> aKernArray; - rInf.GetOut().GetTextArray( rInf.GetText(), &aKernArray, + GetTextArray( rInf.GetOut(), rInf.GetText(), aKernArray, sal_Int32(rInf.GetIdx()), sal_Int32(nLn)); if( rInf.GetScriptInfo()->Compress( aKernArray.data(), rInf.GetIdx(), nLn, rInf.GetKanaComp(), o3tl::narrowing<sal_uInt16>(GetHeight( m_nActual )), |