diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-05 09:07:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-05 22:13:37 +0200 |
commit | b35b1dca3a734739a9780c17331b8368d7df7657 (patch) | |
tree | c3a3c651e21afb51dff255c31dabf849aaac26c7 | |
parent | ce8a7278e1304f7aaa65bce34aeeda5e83b231f1 (diff) |
ofz#39150 skip detecting bidi directions
Change-Id: I92eb838f0ee744902f3c358fd1627970eb548ef8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123085
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
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 <memory> #include <sal/config.h> -#include <cstdint> - #include <i18nlangtag/mslangid.hxx> #include <officecfg/Office/Common.hxx> #include <vcl/outdev.hxx> @@ -33,6 +30,7 @@ #include <com/sun/star/i18n/WordType.hpp> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <breakit.hxx> +#include <config_fuzzers.h> #include <paintfrm.hxx> #include <viewsh.hxx> #include <viewopt.hxx> @@ -58,6 +56,8 @@ #include <fntcap.hxx> #include <vcl/outdev/ScopedStates.hxx> #include <o3tl/hash_combine.hxx> +#include <cstdint> +#include <memory> 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<SalLayout> 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; |