From c1cb0fe8c5e36ff2d08f5eb2d91a7652b03f4b66 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 5 Nov 2016 14:22:54 +0200 Subject: Bin pointless #ifdef’s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sw/source/core/text/itrform2.cxx | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 73de089afe56..4e315b731274 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -60,8 +60,6 @@ #include -#include - #if OSL_DEBUG_LEVEL > 1 #include #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 -- cgit v1.2.3