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

Khaled Hosny khaledhosny at eglug.org
Sat Nov 5 12:27:18 UTC 2016


 sw/source/core/text/itrform2.cxx |   35 ++++++++---------------------------
 1 file changed, 8 insertions(+), 27 deletions(-)

New commits:
commit c1cb0fe8c5e36ff2d08f5eb2d91a7652b03f4b66
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Nov 5 14:22:54 2016 +0200

    Bin pointless #ifdef’s
    
    Since we enable Graphite by default, this code was effectively setting
    nMaxContext to 8 on macOS and 10 everywhere else. Does not look like a
    huge difference, and an unnecessary one even since we use the same
    layout engine everywhere now.
    
    Change-Id: I6d2cc3a89ed2942c09e62f7637cec5b6db753a24

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 73de089..4e315b7 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -60,8 +60,6 @@
 
 #include <vector>
 
-#include <config_graphite.h>
-
 #if OSL_DEBUG_LEVEL > 1
 #include <ndtxt.hxx>
 #endif
@@ -2711,34 +2709,17 @@ namespace {
             // step back two positions for smoother repaint
             nReformat -= 2;
 
-    #ifndef MACOSX
-    #if ! ENABLE_GRAPHITE
             // i#28795, i#34607, i#38388
-            // step back six(!) more characters for complex scripts
-            // this is required e.g., for Khmer (thank you, Javier!)
-            const SwScriptInfo& rSI = txtFormatInfo.GetParaPortion()->GetScriptInfo();
-            sal_Int32 nMaxContext = 0;
-            if( ::i18n::ScriptType::COMPLEX == rSI.ScriptType( nReformat ) )
-                nMaxContext = 6;
-    #else
-            // Some Graphite fonts need context for scripts not marked as complex
+            // step back more characters, this is required by complex scripts
+            // e.g., for Khmer (thank you, Javier!)
             static const sal_Int32 nMaxContext = 10;
-    #endif
-    #else
-            // some fonts like Quartz's Zapfino need more context
-            // TODO: query FontInfo for maximum unicode context
-            static const sal_Int32 nMaxContext = 8;
-    #endif
-            if( nMaxContext > 0 )
+            if (nReformat > txtFormatInfo.GetLineStart() + nMaxContext)
+                nReformat = nReformat - nMaxContext;
+            else
             {
-                if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext )
-                    nReformat = nReformat - nMaxContext;
-                else
-                {
-                    nReformat = txtFormatInfo.GetLineStart();
-                    //reset the margin flag - prevent loops
-                    SwTextCursor::SetRightMargin(false);
-                }
+                nReformat = txtFormatInfo.GetLineStart();
+                //reset the margin flag - prevent loops
+                SwTextCursor::SetRightMargin(false);
             }
 
             // Weird situation: Our line used to end with a hole portion


More information about the Libreoffice-commits mailing list