From b35b1dca3a734739a9780c17331b8368d7df7657 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 5 Oct 2021 09:07:23 +0100 Subject: ofz#39150 skip detecting bidi directions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I92eb838f0ee744902f3c358fd1627970eb548ef8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123085 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/core/txtnode/fntcache.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 904535068fa6..bfca43e92147 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -17,11 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include -#include - #include #include #include @@ -33,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +56,8 @@ #include #include #include +#include +#include using namespace ::com::sun::star; @@ -189,6 +189,13 @@ void SwFntObj::CreatePrtFont( const OutputDevice& rPrt ) } +#if !ENABLE_FUZZERS +const SalLayoutFlags eGlyphItemsOnlyLayout = SalLayoutFlags::GlyphItemsOnly; +#else +// ofz#39150 skip detecting bidi directions +const SalLayoutFlags eGlyphItemsOnlyLayout = SalLayoutFlags::GlyphItemsOnly | SalLayoutFlags::BiDiStrong; +#endif + /** * Pre-calculates glyph items for the rendered subset of rKey's text, assuming * outdev state does not change between the outdev calls. @@ -204,7 +211,7 @@ static SalLayoutGlyphs* lcl_CreateLayout(const SwTextGlyphsKey& rKey, SwTextGlyp // Calculate glyph items. std::unique_ptr pLayout = rKey.m_pOutputDevice->ImplLayout(rKey.m_aText, rKey.m_nIndex, rKey.m_nLength, Point(0, 0), 0, - nullptr, SalLayoutFlags::GlyphItemsOnly); + nullptr, eGlyphItemsOnlyLayout); if (!pLayout) return nullptr; -- cgit