diff options
-rw-r--r-- | include/vcl/outdev.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 34 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 5 |
3 files changed, 32 insertions, 9 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 0088136ca734..1bf52296ea43 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1172,6 +1172,8 @@ public: vcl::TextLayoutCache const* = nullptr) const; std::shared_ptr<vcl::TextLayoutCache> CreateTextLayoutCache(OUString const&) const; + static bool UseCommonLayout(); + private: SAL_DLLPRIVATE void ImplInitTextColor(); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index a92fb879f2df..70be938edce2 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1384,10 +1384,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { const OUString* pStr = &rInf.GetText(); -#if !defined(MACOSX) && !defined(IOS) OUString aStr; OUString aBulletOverlay; -#endif + bool bBullet = rInf.GetBullet(); if( m_bSymbol ) bBullet = false; @@ -1492,8 +1491,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) nScrPos = pScrArray[ 0 ]; -#if !defined(MACOSX) && !defined(IOS) - if( bBullet ) + if( bBullet +#if defined(MACOSX) || defined(IOS) + && OutputDevice::UseCommonLayout() +#endif + ) { // !!! HACK !!! // The Arabic layout engine requires some context of the string @@ -1532,7 +1534,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK)); } } -#endif + sal_Int32 nCnt = rInf.GetText().getLength(); if ( nCnt < rInf.GetIdx() ) nCnt = 0; @@ -1557,14 +1559,21 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos ); #if defined(MACOSX) || defined(IOS) - rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(), + if (!OutputDevice::UseCommonLayout()) + { + rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(), pKernArray, rInf.GetIdx(), 1, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE ); -#else + } + else + { +#endif rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(), pKernArray, rInf.GetIdx(), 1 ); if( bBullet ) rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray, rInf.GetIdx() ? 1 : 0, 1 ); +#if defined(MACOSX) || defined(IOS) + } #endif } else @@ -1747,9 +1756,14 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos ); #if defined(MACOSX) || defined(IOS) - rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs, + if (!OutputDevice::UseCommonLayout()) + { + rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs, rInf.GetIdx() + nOffs , nLen - nOffs, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE ); -#else + } + else + { +#endif // If we paint bullets instead of spaces, we use a copy of // the paragraph string. For the layout engine, the copy // of the string has to be an environment of the range which @@ -1804,6 +1818,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) pTmpFont->SetStrikeout(aPreviousStrikeout); rInf.GetOut().Pop(); } +#if defined(MACOSX) || defined(IOS) + } #endif } } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 05062801cf19..60917ce0d98f 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -2903,4 +2903,9 @@ bool OutputDevice::GetTextOutline( tools::PolyPolygon& rPolyPoly, const OUString return true; } +bool OutputDevice::UseCommonLayout() +{ + return SalLayout::UseCommonLayout(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |