[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 5 20:14:10 UTC 2021


 sw/source/core/txtnode/fntcache.cxx |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit b35b1dca3a734739a9780c17331b8368d7df7657
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 5 09:07:23 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 5 22:13:37 2021 +0200

    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 at redhat.com>

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;
 


More information about the Libreoffice-commits mailing list