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
This commit is contained in:
Khaled Hosny
2016-11-05 14:22:54 +02:00
parent 60762db525
commit c1cb0fe8c5

View File

@@ -60,8 +60,6 @@
#include <vector> #include <vector>
#include <config_graphite.h>
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
#include <ndtxt.hxx> #include <ndtxt.hxx>
#endif #endif
@@ -2711,34 +2709,17 @@ namespace {
// step back two positions for smoother repaint // step back two positions for smoother repaint
nReformat -= 2; nReformat -= 2;
#ifndef MACOSX
#if ! ENABLE_GRAPHITE
// i#28795, i#34607, i#38388 // i#28795, i#34607, i#38388
// step back six(!) more characters for complex scripts // step back more characters, this is required by complex scripts
// this is required e.g., for Khmer (thank you, Javier!) // 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
static const sal_Int32 nMaxContext = 10; static const sal_Int32 nMaxContext = 10;
#endif if (nReformat > txtFormatInfo.GetLineStart() + nMaxContext)
#else nReformat = nReformat - nMaxContext;
// some fonts like Quartz's Zapfino need more context else
// TODO: query FontInfo for maximum unicode context
static const sal_Int32 nMaxContext = 8;
#endif
if( nMaxContext > 0 )
{ {
if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext ) nReformat = txtFormatInfo.GetLineStart();
nReformat = nReformat - nMaxContext; //reset the margin flag - prevent loops
else 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 // Weird situation: Our line used to end with a hole portion