Files
libreoffice/sw/source/core/text/porlay.cxx

2254 lines
75 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 23:08:29 +00:00
#include "porlay.hxx"
#include "itrform2.hxx"
#include "porglue.hxx"
#include "porexp.hxx"
#include <blink.hxx>
#include "redlnitr.hxx"
#include "porfly.hxx"
#include "porrst.hxx"
#include "pormulti.hxx"
#include "pordrop.hxx"
#include <breakit.hxx>
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#include <unicode/uchar.h>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/CTLScriptType.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <paratr.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/charhiddenitem.hxx>
#include <vcl/outdev.hxx>
#include <svl/asiancfg.hxx>
#include <editeng/blinkitem.hxx>
#include <tools/multisel.hxx>
#include <unotools/charclass.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <charfmt.hxx>
#include <fchrfmt.hxx>
#include <docary.hxx>
#include <redline.hxx>
#include <section.hxx>
#include <calbck.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentContentOperations.hxx>
using namespace ::com::sun::star;
using namespace i18n::ScriptType;
2000-09-18 23:08:29 +00:00
2002-03-21 08:19:43 +00:00
#include <unicode/ubidi.h>
#include <i18nutil/scripttypedetector.hxx>
#include <i18nutil/unicode.hxx>
2002-03-21 08:19:43 +00:00
#define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), UCHAR_JOINING_GROUP ) == U_JG_##g )
#define isAinChar(c) IS_JOINING_GROUP((c), AIN)
#define isAlefChar(c) IS_JOINING_GROUP((c), ALEF)
#define isDalChar(c) IS_JOINING_GROUP((c), DAL)
#if U_ICU_VERSION_MAJOR_NUM >= 58
#define isFehChar(c) (IS_JOINING_GROUP((c), FEH) || IS_JOINING_GROUP((c), AFRICAN_FEH))
#else
#define isFehChar(c) IS_JOINING_GROUP((c), FEH)
#endif
#define isGafChar(c) IS_JOINING_GROUP((c), GAF)
#define isHehChar(c) IS_JOINING_GROUP((c), HEH)
#define isKafChar(c) IS_JOINING_GROUP((c), KAF)
#define isLamChar(c) IS_JOINING_GROUP((c), LAM)
#if U_ICU_VERSION_MAJOR_NUM >= 58
#define isQafChar(c) (IS_JOINING_GROUP((c), QAF) || IS_JOINING_GROUP((c), AFRICAN_QAF))
#else
#define isQafChar(c) IS_JOINING_GROUP((c), QAF)
#endif
#define isRehChar(c) IS_JOINING_GROUP((c), REH)
#define isTahChar(c) IS_JOINING_GROUP((c), TAH)
#define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
#define isWawChar(c) IS_JOINING_GROUP((c), WAW)
#define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN))
// Beh and charters that behave like Beh in medial form.
bool isBehChar(sal_Unicode cCh)
{
bool bRet = false;
switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
{
case U_JG_BEH:
case U_JG_NOON:
#if U_ICU_VERSION_MAJOR_NUM >= 58
case U_JG_AFRICAN_NOON:
#endif
case U_JG_NYA:
case U_JG_YEH:
case U_JG_FARSI_YEH:
case U_JG_BURUSHASKI_YEH_BARREE:
bRet = true;
break;
default:
bRet = false;
break;
}
return bRet;
}
// Yeh and charters that behave like Yeh in final form.
bool isYehChar(sal_Unicode cCh)
{
bool bRet = false;
switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
{
case U_JG_YEH:
case U_JG_FARSI_YEH:
case U_JG_YEH_BARREE:
case U_JG_BURUSHASKI_YEH_BARREE:
case U_JG_YEH_WITH_TAIL:
bRet = true;
break;
default:
bRet = false;
break;
}
return bRet;
}
bool isTransparentChar ( sal_Unicode cCh )
{
return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT;
}
// Checks if cCh + cNectCh builds a ligature (used for Kashidas)
static bool lcl_IsLigature( sal_Unicode cCh, sal_Unicode cNextCh )
{
// Lam + Alef
return ( isLamChar ( cCh ) && isAlefChar ( cNextCh ));
}
// Checks if cCh is connectable to cPrevCh (used for Kashidas)
static bool lcl_ConnectToPrev( sal_Unicode cCh, sal_Unicode cPrevCh )
{
const int32_t nJoiningType = u_getIntPropertyValue( cPrevCh, UCHAR_JOINING_TYPE );
bool bRet = nJoiningType != U_JT_RIGHT_JOINING && nJoiningType != U_JT_NON_JOINING;
2002-03-21 08:19:43 +00:00
// check for ligatures cPrevChar + cChar
if( bRet )
bRet = !lcl_IsLigature( cPrevCh, cCh );
return bRet;
}
2002-03-21 08:19:43 +00:00
static bool lcl_HasStrongLTR ( const OUString& rText, sal_Int32 nStart, sal_Int32 nEnd )
{
for( sal_Int32 nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
{
const UCharDirection nCharDir = u_charDirection ( rText[ nCharIdx ] );
if ( nCharDir == U_LEFT_TO_RIGHT ||
nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
return true;
}
return false;
}
2002-03-21 08:19:43 +00:00
// class SwLineLayout: This is the layout of a single line, which is made
// up of its dimension, the character count and the word spacing in the line.
// Line objects are managed in an own pool, in order to store them continuously
// in memory so that they are paged out together and don't fragment memory.
2000-09-18 23:08:29 +00:00
SwLineLayout::~SwLineLayout()
{
Truncate();
delete m_pNext;
2000-09-18 23:08:29 +00:00
if( pBlink )
pBlink->Delete( this );
delete m_pLLSpaceAdd;
delete m_pKanaComp;
2000-09-18 23:08:29 +00:00
}
SwLinePortion *SwLineLayout::Insert( SwLinePortion *pIns )
{
// First attribute change: copy mass and length from *pIns into the first
// text portion
2000-09-18 23:08:29 +00:00
if( !pPortion )
{
if( GetLen() )
{
pPortion = SwTextPortion::CopyLinePortion(*this);
2000-09-18 23:08:29 +00:00
if( IsBlinking() && pBlink )
{
SetBlinking( false );
2000-09-18 23:08:29 +00:00
pBlink->Replace( this, pPortion );
}
}
else
{
SetPortion( pIns );
return pIns;
}
}
// Call with scope or we'll end up with recursion!
2000-09-18 23:08:29 +00:00
return pPortion->SwLinePortion::Insert( pIns );
}
SwLinePortion *SwLineLayout::Append( SwLinePortion *pIns )
{
// First attribute change: copy mass and length from *pIns into the first
// text portion
2000-09-18 23:08:29 +00:00
if( !pPortion )
pPortion = SwTextPortion::CopyLinePortion(*this);
// Call with scope or we'll end up with recursion!
2000-09-18 23:08:29 +00:00
return pPortion->SwLinePortion::Append( pIns );
}
// For special treatment of empty lines
2000-09-18 23:08:29 +00:00
bool SwLineLayout::Format( SwTextFormatInfo &rInf )
2000-09-18 23:08:29 +00:00
{
if( GetLen() )
return SwTextPortion::Format( rInf );
Height( rInf.GetTextHeight() );
return true;
2000-09-18 23:08:29 +00:00
}
// We collect all FlyPortions at the beginning of the line and make that a
// MarginPortion.
2000-09-18 23:08:29 +00:00
SwMarginPortion *SwLineLayout::CalcLeftMargin()
{
SwMarginPortion *pLeft = (GetPortion() && GetPortion()->IsMarginPortion()) ?
static_cast<SwMarginPortion *>(GetPortion()) : nullptr;
2000-09-18 23:08:29 +00:00
if( !GetPortion() )
SetPortion(SwTextPortion::CopyLinePortion(*this));
2000-09-18 23:08:29 +00:00
if( !pLeft )
{
pLeft = new SwMarginPortion;
2000-09-18 23:08:29 +00:00
pLeft->SetPortion( GetPortion() );
SetPortion( pLeft );
}
else
{
pLeft->Height( 0 );
pLeft->Width( 0 );
pLeft->SetLen( 0 );
pLeft->SetAscent( 0 );
pLeft->SetPortion( nullptr );
2000-09-18 23:08:29 +00:00
pLeft->SetFixWidth(0);
}
SwLinePortion *pPos = pLeft->GetPortion();
while( pPos )
{
if( pPos->IsFlyPortion() )
{
// The FlyPortion get's sucked out ...
pLeft->Join( static_cast<SwGluePortion*>(pPos) );
2000-09-18 23:08:29 +00:00
pPos = pLeft->GetPortion();
if( GetpKanaComp() && !GetKanaComp().empty() )
GetKanaComp().pop_front();
2000-09-18 23:08:29 +00:00
}
else
pPos = nullptr;
2000-09-18 23:08:29 +00:00
}
return pLeft;
}
void SwLineLayout::InitSpaceAdd()
{
if ( !m_pLLSpaceAdd )
CreateSpaceAdd();
else
SetLLSpaceAdd( 0, 0 );
}
void SwLineLayout::CreateSpaceAdd( const long nInit )
2000-09-18 23:08:29 +00:00
{
m_pLLSpaceAdd = new std::vector<long>;
SetLLSpaceAdd( nInit, 0 );
2000-09-18 23:08:29 +00:00
}
// Returns true if there are only blanks in [nStt, nEnd[
static bool lcl_HasOnlyBlanks( const OUString& rText, sal_Int32 nStt, sal_Int32 nEnd )
{
bool bBlankOnly = true;
while ( nStt < nEnd )
{
const sal_Unicode cChar = rText[ nStt++ ];
if ( ' ' != cChar && 0x3000 != cChar )
{
bBlankOnly = false;
break;
}
}
return bBlankOnly;
}
// Swapped out from FormatLine()
void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
2000-09-18 23:08:29 +00:00
{
const sal_uInt16 nLineWidth = rInf.RealWidth();
2000-09-18 23:08:29 +00:00
sal_uInt16 nFlyAscent = 0;
sal_uInt16 nFlyHeight = 0;
sal_uInt16 nFlyDescent = 0;
bool bOnlyPostIts = true;
SetHanging( false );
2000-09-18 23:08:29 +00:00
bool bTmpDummy = !GetLen();
SwFlyCntPortion* pFlyCnt = nullptr;
2000-09-18 23:08:29 +00:00
if( bTmpDummy )
{
nFlyAscent = 0;
nFlyHeight = 0;
nFlyDescent = 0;
}
// #i3952#
const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
bool bHasBlankPortion = false;
bool bHasOnlyBlankPortions = true;
2000-09-18 23:08:29 +00:00
if( pPortion )
{
SetContent( false );
2000-09-18 23:08:29 +00:00
if( pPortion->IsBreakPortion() )
{
SetLen( pPortion->GetLen() );
if( GetLen() )
bTmpDummy = false;
2000-09-18 23:08:29 +00:00
}
else
{
const sal_uInt16 nLineHeight = Height();
2000-09-18 23:08:29 +00:00
Init( GetPortion() );
SwLinePortion *pPos = pPortion;
SwLinePortion *pLast = this;
sal_uInt16 nMaxDescent = 0;
2000-09-18 23:08:29 +00:00
// A group is a segment in the portion chain of pCurr or a fixed
// portion spanning to the end or the next fixed portion
2000-09-18 23:08:29 +00:00
while( pPos )
{
SAL_WARN_IF( POR_LIN == pPos->GetWhichPor(),
"sw.core", "SwLineLayout::CalcLine: don't use SwLinePortions !" );
// Null portions are eliminated. They can form if two FlyFrames
// overlap.
2000-09-18 23:08:29 +00:00
if( !pPos->Compress() )
{
// Only take over Height and Ascent if the rest of the line
// is empty.
2000-09-18 23:08:29 +00:00
if( !pPos->GetPortion() )
{
if( !Height() )
Height( pPos->Height() );
if( !GetAscent() )
SetAscent( pPos->GetAscent() );
}
delete pLast->Cut( pPos );
pPos = pLast->GetPortion();
continue;
}
const sal_Int32 nPorSttIdx = rInf.GetLineStart() + nLineLength;
nLineLength += pPos->GetLen();
AddPrtWidth( pPos->Width() );
// #i3952#
if ( bIgnoreBlanksAndTabsForLineHeightCalculation )
{
if ( pPos->InTabGrp() || pPos->IsHolePortion() ||
( pPos->IsTextPortion() &&
lcl_HasOnlyBlanks( rInf.GetText(), nPorSttIdx, nPorSttIdx + pPos->GetLen() ) ) )
{
pLast = pPos;
pPos = pPos->GetPortion();
bHasBlankPortion = true;
continue;
}
}
// Ignore drop portion height
if( pPos->IsDropPortion() && static_cast<SwDropPortion*>(pPos)->GetLines() > 1)
{
pLast = pPos;
pPos = pPos->GetPortion();
continue;
}
bHasOnlyBlankPortions = false;
// We had an attribute change: Sum up/build maxima of length and mass
2000-09-18 23:08:29 +00:00
sal_uInt16 nPosHeight = pPos->Height();
sal_uInt16 nPosAscent = pPos->GetAscent();
2000-09-18 23:08:29 +00:00
SAL_WARN_IF( nPosHeight < nPosAscent,
"sw.core", "SwLineLayout::CalcLine: bad ascent or height" );
2000-11-21 10:29:48 +00:00
if( pPos->IsHangingPortion() )
{
SetHanging();
rInf.GetParaPortion()->SetMargin();
2000-11-21 10:29:48 +00:00
}
2000-09-18 23:08:29 +00:00
// To prevent that a paragraph-end-character does not change
// the line height through a Descent and thus causing the line
// to reformat.
2000-09-18 23:08:29 +00:00
if ( !pPos->IsBreakPortion() || !Height() )
{
if (!pPos->IsPostItsPortion()) bOnlyPostIts = false;
2000-09-18 23:08:29 +00:00
if( bTmpDummy && !nLineLength )
{
if( pPos->IsFlyPortion() )
{
if( nFlyHeight < nPosHeight )
nFlyHeight = nPosHeight;
if( nFlyAscent < nPosAscent )
nFlyAscent = nPosAscent;
if( nFlyDescent < nPosHeight - nPosAscent )
nFlyDescent = nPosHeight - nPosAscent;
}
else
{
if( pPos->InNumberGrp() )
{
sal_uInt16 nTmp = rInf.GetFont()->GetAscent(
rInf.GetVsh(), *rInf.GetOut() );
2000-09-18 23:08:29 +00:00
if( nTmp > nPosAscent )
{
nPosHeight += nTmp - nPosAscent;
nPosAscent = nTmp;
}
nTmp = rInf.GetFont()->GetHeight( rInf.GetVsh(),
*rInf.GetOut() );
2000-09-18 23:08:29 +00:00
if( nTmp > nPosHeight )
nPosHeight = nTmp;
}
Height( nPosHeight );
nAscent = nPosAscent;
nMaxDescent = nPosHeight - nPosAscent;
}
}
else if( !pPos->IsFlyPortion() )
{
if( Height() < nPosHeight )
{
// Height is set to 0 when Init() is called.
if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->GetWhichPor() == POR_FLYCNT)
// Compat flag set: take the line height, if it's larger.
Height(std::max(nPosHeight, nLineHeight));
else
// Just care about the portion height.
Height(nPosHeight);
}
SwFlyCntPortion* pAsFly(nullptr);
if(pPos->IsFlyCntPortion())
pAsFly = static_cast<SwFlyCntPortion*>(pPos);
if( pAsFly || ( pPos->IsMultiPortion()
&& static_cast<SwMultiPortion*>(pPos)->HasFlyInContent() ) )
2000-09-18 23:08:29 +00:00
rLine.SetFlyInCntBase();
if(pAsFly && pAsFly->GetAlign() != sw::LineAlign::NONE)
2000-09-18 23:08:29 +00:00
{
pAsFly->SetMax(false);
2000-09-18 23:08:29 +00:00
if( !pFlyCnt || pPos->Height() > pFlyCnt->Height() )
pFlyCnt = pAsFly;
2000-09-18 23:08:29 +00:00
}
else
{
if( nAscent < nPosAscent )
nAscent = nPosAscent;
if( nMaxDescent < nPosHeight - nPosAscent )
nMaxDescent = nPosHeight - nPosAscent;
}
}
}
else if( pPos->GetLen() )
bTmpDummy = false;
if( !HasContent() && !pPos->InNumberGrp() )
2000-09-18 23:08:29 +00:00
{
if ( pPos->InExpGrp() )
{
OUString aText;
if( pPos->GetExpText( rInf, aText ) && !aText.isEmpty() )
SetContent();
2000-09-18 23:08:29 +00:00
}
else if( ( pPos->InTextGrp() || pPos->IsMultiPortion() ) &&
pPos->GetLen() )
SetContent();
2000-09-18 23:08:29 +00:00
}
bTmpDummy &= !HasContent() && ( !pPos->Width() || pPos->IsFlyPortion() );
2000-09-18 23:08:29 +00:00
pLast = pPos;
pPos = pPos->GetPortion();
}
2000-09-18 23:08:29 +00:00
if( pFlyCnt )
{
if( pFlyCnt->Height() == Height() )
{
pFlyCnt->SetMax( true );
2000-09-18 23:08:29 +00:00
if( Height() > nMaxDescent + nAscent )
{
if( sw::LineAlign::BOTTOM == pFlyCnt->GetAlign() )
2000-09-18 23:08:29 +00:00
nAscent = Height() - nMaxDescent;
else if( sw::LineAlign::CENTER == pFlyCnt->GetAlign() )
2000-09-18 23:08:29 +00:00
nAscent = ( Height() + nAscent - nMaxDescent ) / 2;
}
pFlyCnt->SetAscent( nAscent );
}
}
2000-09-18 23:08:29 +00:00
if( bTmpDummy && nFlyHeight )
{
nAscent = nFlyAscent;
if( nFlyDescent > nFlyHeight - nFlyAscent )
Height( nFlyHeight + nFlyDescent );
else
Height( nFlyHeight );
}
else if( nMaxDescent > Height() - nAscent )
Height( nMaxDescent + nAscent );
if( bOnlyPostIts && !( bHasBlankPortion && bHasOnlyBlankPortions ) )
2000-09-18 23:08:29 +00:00
{
Height( rInf.GetFont()->GetHeight( rInf.GetVsh(), *rInf.GetOut() ) );
nAscent = rInf.GetFont()->GetAscent( rInf.GetVsh(), *rInf.GetOut() );
2000-09-18 23:08:29 +00:00
}
}
}
else
{
SetContent( !bTmpDummy );
// #i3952#
if ( bIgnoreBlanksAndTabsForLineHeightCalculation &&
lcl_HasOnlyBlanks( rInf.GetText(), rInf.GetLineStart(), rInf.GetLineStart() + GetLen() ) )
{
bHasBlankPortion = true;
}
}
// #i3952#
if ( bHasBlankPortion && bHasOnlyBlankPortions )
{
sal_uInt16 nTmpAscent = GetAscent();
sal_uInt16 nTmpHeight = Height();
rLine.GetAttrHandler().GetDefaultAscentAndHeight( rInf.GetVsh(), *rInf.GetOut(), nTmpAscent, nTmpHeight );
SetAscent( nTmpAscent );
Height( nTmpHeight );
}
2000-09-18 23:08:29 +00:00
// Robust:
if( nLineWidth < Width() )
Width( nLineWidth );
SAL_WARN_IF( nLineWidth < Width(), "sw.core", "SwLineLayout::CalcLine: line is bursting" );
2000-09-18 23:08:29 +00:00
SetDummy( bTmpDummy );
SetRedline( rLine.GetRedln() &&
rLine.GetRedln()->CheckLine( rLine.GetStart(), rLine.GetEnd() ) );
}
// #i47162# - add optional parameter <_bNoFlyCntPorAndLinePor>
// to control, if the fly content portions and line portion are considered.
void SwLineLayout::MaxAscentDescent( SwTwips& _orAscent,
SwTwips& _orDescent,
SwTwips& _orObjAscent,
SwTwips& _orObjDescent,
const SwLinePortion* _pDontConsiderPortion,
const bool _bNoFlyCntPorAndLinePor ) const
{
_orAscent = 0;
_orDescent = 0;
_orObjAscent = 0;
_orObjDescent = 0;
const SwLinePortion* pTmpPortion = this;
if ( !pTmpPortion->GetLen() && pTmpPortion->GetPortion() )
{
pTmpPortion = pTmpPortion->GetPortion();
}
while ( pTmpPortion )
{
if ( !pTmpPortion->IsBreakPortion() && !pTmpPortion->IsFlyPortion() &&
( !_bNoFlyCntPorAndLinePor ||
( !pTmpPortion->IsFlyCntPortion() &&
!(pTmpPortion == this && pTmpPortion->GetPortion() ) ) ) )
{
SwTwips nPortionAsc = static_cast<SwTwips>(pTmpPortion->GetAscent());
SwTwips nPortionDesc = static_cast<SwTwips>(pTmpPortion->Height()) -
nPortionAsc;
const bool bFlyCmp = pTmpPortion->IsFlyCntPortion() ?
static_cast<const SwFlyCntPortion*>(pTmpPortion)->IsMax() :
!( pTmpPortion == _pDontConsiderPortion );
if ( bFlyCmp )
{
_orObjAscent = std::max( _orObjAscent, nPortionAsc );
_orObjDescent = std::max( _orObjDescent, nPortionDesc );
}
if ( !pTmpPortion->IsFlyCntPortion() && !pTmpPortion->IsGrfNumPortion() )
{
_orAscent = std::max( _orAscent, nPortionAsc );
_orDescent = std::max( _orDescent, nPortionDesc );
}
}
pTmpPortion = pTmpPortion->GetPortion();
}
}
void SwLineLayout::ResetFlags()
{
m_bFormatAdj = m_bDummy = m_bEndHyph = m_bMidHyph = m_bFly
= m_bRest = m_bBlinking = m_bClipping = m_bContent = m_bRedline
= m_bForcedLeftMargin = m_bHanging = false;
}
SwLineLayout::SwLineLayout()
: m_pNext( nullptr ), m_pLLSpaceAdd( nullptr ), m_pKanaComp( nullptr ), m_nRealHeight( 0 ),
m_bUnderscore( false )
{
ResetFlags();
SetWhichPor( POR_LAY );
}
SwLinePortion *SwLineLayout::GetFirstPortion() const
{
const SwLinePortion *pRet = pPortion ? pPortion : this;
return const_cast<SwLinePortion*>(pRet);
}
2000-09-18 23:08:29 +00:00
SwCharRange &SwCharRange::operator+=(const SwCharRange &rRange)
{
if(0 != rRange.nLen ) {
if(0 == nLen) {
nStart = rRange.nStart;
nLen = rRange.nLen ;
}
else {
if(rRange.nStart + rRange.nLen > nStart + nLen) {
nLen = rRange.nStart + rRange.nLen - nStart;
}
if(rRange.nStart < nStart) {
nLen += nStart - rRange.nStart;
nStart = rRange.nStart;
}
}
}
return *this;
}
SwScriptInfo::SwScriptInfo()
: nInvalidityPos(0)
, nDefaultDir(0)
{
};
SwScriptInfo::~SwScriptInfo()
{
}
// Converts i18n Script Type (LATIN, ASIAN, COMPLEX, WEAK) to
// Sw Script Types (SwFontScript::Latin, SwFontScript::CJK, SwFontScript::CTL), used to identify the font
SwFontScript SwScriptInfo::WhichFont( sal_Int32 nIdx, const OUString* pText, const SwScriptInfo* pSI )
{
assert((pSI || pText) && "How should I determine the script type?");
const sal_uInt16 nScript = pSI
? pSI->ScriptType( nIdx ) // use our SwScriptInfo if available
: g_pBreakIt->GetRealScriptOfText( *pText, nIdx ); // else ask the break iterator
switch ( nScript ) {
case i18n::ScriptType::LATIN : return SwFontScript::Latin;
case i18n::ScriptType::ASIAN : return SwFontScript::CJK;
case i18n::ScriptType::COMPLEX : return SwFontScript::CTL;
}
OSL_FAIL( "Somebody tells lies about the script type!" );
return SwFontScript::Latin;
}
// searches for script changes in rText and stores them
void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode )
{
InitScriptInfo( rNode, nDefaultDir == UBIDI_RTL );
}
void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
{
assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
const OUString& rText = rNode.GetText();
// HIDDEN TEXT INFORMATION
Range aRange( 0, !rText.isEmpty() ? rText.getLength() - 1 : 0 );
MultiSelection aHiddenMulti( aRange );
CalcHiddenRanges( rNode, aHiddenMulti );
2010-10-05 20:01:23 +02:00
aHiddenChg.clear();
for( size_t i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
const sal_Int32 nStart = rRange.Min();
const sal_Int32 nEnd = rRange.Max() + 1;
2010-10-05 20:01:23 +02:00
aHiddenChg.push_back( nStart );
aHiddenChg.push_back( nEnd );
}
// SCRIPT AND SCRIPT RELATED INFORMATION
sal_Int32 nChg = nInvalidityPos;
// COMPLETE_STRING means the data structure is up to date
nInvalidityPos = COMPLETE_STRING;
// this is the default direction
nDefaultDir = static_cast<sal_uInt8>(bRTL ? UBIDI_RTL : UBIDI_LTR);
// counter for script info arrays
size_t nCnt = 0;
// counter for compression information arrays
size_t nCntComp = 0;
// counter for kashida array
size_t nCntKash = 0;
sal_Int16 nScript = i18n::ScriptType::LATIN;
// compression type
const CharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType();
// justification type
const bool bAdjustBlock = SvxAdjust::Block ==
rNode.GetSwAttrSet().GetAdjust().GetAdjust();
// FIND INVALID RANGES IN SCRIPT INFO ARRAYS:
2001-04-09 09:44:17 +00:00
if( nChg )
{
// if change position = 0 we do not use any data from the arrays
// because by deleting all characters of the first group at the beginning
// of a paragraph nScript is set to a wrong value
SAL_WARN_IF( !CountScriptChg(), "sw.core", "Where're my changes of script?" );
while( nCnt < CountScriptChg() )
{
if ( nChg > GetScriptChg( nCnt ) )
nCnt++;
else
{
nScript = GetScriptType( nCnt );
break;
}
}
if( CharCompressType::NONE != aCompEnum )
2001-04-09 09:44:17 +00:00
{
while( nCntComp < CountCompChg() )
{
if ( nChg <= GetCompStart( nCntComp ) )
break;
nCntComp++;
2001-04-09 09:44:17 +00:00
}
}
if ( bAdjustBlock )
{
while( nCntKash < CountKashida() )
{
if ( nChg <= GetKashida( nCntKash ) )
break;
nCntKash++;
}
}
}
2002-03-21 08:19:43 +00:00
// ADJUST nChg VALUE:
// by stepping back one position we know that we are inside a group
// declared as an nScript group
if ( nChg )
--nChg;
const sal_Int32 nGrpStart = nCnt ? GetScriptChg( nCnt - 1 ) : 0;
// we go back in our group until we reach the first character of
// type nScript
while ( nChg > nGrpStart &&
nScript != g_pBreakIt->GetBreakIter()->getScriptType( rText, nChg ) )
--nChg;
// If we are at the start of a group, we do not trust nScript,
// we better get nScript from the breakiterator:
if ( nChg == nGrpStart )
nScript = (sal_uInt8)g_pBreakIt->GetBreakIter()->getScriptType( rText, nChg );
// INVALID DATA FROM THE SCRIPT INFO ARRAYS HAS TO BE DELETED:
// remove invalid entries from script information arrays
aScriptChanges.erase( aScriptChanges.begin() + nCnt, aScriptChanges.end() );
// get the start of the last compression group
sal_Int32 nLastCompression = nChg;
if( nCntComp )
{
--nCntComp;
nLastCompression = GetCompStart( nCntComp );
if( nChg >= nLastCompression + GetCompLen( nCntComp ) )
{
nLastCompression = nChg;
++nCntComp;
}
}
// remove invalid entries from compression information arrays
aCompressionChanges.erase(aCompressionChanges.begin() + nCntComp, aCompressionChanges.end() );
// get the start of the last kashida group
sal_Int32 nLastKashida = nChg;
if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
{
--nCntKash;
nLastKashida = GetKashida( nCntKash );
}
// remove invalid entries from kashida array
aKashida.erase( aKashida.begin() + nCntKash, aKashida.end() );
// TAKE CARE OF WEAK CHARACTERS: WE MUST FIND AN APPROPRIATE
// SCRIPT FOR WEAK CHARACTERS AT THE BEGINNING OF A PARAGRAPH
if( WEAK == g_pBreakIt->GetBreakIter()->getScriptType( rText, nChg ) )
{
// If the beginning of the current group is weak, this means that
// all of the characters in this group are weak. We have to assign
// the scripts to these characters depending on the fonts which are
// set for these characters to display them.
sal_Int32 nEnd =
g_pBreakIt->GetBreakIter()->endOfScript( rText, nChg, WEAK );
if (nEnd > rText.getLength() || nEnd < 0)
nEnd = rText.getLength();
nScript = SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() );
SAL_WARN_IF( i18n::ScriptType::LATIN != nScript &&
i18n::ScriptType::ASIAN != nScript &&
i18n::ScriptType::COMPLEX != nScript, "sw.core", "Wrong default language" );
nChg = nEnd;
// Get next script type or set to weak in order to exit
sal_uInt8 nNextScript = ( nEnd < rText.getLength() ) ?
(sal_uInt8)g_pBreakIt->GetBreakIter()->getScriptType( rText, nEnd ) :
(sal_uInt8)WEAK;
if ( nScript != nNextScript )
{
aScriptChanges.emplace_back(nEnd, nScript );
nCnt++;
nScript = nNextScript;
}
}
// UPDATE THE SCRIPT INFO ARRAYS:
2002-03-21 08:19:43 +00:00
while ( nChg < rText.getLength() || ( aScriptChanges.empty() && rText.isEmpty() ) )
{
SAL_WARN_IF( i18n::ScriptType::WEAK == nScript,
"sw.core", "Inserting WEAK into SwScriptInfo structure" );
sal_Int32 nSearchStt = nChg;
nChg = g_pBreakIt->GetBreakIter()->endOfScript( rText, nSearchStt, nScript );
if (nChg > rText.getLength() || nChg < 0)
nChg = rText.getLength();
// #i28203#
// for 'complex' portions, we make sure that a portion does not contain more
// than one script:
if( i18n::ScriptType::COMPLEX == nScript )
{
const short nScriptType = ScriptTypeDetector::getCTLScriptType( rText, nSearchStt );
sal_Int32 nNextCTLScriptStart = nSearchStt;
short nCurrentScriptType = nScriptType;
while( css::i18n::CTLScriptType::CTL_UNKNOWN == nCurrentScriptType || nScriptType == nCurrentScriptType )
{
nNextCTLScriptStart = ScriptTypeDetector::endOfCTLScriptType( rText, nNextCTLScriptStart );
if( nNextCTLScriptStart >= rText.getLength() || nNextCTLScriptStart >= nChg )
break;
nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( rText, nNextCTLScriptStart );
}
nChg = std::min( nChg, nNextCTLScriptStart );
}
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
// special case for dotted circle since it can be used with complex
// before a mark, so we want it associated with the mark's script
if (nChg < rText.getLength() && nChg > 0 && (i18n::ScriptType::WEAK ==
g_pBreakIt->GetBreakIter()->getScriptType(rText,nChg - 1)))
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
{
int8_t nType = u_charType(rText[nChg] );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
nType == U_COMBINING_SPACING_MARK )
{
aScriptChanges.emplace_back(nChg-1, nScript );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
}
else
{
aScriptChanges.emplace_back(nChg, nScript );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
}
}
else
{
aScriptChanges.emplace_back(nChg, nScript );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
}
++nCnt;
2001-04-09 09:44:17 +00:00
// if current script is asian, we search for compressable characters
// in this range
if ( CharCompressType::NONE != aCompEnum &&
2001-04-09 09:44:17 +00:00
i18n::ScriptType::ASIAN == nScript )
{
CompType ePrevState = NONE;
CompType eState = NONE;
sal_Int32 nPrevChg = nLastCompression;
while ( nLastCompression < nChg )
2001-04-09 09:44:17 +00:00
{
sal_Unicode cChar = rText[ nLastCompression ];
2001-04-09 09:44:17 +00:00
// examine current character
switch ( cChar )
2001-04-09 09:44:17 +00:00
{
// Left punctuation found
case 0x3008: case 0x300A: case 0x300C: case 0x300E:
case 0x3010: case 0x3014: case 0x3016: case 0x3018:
case 0x301A: case 0x301D:
eState = SPECIAL_LEFT;
break;
// Right punctuation found
case 0x3009: case 0x300B:
case 0x300D: case 0x300F: case 0x3011: case 0x3015:
case 0x3017: case 0x3019: case 0x301B: case 0x301E:
case 0x301F:
eState = SPECIAL_RIGHT;
break;
case 0x3001: case 0x3002: // Fullstop or comma
eState = SPECIAL_MIDDLE ;
break;
default:
eState = ( 0x3040 <= cChar && 0x3100 > cChar ) ? KANA : NONE;
}
2001-04-09 09:44:17 +00:00
// insert range of compressable characters
if( ePrevState != eState )
{
if ( ePrevState != NONE )
2001-04-09 09:44:17 +00:00
{
// insert start and type
if ( CharCompressType::PunctuationAndKana == aCompEnum ||
ePrevState != KANA )
{
aCompressionChanges.emplace_back(nPrevChg, nLastCompression - nPrevChg, ePrevState );
}
2001-04-09 09:44:17 +00:00
}
ePrevState = eState;
nPrevChg = nLastCompression;
2001-04-09 09:44:17 +00:00
}
nLastCompression++;
}
// we still have to examine last entry
if ( ePrevState != NONE )
{
// insert start and type
if ( CharCompressType::PunctuationAndKana == aCompEnum ||
ePrevState != KANA )
2001-04-09 09:44:17 +00:00
{
aCompressionChanges.emplace_back(nPrevChg, nLastCompression - nPrevChg, ePrevState );
2001-04-09 09:44:17 +00:00
}
}
}
// we search for connecting opportunities (kashida)
else if ( bAdjustBlock && i18n::ScriptType::COMPLEX == nScript )
{
SwScanner aScanner( rNode, rNode.GetText(), nullptr, ModelToViewHelper(),
i18n::WordType::DICTIONARY_WORD,
nLastKashida, nChg );
// the search has to be performed on a per word base
while ( aScanner.NextWord() )
{
const OUString& rWord = aScanner.GetWord();
sal_Int32 nIdx = 0;
sal_Int32 nKashidaPos = -1;
sal_Unicode cCh;
sal_Unicode cPrevCh = 0;
int nPriorityLevel = 7; // 0..6 = level found
// 7 not found
sal_Int32 nWordLen = rWord.getLength();
// ignore trailing vowel chars
while( nWordLen && isTransparentChar( rWord[ nWordLen - 1 ] ))
--nWordLen;
while (nIdx < nWordLen)
{
cCh = rWord[ nIdx ];
// 1. Priority:
// after user inserted kashida
if ( 0x640 == cCh )
{
nKashidaPos = aScanner.GetBegin() + nIdx;
nPriorityLevel = 0;
}
// 2. Priority:
// after a Seen or Sad
if (nPriorityLevel >= 1 && nIdx < nWordLen - 1)
{
if( isSeenOrSadChar( cCh )
&& (rWord[ nIdx+1 ] != 0x200C) ) // #i98410#: prevent ZWNJ expansion
{
nKashidaPos = aScanner.GetBegin() + nIdx;
nPriorityLevel = 1;
}
}
// 3. Priority:
// before final form of Teh Marbuta, Heh, Dal
if ( nPriorityLevel >= 2 && nIdx > 0 )
{
if ( isTehMarbutaChar ( cCh ) || // Teh Marbuta (right joining)
isDalChar ( cCh ) || // Dal (right joining) final form may appear in the middle of word
( isHehChar ( cCh ) && nIdx == nWordLen - 1)) // Heh (dual joining) only at end of word
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
nKashidaPos = aScanner.GetBegin() + nIdx - 1;
nPriorityLevel = 2;
}
}
}
// 4. Priority:
// before final form of Alef, Tah, Lam, Kaf or Gaf
if ( nPriorityLevel >= 3 && nIdx > 0 )
{
if ( isAlefChar ( cCh ) || // Alef (right joining) final form may appear in the middle of word
(( isLamChar ( cCh ) || // Lam,
isTahChar ( cCh ) || // Tah,
isKafChar ( cCh ) || // Kaf (all dual joining)
isGafChar ( cCh ) )
&& nIdx == nWordLen - 1)) // only at end of word
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
nKashidaPos = aScanner.GetBegin() + nIdx - 1;
nPriorityLevel = 3;
}
}
}
// 5. Priority:
// before medial Beh-like
if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 1 )
{
if ( isBehChar ( cCh ) )
{
// check if next character is Reh or Yeh-like
sal_Unicode cNextCh = rWord[ nIdx + 1 ];
if ( isRehChar ( cNextCh ) || isYehChar ( cNextCh ))
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
nKashidaPos = aScanner.GetBegin() + nIdx - 1;
nPriorityLevel = 4;
}
}
}
}
// 6. Priority:
// before the final form of Waw, Ain, Qaf and Feh
if ( nPriorityLevel >= 5 && nIdx > 0 )
{
if ( isWawChar ( cCh ) || // Wav (right joining)
// final form may appear in the middle of word
(( isAinChar ( cCh ) || // Ain (dual joining)
isQafChar ( cCh ) || // Qaf (dual joining)
isFehChar ( cCh ) ) // Feh (dual joining)
&& nIdx == nWordLen - 1)) // only at end of word
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
nKashidaPos = aScanner.GetBegin() + nIdx - 1;
nPriorityLevel = 5;
}
}
}
// other connecting possibilities
if ( nPriorityLevel >= 6 && nIdx > 0 )
{
// Reh, Zain
if ( isRehChar ( cCh ) )
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
nKashidaPos = aScanner.GetBegin() + nIdx - 1;
nPriorityLevel = 6;
}
}
}
// Do not consider vowel marks when checking if a character
// can be connected to previous character.
if ( !isTransparentChar ( cCh) )
cPrevCh = cCh;
++nIdx;
} // end of current word
if ( -1 != nKashidaPos )
2010-10-05 20:01:23 +02:00
{
aKashida.insert( aKashida.begin() + nCntKash, nKashidaPos);
nCntKash++;
}
} // end of kashida search
}
2001-04-09 09:44:17 +00:00
if ( nChg < rText.getLength() )
nScript = (sal_uInt8)g_pBreakIt->GetBreakIter()->getScriptType( rText, nChg );
nLastCompression = nChg;
nLastKashida = nChg;
}
#if OSL_DEBUG_LEVEL > 0
// check kashida data
long nTmpKashidaPos = -1;
bool bWrongKash = false;
for (size_t i = 0; i < aKashida.size(); ++i )
{
long nCurrKashidaPos = GetKashida( i );
if ( nCurrKashidaPos <= nTmpKashidaPos )
{
bWrongKash = true;
break;
}
nTmpKashidaPos = nCurrKashidaPos;
}
SAL_WARN_IF( bWrongKash, "sw.core", "Kashida array contains wrong data" );
#endif
// remove invalid entries from direction information arrays
aDirectionChanges.clear();
// Perform Unicode Bidi Algorithm for text direction information
{
UpdateBidiInfo( rText );
// #i16354# Change script type for RTL text to CTL:
// 1. All text in RTL runs will use the CTL font
// #i89825# change the script type also to CTL (hennerdrewes)
// 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!)
for ( size_t nDirIdx = 0; nDirIdx < aDirectionChanges.size(); ++nDirIdx )
{
const sal_uInt8 nCurrDirType = GetDirType( nDirIdx );
// nStart is start of RTL run:
const sal_Int32 nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0;
// nEnd is end of RTL run:
const sal_Int32 nEnd = GetDirChg( nDirIdx );
if ( nCurrDirType % 2 == UBIDI_RTL || // text in RTL run
( nCurrDirType > UBIDI_LTR && !lcl_HasStrongLTR( rText, nStart, nEnd ) ) ) // non-strong text in embedded LTR run
{
// nScriptIdx points into the ScriptArrays:
2010-10-05 20:01:23 +02:00
size_t nScriptIdx = 0;
// Skip entries in ScriptArray which are not inside the RTL run:
// Make nScriptIdx become the index of the script group with
// 1. nStartPosOfGroup <= nStart and
// 2. nEndPosOfGroup > nStart
while ( GetScriptChg( nScriptIdx ) <= nStart )
++nScriptIdx;
const sal_Int32 nStartPosOfGroup = nScriptIdx ? GetScriptChg( nScriptIdx - 1 ) : 0;
const sal_uInt8 nScriptTypeOfGroup = GetScriptType( nScriptIdx );
SAL_WARN_IF( nStartPosOfGroup > nStart || GetScriptChg( nScriptIdx ) <= nStart,
"sw.core", "Script override with CTL font trouble" );
// Check if we have to insert a new script change at
// position nStart. If nStartPosOfGroup < nStart,
// we have to insert a new script change:
if ( nStart > 0 && nStartPosOfGroup < nStart )
{
aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
ScriptChangeInfo(nStart, nScriptTypeOfGroup) );
++nScriptIdx;
}
// Remove entries in ScriptArray which end inside the RTL run:
while ( nScriptIdx < aScriptChanges.size() && GetScriptChg( nScriptIdx ) <= nEnd )
{
aScriptChanges.erase(aScriptChanges.begin() + nScriptIdx);
}
// Insert a new entry in ScriptArray for the end of the RTL run:
aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
ScriptChangeInfo(nEnd, i18n::ScriptType::COMPLEX) );
#if OSL_DEBUG_LEVEL > 1
// Check that ScriptChangeInfos are in increasing order of
// position and that we don't have "empty" changes.
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101 Conflicts: starmath/inc/applicat.hxx starmath/inc/dialog.hxx starmath/inc/document.hxx starmath/inc/edit.hxx starmath/inc/format.hxx starmath/inc/node.hxx starmath/inc/parse.hxx starmath/inc/rect.hxx starmath/inc/smdll.hxx starmath/inc/smmod.hxx starmath/inc/starmath.hrc starmath/inc/symbol.hxx starmath/inc/toolbox.hxx starmath/inc/utility.hxx starmath/inc/view.hxx starmath/prj/build.lst starmath/qa/cppunit/version.map starmath/sdi/smslots.sdi starmath/source/accessibility.cxx starmath/source/cfgitem.cxx starmath/source/cfgitem.hxx starmath/source/config.cxx starmath/source/dialog.cxx starmath/source/document.cxx starmath/source/edit.cxx starmath/source/format.cxx starmath/source/makefile.mk starmath/source/math_pch.cxx starmath/source/mathmlexport.cxx starmath/source/mathmlimport.cxx starmath/source/mathtype.cxx starmath/source/node.cxx starmath/source/parse.cxx starmath/source/rect.cxx starmath/source/register.cxx starmath/source/smdetect.cxx starmath/source/smdll.cxx starmath/source/smmod.cxx starmath/source/smres.src starmath/source/symbol.cxx starmath/source/toolbox.cxx starmath/source/unomodel.cxx starmath/source/utility.cxx starmath/source/view.cxx sw/JunitTest_sw_unoapi.mk sw/Library_swd.mk sw/Makefile sw/inc/IDocumentFieldsAccess.hxx sw/inc/IDocumentSettingAccess.hxx sw/inc/IDocumentUndoRedo.hxx sw/inc/IShellCursorSupplier.hxx sw/inc/SwUndoField.hxx sw/inc/acmplwrd.hxx sw/inc/authfld.hxx sw/inc/bparr.hxx sw/inc/calbck.hxx sw/inc/calc.hxx sw/inc/ccoll.hxx sw/inc/cellatr.hxx sw/inc/cellfml.hxx sw/inc/chpfld.hxx sw/inc/cmdid.h sw/inc/crsrsh.hxx sw/inc/crstate.hxx sw/inc/dbfld.hxx sw/inc/dbmgr.hxx sw/inc/dcontact.hxx sw/inc/ddefld.hxx sw/inc/doc.hxx sw/inc/docary.hxx sw/inc/docsh.hxx sw/inc/docstat.hxx sw/inc/docstyle.hxx sw/inc/docufld.hxx sw/inc/editsh.hxx sw/inc/errhdl.hxx sw/inc/expfld.hxx sw/inc/fchrfmt.hxx sw/inc/fesh.hxx sw/inc/fldbas.hxx sw/inc/flddat.hxx sw/inc/flddropdown.hxx sw/inc/flypos.hxx sw/inc/fmtanchr.hxx sw/inc/fmtautofmt.hxx sw/inc/fmtclds.hxx sw/inc/fmtcnct.hxx sw/inc/fmtcol.hxx sw/inc/fmtfsize.hxx sw/inc/fmtftn.hxx sw/inc/fmtftntx.hxx sw/inc/fmthdft.hxx sw/inc/fmtinfmt.hxx sw/inc/fmtline.hxx sw/inc/fmtornt.hxx sw/inc/fmtpdsc.hxx sw/inc/fmtruby.hxx sw/inc/fmtsrnd.hxx sw/inc/fmturl.hxx sw/inc/fmtwrapinfluenceonobjpos.hxx sw/inc/format.hxx sw/inc/frmatr.hxx sw/inc/frmfmt.hxx sw/inc/grfatr.hxx sw/inc/helpid.h sw/inc/hintids.hxx sw/inc/hints.hxx sw/inc/htmltbl.hxx sw/inc/inetfld.hxx sw/inc/io.hxx sw/inc/iodetect.hxx sw/inc/itabenum.hxx sw/inc/ndarr.hxx sw/inc/ndgrf.hxx sw/inc/ndindex.hxx sw/inc/ndnotxt.hxx sw/inc/ndole.hxx sw/inc/ndtxt.hxx sw/inc/ndtyp.hxx sw/inc/node.hxx sw/inc/numrule.hxx sw/inc/pagedesc.hxx sw/inc/pagepreviewlayout.hxx sw/inc/pam.hxx sw/inc/paratr.hxx sw/inc/poolfmt.awk sw/inc/poolfmt.hxx sw/inc/printdata.hxx sw/inc/reffld.hxx sw/inc/shellio.hxx sw/inc/shellres.hxx sw/inc/swabstdlg.hxx sw/inc/swatrset.hxx sw/inc/swerror.h sw/inc/swprtopt.hxx sw/inc/swtable.hxx sw/inc/swtypes.hxx sw/inc/tblafmt.hxx sw/inc/tgrditem.hxx sw/inc/tox.hxx sw/inc/undobj.hxx sw/inc/unocoll.hxx sw/inc/unoframe.hxx sw/inc/unoprnms.hxx sw/inc/usrfld.hxx sw/inc/viewopt.hxx sw/inc/viewsh.hxx sw/inc/viscrs.hxx sw/prj/build.lst sw/qa/complex/accessibility/makefile.mk sw/qa/core/Test-BigPtrArray.cxx sw/qa/core/makefile.mk sw/sdi/makefile.mk sw/source/core/access/makefile.mk sw/source/core/access/textmarkuphelper.cxx sw/source/core/attr/calbck.cxx sw/source/core/attr/cellatr.cxx sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx sw/source/core/attr/format.cxx sw/source/core/attr/hints.cxx sw/source/core/bastyp/calc.cxx sw/source/core/bastyp/init.cxx sw/source/core/bastyp/makefile.mk sw/source/core/bastyp/swcache.cxx sw/source/core/crsr/bookmrk.cxx sw/source/core/crsr/callnk.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/findattr.cxx sw/source/core/crsr/findcoll.cxx sw/source/core/crsr/makefile.mk sw/source/core/crsr/pam.cxx sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/trvltbl.cxx sw/source/core/crsr/unocrsr.cxx sw/source/core/crsr/viscrs.cxx sw/source/core/doc/acmplwrd.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docbm.cxx sw/source/core/doc/doccomp.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docedt.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docftn.cxx sw/source/core/doc/docglbl.cxx sw/source/core/doc/docglos.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/docruby.cxx sw/source/core/doc/docsort.cxx sw/source/core/doc/docstat.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/fmtcol.cxx sw/source/core/doc/gctable.cxx sw/source/core/doc/htmltbl.cxx sw/source/core/doc/makefile.mk sw/source/core/doc/number.cxx sw/source/core/doc/poolfmt.cxx sw/source/core/doc/tblafmt.cxx sw/source/core/doc/tblcpy.cxx sw/source/core/doc/tblrwcl.cxx sw/source/core/docnode/makefile.mk sw/source/core/docnode/ndcopy.cxx sw/source/core/docnode/ndnum.cxx sw/source/core/docnode/ndsect.cxx sw/source/core/docnode/ndtbl.cxx sw/source/core/docnode/ndtbl1.cxx sw/source/core/docnode/node.cxx sw/source/core/docnode/node2lay.cxx sw/source/core/docnode/nodes.cxx sw/source/core/docnode/section.cxx sw/source/core/docnode/swbaslnk.cxx sw/source/core/draw/dcontact.cxx sw/source/core/draw/dflyobj.cxx sw/source/core/draw/drawdoc.cxx sw/source/core/draw/dview.cxx sw/source/core/draw/makefile.mk sw/source/core/edit/autofmt.cxx sw/source/core/edit/edattr.cxx sw/source/core/edit/eddel.cxx sw/source/core/edit/edfcol.cxx sw/source/core/edit/edfld.cxx sw/source/core/edit/edfldexp.cxx sw/source/core/edit/edfmt.cxx sw/source/core/edit/edglss.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/edit/ednumber.cxx sw/source/core/edit/edsect.cxx sw/source/core/edit/edtab.cxx sw/source/core/edit/edtox.cxx sw/source/core/edit/edundo.cxx sw/source/core/edit/makefile.mk sw/source/core/except/dbgloop.cxx sw/source/core/except/errhdl.cxx sw/source/core/fields/authfld.cxx sw/source/core/fields/cellfml.cxx sw/source/core/fields/chpfld.cxx sw/source/core/fields/dbfld.cxx sw/source/core/fields/ddefld.cxx sw/source/core/fields/ddetbl.cxx sw/source/core/fields/docufld.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/fldbas.cxx sw/source/core/fields/flddat.cxx sw/source/core/fields/flddropdown.cxx sw/source/core/fields/macrofld.cxx sw/source/core/fields/makefile.mk sw/source/core/fields/reffld.cxx sw/source/core/fields/scrptfld.cxx sw/source/core/fields/tblcalc.cxx sw/source/core/fields/usrfld.cxx sw/source/core/frmedt/fecopy.cxx sw/source/core/frmedt/fedesc.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/frmedt/feshview.cxx sw/source/core/frmedt/fetab.cxx sw/source/core/frmedt/fews.cxx sw/source/core/frmedt/makefile.mk sw/source/core/frmedt/tblsel.cxx sw/source/core/graphic/grfatr.cxx sw/source/core/inc/SwUndoFmt.hxx sw/source/core/inc/SwUndoTOXChange.hxx sw/source/core/inc/anchoredobjectposition.hxx sw/source/core/inc/dbgloop.hxx sw/source/core/inc/drawfont.hxx sw/source/core/inc/flowfrm.hxx sw/source/core/inc/frame.hxx sw/source/core/inc/frmtool.hxx sw/source/core/inc/layact.hxx sw/source/core/inc/layfrm.hxx sw/source/core/inc/notxtfrm.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/rootfrm.hxx sw/source/core/inc/scriptinfo.hxx sw/source/core/inc/swblocks.hxx sw/source/core/inc/swcache.hxx sw/source/core/inc/tabfrm.hxx sw/source/core/inc/txmsrt.hxx sw/source/core/inc/undoflystrattr.hxx sw/source/core/inc/viewimp.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/calcmove.cxx sw/source/core/layout/dbg_lay.cxx sw/source/core/layout/findfrm.cxx sw/source/core/layout/flowfrm.cxx sw/source/core/layout/fly.cxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/flyincnt.cxx sw/source/core/layout/flylay.cxx sw/source/core/layout/frmtool.cxx sw/source/core/layout/ftnfrm.cxx sw/source/core/layout/layact.cxx sw/source/core/layout/laycache.cxx sw/source/core/layout/makefile.mk sw/source/core/layout/objectformatter.cxx sw/source/core/layout/pagechg.cxx sw/source/core/layout/pagedesc.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/sectfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/layout/unusedf.cxx sw/source/core/layout/wsfrm.cxx sw/source/core/makefile.mk sw/source/core/objectpositioning/anchoredobjectposition.cxx sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx sw/source/core/objectpositioning/makefile.mk sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx sw/source/core/ole/ndole.cxx sw/source/core/para/makefile.mk sw/source/core/para/paratr.cxx sw/source/core/sw3io/makefile.mk sw/source/core/sw3io/sw3convert.cxx sw/source/core/swg/SwXMLTextBlocks.cxx sw/source/core/swg/makefile.mk sw/source/core/swg/swblocks.cxx sw/source/core/table/swnewtable.cxx sw/source/core/table/swtable.cxx sw/source/core/text/EnhancedPDFExportHelper.cxx sw/source/core/text/atrstck.cxx sw/source/core/text/frmcrsr.cxx sw/source/core/text/frmform.cxx sw/source/core/text/itrcrsr.cxx sw/source/core/text/itrform2.cxx sw/source/core/text/makefile.mk sw/source/core/text/porlay.cxx sw/source/core/text/pormulti.cxx sw/source/core/text/txtfld.cxx sw/source/core/text/txtfrm.cxx sw/source/core/text/txtio.cxx sw/source/core/tox/makefile.mk sw/source/core/tox/txmsrt.cxx sw/source/core/txtnode/fmtatr2.cxx sw/source/core/txtnode/fntcache.cxx sw/source/core/txtnode/fntcap.cxx sw/source/core/txtnode/makefile.mk sw/source/core/txtnode/ndhints.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/swfont.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtatr2.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/SwUndoField.cxx sw/source/core/undo/SwUndoPageDesc.cxx sw/source/core/undo/SwUndoTOXChange.cxx sw/source/core/undo/docundo.cxx sw/source/core/undo/makefile.mk sw/source/core/undo/rolbck.cxx sw/source/core/undo/unbkmk.cxx sw/source/core/undo/undel.cxx sw/source/core/undo/undobj.cxx sw/source/core/undo/undobj1.cxx sw/source/core/undo/unfmco.cxx sw/source/core/undo/unins.cxx sw/source/core/undo/unnum.cxx sw/source/core/undo/unoutl.cxx sw/source/core/undo/unredln.cxx sw/source/core/undo/unsect.cxx sw/source/core/undo/unsort.cxx sw/source/core/undo/unspnd.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/makefile.mk sw/source/core/unocore/swunohelper.cxx sw/source/core/unocore/unobkm.cxx sw/source/core/unocore/unocoll.cxx sw/source/core/unocore/unocrsrhelper.cxx sw/source/core/unocore/unodraw.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unoredlines.cxx sw/source/core/unocore/unosett.cxx sw/source/core/unocore/unosrch.cxx sw/source/core/unocore/unostyle.cxx sw/source/core/unocore/unotbl.cxx sw/source/core/view/vdraw.cxx sw/source/core/view/viewimp.cxx sw/source/core/view/viewpg.cxx sw/source/core/view/viewsh.cxx sw/source/core/view/vnew.cxx sw/source/core/view/vprint.cxx sw/source/filter/ascii/ascatr.cxx sw/source/filter/ascii/makefile.mk sw/source/filter/ascii/wrtasc.cxx sw/source/filter/basflt/fltini.cxx sw/source/filter/basflt/iodetect.cxx sw/source/filter/basflt/makefile.mk sw/source/filter/html/SwAppletImpl.cxx sw/source/filter/html/css1atr.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/html/htmlbas.cxx sw/source/filter/html/htmlcss1.cxx sw/source/filter/html/htmlfly.cxx sw/source/filter/html/htmlftn.cxx sw/source/filter/html/htmlgrin.cxx sw/source/filter/html/htmlnum.cxx sw/source/filter/html/htmlplug.cxx sw/source/filter/html/htmltab.cxx sw/source/filter/html/makefile.mk sw/source/filter/html/parcss1.cxx sw/source/filter/html/svxcss1.cxx sw/source/filter/html/swhtml.cxx sw/source/filter/inc/msfilter.hxx sw/source/filter/inc/wrtswtbl.hxx sw/source/filter/rtf/makefile.mk sw/source/filter/rtf/rtffly.cxx sw/source/filter/rtf/rtfnum.cxx sw/source/filter/rtf/rtftbl.cxx sw/source/filter/rtf/swparrtf.cxx sw/source/filter/rtf/swparrtf.hxx sw/source/filter/writer/makefile.mk sw/source/filter/writer/writer.cxx sw/source/filter/writer/wrt_fn.cxx sw/source/filter/writer/wrtswtbl.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww1/makefile.mk sw/source/filter/ww1/w1class.cxx sw/source/filter/ww1/w1class.hxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww1/w1par.cxx sw/source/filter/ww1/w1sprm.cxx sw/source/filter/ww1/w1struct.hxx sw/source/filter/ww8/README-rtf.txt sw/source/filter/ww8/attributeoutputbase.hxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/docxattributeoutput.hxx sw/source/filter/ww8/docxexport.cxx sw/source/filter/ww8/docxexport.hxx sw/source/filter/ww8/docxexportfilter.cxx sw/source/filter/ww8/dump/dump8.cxx sw/source/filter/ww8/dump/dump8a.cxx sw/source/filter/ww8/dump/msvbasic.cxx sw/source/filter/ww8/dump/msvbasic.hxx sw/source/filter/ww8/dump/ww8darr.cxx sw/source/filter/ww8/dump/ww8darr.hxx sw/source/filter/ww8/dump/ww8dout.cxx sw/source/filter/ww8/dump/ww8dout.hxx sw/source/filter/ww8/dump/ww8scan.cxx sw/source/filter/ww8/dump/ww8scan.hxx sw/source/filter/ww8/dump/ww8struc.hxx sw/source/filter/ww8/makefile.mk sw/source/filter/ww8/rtfattributeoutput.cxx sw/source/filter/ww8/rtfattributeoutput.hxx sw/source/filter/ww8/rtfexport.cxx sw/source/filter/ww8/rtfexport.hxx sw/source/filter/ww8/rtfexportfilter.cxx sw/source/filter/ww8/rtfexportfilter.hxx sw/source/filter/ww8/rtfimportfilter.cxx sw/source/filter/ww8/rtfimportfilter.hxx sw/source/filter/ww8/rtfsdrexport.cxx sw/source/filter/ww8/rtfsdrexport.hxx sw/source/filter/ww8/writerhelper.cxx sw/source/filter/ww8/writerwordglue.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtw8num.cxx sw/source/filter/ww8/wrtw8sty.cxx sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/wrtww8.hxx sw/source/filter/ww8/wrtww8gr.cxx sw/source/filter/ww8/ww8atr.cxx sw/source/filter/ww8/ww8attributeoutput.hxx sw/source/filter/ww8/ww8graf.cxx sw/source/filter/ww8/ww8graf.hxx sw/source/filter/ww8/ww8graf2.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par2.cxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8scan.cxx sw/source/filter/ww8/ww8scan.hxx sw/source/filter/ww8/ww8struc.hxx sw/source/filter/xml/makefile.mk sw/source/filter/xml/xmlimpit.cxx sw/source/filter/xml/xmltble.cxx sw/source/filter/xml/xmltbli.cxx sw/source/ui/app/appenv.cxx sw/source/ui/app/apphdl.cxx sw/source/ui/app/applab.cxx sw/source/ui/app/appopt.cxx sw/source/ui/app/docsh.cxx sw/source/ui/app/docsh2.cxx sw/source/ui/app/docshini.cxx sw/source/ui/app/docst.cxx sw/source/ui/app/docstyle.cxx sw/source/ui/app/makefile.mk sw/source/ui/app/mn.src sw/source/ui/app/swmodul1.cxx sw/source/ui/cctrl/makefile.mk sw/source/ui/cctrl/swlbox.cxx sw/source/ui/chrdlg/break.cxx sw/source/ui/chrdlg/ccoll.cxx sw/source/ui/chrdlg/chardlg.cxx sw/source/ui/chrdlg/drpcps.cxx sw/source/ui/chrdlg/makefile.mk sw/source/ui/chrdlg/numpara.cxx sw/source/ui/chrdlg/pardlg.cxx sw/source/ui/chrdlg/swuiccoll.cxx sw/source/ui/config/barcfg.cxx sw/source/ui/config/caption.cxx sw/source/ui/config/cfgitems.cxx sw/source/ui/config/fontcfg.cxx sw/source/ui/config/mailconfigpage.cxx sw/source/ui/config/makefile.mk sw/source/ui/config/modcfg.cxx sw/source/ui/config/optcomp.cxx sw/source/ui/config/optload.cxx sw/source/ui/config/optpage.cxx sw/source/ui/config/prtopt.cxx sw/source/ui/config/uinums.cxx sw/source/ui/config/usrpref.cxx sw/source/ui/config/viewopt.cxx sw/source/ui/dbui/dbinsdlg.cxx sw/source/ui/dbui/dbmgr.cxx sw/source/ui/dbui/dbtree.cxx sw/source/ui/dbui/makefile.mk sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dbui/mmdocselectpage.cxx sw/source/ui/dbui/mmoutputpage.cxx sw/source/ui/dbui/swdbtoolsclient.cxx sw/source/ui/dialog/abstract.cxx sw/source/ui/dialog/ascfldlg.cxx sw/source/ui/dialog/macassgn.cxx sw/source/ui/dialog/makefile.mk sw/source/ui/dialog/regionsw.cxx sw/source/ui/dialog/swdlgfact.cxx sw/source/ui/dialog/swdlgfact.hxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/dochdl/gloshdl.cxx sw/source/ui/dochdl/makefile.mk sw/source/ui/dochdl/swdtflvr.cxx sw/source/ui/docvw/PostItMgr.cxx sw/source/ui/docvw/SidebarWin.cxx sw/source/ui/docvw/edtdd.cxx sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin2.cxx sw/source/ui/docvw/edtwin3.cxx sw/source/ui/docvw/makefile.mk sw/source/ui/docvw/romenu.cxx sw/source/ui/docvw/romenu.hxx sw/source/ui/docvw/srcedtw.cxx sw/source/ui/envelp/envfmt.cxx sw/source/ui/envelp/envimg.cxx sw/source/ui/envelp/envlop1.cxx sw/source/ui/envelp/envprt.cxx sw/source/ui/envelp/label1.cxx sw/source/ui/envelp/labfmt.cxx sw/source/ui/envelp/labprt.cxx sw/source/ui/envelp/mailmrge.cxx sw/source/ui/envelp/makefile.mk sw/source/ui/fldui/flddb.cxx sw/source/ui/fldui/flddinf.cxx sw/source/ui/fldui/flddok.cxx sw/source/ui/fldui/fldedt.cxx sw/source/ui/fldui/fldfunc.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/fldui/fldpage.cxx sw/source/ui/fldui/fldref.cxx sw/source/ui/fldui/fldtdlg.cxx sw/source/ui/fldui/fldvar.cxx sw/source/ui/fldui/fldwrap.cxx sw/source/ui/fldui/inpdlg.cxx sw/source/ui/fldui/makefile.mk sw/source/ui/fmtui/makefile.mk sw/source/ui/fmtui/tmpdlg.cxx sw/source/ui/frmdlg/colmgr.cxx sw/source/ui/frmdlg/column.cxx sw/source/ui/frmdlg/cption.cxx sw/source/ui/frmdlg/frmdlg.cxx sw/source/ui/frmdlg/frmmgr.cxx sw/source/ui/frmdlg/frmpage.cxx sw/source/ui/frmdlg/makefile.mk sw/source/ui/frmdlg/wrap.cxx sw/source/ui/globdoc/makefile.mk sw/source/ui/inc/bmpwin.hxx sw/source/ui/inc/colmgr.hxx sw/source/ui/inc/column.hxx sw/source/ui/inc/envimg.hxx sw/source/ui/inc/envlop.hxx sw/source/ui/inc/frmpage.hxx sw/source/ui/inc/inputwin.hxx sw/source/ui/inc/javaedit.hxx sw/source/ui/inc/num.hxx sw/source/ui/inc/optpage.hxx sw/source/ui/inc/regionsw.hxx sw/source/ui/inc/split.hxx sw/source/ui/inc/swlbox.hxx sw/source/ui/inc/swmn_tmpl.hrc sw/source/ui/inc/swuiidxmrk.hxx sw/source/ui/inc/tabsh.hxx sw/source/ui/inc/toxmgr.hxx sw/source/ui/inc/uiitems.hxx sw/source/ui/inc/view.hxx sw/source/ui/inc/workctrl.hxx sw/source/ui/inc/wrap.hxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/index/cnttab.cxx sw/source/ui/index/makefile.mk sw/source/ui/index/toxmgr.cxx sw/source/ui/lingu/hhcwrp.cxx sw/source/ui/lingu/makefile.mk sw/source/ui/lingu/olmenu.cxx sw/source/ui/misc/bookmark.cxx sw/source/ui/misc/docfnote.cxx sw/source/ui/misc/glosbib.cxx sw/source/ui/misc/glosdoc.cxx sw/source/ui/misc/glshell.cxx sw/source/ui/misc/insfnote.cxx sw/source/ui/misc/linenum.cxx sw/source/ui/misc/makefile.mk sw/source/ui/misc/num.cxx sw/source/ui/misc/numberingtypelistbox.cxx sw/source/ui/misc/outline.cxx sw/source/ui/misc/pgfnote.cxx sw/source/ui/misc/pggrid.cxx sw/source/ui/misc/redlndlg.cxx sw/source/ui/misc/srtdlg.cxx sw/source/ui/misc/swmodalredlineacceptdlg.cxx sw/source/ui/ribbar/conarc.cxx sw/source/ui/ribbar/drawbase.cxx sw/source/ui/ribbar/inputwin.cxx sw/source/ui/ribbar/inputwin.src sw/source/ui/ribbar/makefile.mk sw/source/ui/ribbar/tbxanchr.cxx sw/source/ui/ribbar/workctrl.cxx sw/source/ui/ribbar/workctrl.src sw/source/ui/shells/annotsh.cxx sw/source/ui/shells/basesh.cxx sw/source/ui/shells/beziersh.cxx sw/source/ui/shells/drawdlg.cxx sw/source/ui/shells/drwbassh.cxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/shells/drwtxtsh.cxx sw/source/ui/shells/frmsh.cxx sw/source/ui/shells/grfsh.cxx sw/source/ui/shells/grfshex.cxx sw/source/ui/shells/makefile.mk sw/source/ui/shells/tabsh.cxx sw/source/ui/shells/textfld.cxx sw/source/ui/shells/textglos.cxx sw/source/ui/shells/textsh.cxx sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/shells/txtcrsr.cxx sw/source/ui/shells/txtnum.cxx sw/source/ui/table/convert.cxx sw/source/ui/table/instable.cxx sw/source/ui/table/makefile.mk sw/source/ui/table/swtablerep.cxx sw/source/ui/table/tabledlg.cxx sw/source/ui/table/tablemgr.cxx sw/source/ui/table/tablepg.hxx sw/source/ui/table/tautofmt.cxx sw/source/ui/uiview/formatclipboard.cxx sw/source/ui/uiview/makefile.mk sw/source/ui/uiview/pview.cxx sw/source/ui/uiview/pview.src sw/source/ui/uiview/scroll.cxx sw/source/ui/uiview/srcview.cxx sw/source/ui/uiview/swcli.cxx sw/source/ui/uiview/uivwimp.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view1.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/viewcoll.cxx sw/source/ui/uiview/viewdlg2.cxx sw/source/ui/uiview/viewling.cxx sw/source/ui/uiview/viewmdi.cxx sw/source/ui/uiview/viewport.cxx sw/source/ui/uiview/viewprt.cxx sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewtab.cxx sw/source/ui/uno/SwXDocumentSettings.cxx sw/source/ui/uno/SwXPrintPreviewSettings.cxx sw/source/ui/uno/SwXPrintPreviewSettings.hxx sw/source/ui/uno/unoatxt.cxx sw/source/ui/uno/unomod.cxx sw/source/ui/uno/unotxdoc.cxx sw/source/ui/uno/unotxvw.cxx sw/source/ui/utlui/attrdesc.cxx sw/source/ui/utlui/content.cxx sw/source/ui/utlui/glbltree.cxx sw/source/ui/utlui/initui.cxx sw/source/ui/utlui/makefile.mk sw/source/ui/utlui/navipi.cxx sw/source/ui/utlui/navipi.src sw/source/ui/utlui/numfmtlb.cxx sw/source/ui/utlui/prcntfld.cxx sw/source/ui/utlui/uiitems.cxx sw/source/ui/utlui/uitool.cxx sw/source/ui/utlui/unotools.cxx sw/source/ui/utlui/viewlayoutctrl.cxx sw/source/ui/utlui/zoomctrl.cxx sw/source/ui/vba/makefile.mk sw/source/ui/vba/service.cxx sw/source/ui/web/makefile.mk sw/source/ui/wrtsh/makefile.mk sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh2.cxx sw/source/ui/wrtsh/wrtsh4.cxx sw/source/ui/wrtsh/wrtundo.cxx sw/util/hidother.src sw/util/makefile.mk sw/util/msword.map
2011-03-14 16:51:14 +00:00
sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
sal_Int32 nLastPos = 0;
for (std::vector<ScriptChangeInfo>::const_iterator i2 = aScriptChanges.begin(); i2 != aScriptChanges.end(); ++i2)
{
SAL_WARN_IF( nLastTyp == i2->type ||
nLastPos >= i2->position,
"sw.core", "Heavy InitScriptType() confusion" );
nLastPos = i2->position;
nLastTyp = i2->type;
}
#endif
}
}
}
}
void SwScriptInfo::UpdateBidiInfo( const OUString& rText )
{
// remove invalid entries from direction information arrays
aDirectionChanges.clear();
// Bidi functions from icu 2.0
UErrorCode nError = U_ZERO_ERROR;
UBiDi* pBidi = ubidi_openSized( rText.getLength(), 0, &nError );
nError = U_ZERO_ERROR;
ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(rText.getStr()), rText.getLength(),
nDefaultDir, nullptr, &nError );
nError = U_ZERO_ERROR;
int nCount = ubidi_countRuns( pBidi, &nError );
int32_t nStart = 0;
int32_t nEnd;
UBiDiLevel nCurrDir;
for ( int nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
aDirectionChanges.emplace_back(nEnd, nCurrDir );
nStart = nEnd;
}
ubidi_close( pBidi );
}
// returns the position of the next character which belongs to another script
// than the character of the actual (input) position.
// If there's no script change until the end of the paragraph, it will return
// COMPLETE_STRING.
// Scripts are Asian (Chinese, Japanese, Korean),
// Latin ( English etc.)
// and Complex ( Hebrew, Arabian )
sal_Int32 SwScriptInfo::NextScriptChg(const sal_Int32 nPos) const
{
const size_t nEnd = CountScriptChg();
for( size_t nX = 0; nX < nEnd; ++nX )
2001-04-09 09:44:17 +00:00
{
if( nPos < GetScriptChg( nX ) )
return GetScriptChg( nX );
2001-04-09 09:44:17 +00:00
}
return COMPLETE_STRING;
}
// returns the script of the character at the input position
sal_Int16 SwScriptInfo::ScriptType(const sal_Int32 nPos) const
{
const size_t nEnd = CountScriptChg();
for( size_t nX = 0; nX < nEnd; ++nX )
2001-04-09 09:44:17 +00:00
{
if( nPos < GetScriptChg( nX ) )
return GetScriptType( nX );
2001-04-09 09:44:17 +00:00
}
// the default is the application language script
return SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() );
}
sal_Int32 SwScriptInfo::NextDirChg( const sal_Int32 nPos,
const sal_uInt8* pLevel ) const
2002-03-21 08:19:43 +00:00
{
const sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
const size_t nEnd = CountDirChg();
for( size_t nX = 0; nX < nEnd; ++nX )
2002-03-21 08:19:43 +00:00
{
if( nPos < GetDirChg( nX ) &&
( nX + 1 == nEnd || GetDirType( nX + 1 ) <= nCurrDir ) )
2002-03-21 08:19:43 +00:00
return GetDirChg( nX );
}
return COMPLETE_STRING;
2002-03-21 08:19:43 +00:00
}
sal_uInt8 SwScriptInfo::DirType(const sal_Int32 nPos) const
2002-03-21 08:19:43 +00:00
{
const size_t nEnd = CountDirChg();
for( size_t nX = 0; nX < nEnd; ++nX )
2002-03-21 08:19:43 +00:00
{
if( nPos < GetDirChg( nX ) )
return GetDirType( nX );
}
return 0;
}
// Takes a string and replaced the hidden ranges with cChar.
sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffer & rText,
const sal_Int32 nStt, const sal_Int32 nEnd,
const sal_Unicode cChar )
{
assert(rNode.GetText().getLength() == rText.getLength());
PositionList aList;
sal_Int32 nHiddenStart;
sal_Int32 nHiddenEnd;
sal_Int32 nNumOfHiddenChars = 0;
GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList );
PositionList::const_reverse_iterator rFirst( aList.end() );
PositionList::const_reverse_iterator rLast( aList.begin() );
while ( rFirst != rLast )
{
nHiddenEnd = *(rFirst++);
nHiddenStart = *(rFirst++);
if ( nHiddenEnd < nStt || nHiddenStart > nEnd )
continue;
while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd )
{
if ( nHiddenStart >= nStt && nHiddenStart < nEnd )
{
rText[nHiddenStart] = cChar;
++nNumOfHiddenChars;
}
++nHiddenStart;
}
}
return nNumOfHiddenChars;
}
// Takes a SwTextNode and deletes the hidden ranges from the node.
void SwScriptInfo::DeleteHiddenRanges( SwTextNode& rNode )
{
PositionList aList;
sal_Int32 nHiddenStart;
sal_Int32 nHiddenEnd;
GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList );
PositionList::const_reverse_iterator rFirst( aList.end() );
PositionList::const_reverse_iterator rLast( aList.begin() );
while ( rFirst != rLast )
{
nHiddenEnd = *(rFirst++);
nHiddenStart = *(rFirst++);
SwPaM aPam( rNode, nHiddenStart, rNode, nHiddenEnd );
rNode.getIDocumentContentOperations().DeleteRange( aPam );
}
}
bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTextNode& rNode, sal_Int32 nPos,
sal_Int32& rnStartPos, sal_Int32& rnEndPos,
PositionList* pList )
{
rnStartPos = COMPLETE_STRING;
rnEndPos = 0;
bool bNewContainsHiddenChars = false;
// Optimization: First examine the flags at the text node:
if ( !rNode.IsCalcHiddenCharFlags() )
{
bool bWholePara = rNode.HasHiddenCharAttribute( true );
bool bContainsHiddenChars = rNode.HasHiddenCharAttribute( false );
if ( !bContainsHiddenChars )
return false;
if ( bWholePara )
{
if ( pList )
{
pList->push_back( 0 );
pList->push_back(rNode.GetText().getLength());
}
rnStartPos = 0;
rnEndPos = rNode.GetText().getLength();
return true;
}
}
const SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( rNode );
if ( pSI )
{
// Check first, if we have a valid SwScriptInfo object for this text node:
bNewContainsHiddenChars = pSI->GetBoundsOfHiddenRange( nPos, rnStartPos, rnEndPos, pList );
const bool bNewHiddenCharsHidePara =
rnStartPos == 0 && rnEndPos >= rNode.GetText().getLength();
rNode.SetHiddenCharAttribute( bNewHiddenCharsHidePara, bNewContainsHiddenChars );
}
else
{
// No valid SwScriptInfo Object, we have to do it the hard way:
Range aRange(0, (!rNode.GetText().isEmpty())
? rNode.GetText().getLength() - 1
: 0);
MultiSelection aHiddenMulti( aRange );
SwScriptInfo::CalcHiddenRanges( rNode, aHiddenMulti );
for( size_t i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
const sal_Int32 nHiddenStart = rRange.Min();
const sal_Int32 nHiddenEnd = rRange.Max() + 1;
if ( nHiddenStart > nPos )
break;
if ( nHiddenStart <= nPos && nPos < nHiddenEnd )
{
rnStartPos = nHiddenStart;
rnEndPos = std::min<sal_Int32>(nHiddenEnd,
rNode.GetText().getLength());
break;
}
}
if ( pList )
{
for( size_t i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
pList->push_back( rRange.Min() );
pList->push_back( rRange.Max() + 1 );
}
}
bNewContainsHiddenChars = aHiddenMulti.GetRangeCount() > 0;
}
return bNewContainsHiddenChars;
}
bool SwScriptInfo::GetBoundsOfHiddenRange( sal_Int32 nPos, sal_Int32& rnStartPos,
sal_Int32& rnEndPos, PositionList* pList ) const
{
rnStartPos = COMPLETE_STRING;
rnEndPos = 0;
const size_t nEnd = CountHiddenChg();
for( size_t nX = 0; nX < nEnd; ++nX )
{
const sal_Int32 nHiddenStart = GetHiddenChg( nX++ );
const sal_Int32 nHiddenEnd = GetHiddenChg( nX );
if ( nHiddenStart > nPos )
break;
if ( nHiddenStart <= nPos && nPos < nHiddenEnd )
{
rnStartPos = nHiddenStart;
rnEndPos = nHiddenEnd;
break;
}
}
if ( pList )
{
for( size_t nX = 0; nX < nEnd; ++nX )
{
pList->push_back( GetHiddenChg( nX++ ) );
pList->push_back( GetHiddenChg( nX ) );
}
}
return CountHiddenChg() > 0;
}
bool SwScriptInfo::IsInHiddenRange( const SwTextNode& rNode, sal_Int32 nPos )
{
sal_Int32 nStartPos;
sal_Int32 nEndPos;
SwScriptInfo::GetBoundsOfHiddenRange( rNode, nPos, nStartPos, nEndPos );
return nStartPos != COMPLETE_STRING;
}
#ifdef DBG_UTIL
// returns the type of the compressed character
SwScriptInfo::CompType SwScriptInfo::DbgCompType( const sal_Int32 nPos ) const
2001-04-09 09:44:17 +00:00
{
const size_t nEnd = CountCompChg();
for( size_t nX = 0; nX < nEnd; ++nX )
2001-04-09 09:44:17 +00:00
{
const sal_Int32 nChg = GetCompStart( nX );
2001-04-09 09:44:17 +00:00
if ( nPos < nChg )
return NONE;
if( nPos < nChg + GetCompLen( nX ) )
return GetCompType( nX );
}
return NONE;
}
#endif
2001-04-09 09:44:17 +00:00
// returns, if there are compressable kanas or specials
// between nStart and nEnd
size_t SwScriptInfo::HasKana( sal_Int32 nStart, const sal_Int32 nLen ) const
2001-04-09 09:44:17 +00:00
{
const size_t nCnt = CountCompChg();
sal_Int32 nEnd = nStart + nLen;
2001-04-09 09:44:17 +00:00
for( size_t nX = 0; nX < nCnt; ++nX )
2001-04-09 09:44:17 +00:00
{
sal_Int32 nKanaStart = GetCompStart( nX );
sal_Int32 nKanaEnd = nKanaStart + GetCompLen( nX );
2001-04-09 09:44:17 +00:00
if ( nKanaStart >= nEnd )
return SAL_MAX_SIZE;
2001-04-09 09:44:17 +00:00
if ( nStart < nKanaEnd )
return nX;
}
return SAL_MAX_SIZE;
2001-04-09 09:44:17 +00:00
}
long SwScriptInfo::Compress( long* pKernArray, sal_Int32 nIdx, sal_Int32 nLen,
const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
bool bCenter,
2001-04-09 09:44:17 +00:00
Point* pPoint ) const
{
SAL_WARN_IF( !nCompress, "sw.core", "Compression without compression?!" );
SAL_WARN_IF( !nLen, "sw.core", "Compression without text?!" );
const size_t nCompCount = CountCompChg();
2001-04-09 09:44:17 +00:00
// In asian typography, there are full width and half width characters.
// Full width punctuation characters can be compressed by 50%
// to determine this, we compare the font width with 75% of its height
const long nMinWidth = ( 3 * nFontHeight ) / 4;
2001-04-09 09:44:17 +00:00
size_t nCompIdx = HasKana( nIdx, nLen );
2001-04-09 09:44:17 +00:00
if ( SAL_MAX_SIZE == nCompIdx )
2001-04-09 09:44:17 +00:00
return 0;
sal_Int32 nChg = GetCompStart( nCompIdx );
sal_Int32 nCompLen = GetCompLen( nCompIdx );
sal_Int32 nI = 0;
nLen += nIdx;
2001-04-09 09:44:17 +00:00
if( nChg > nIdx )
{
nI = nChg - nIdx;
nIdx = nChg;
}
else if( nIdx < nChg + nCompLen )
nCompLen -= nIdx - nChg;
if( nIdx > nLen || nCompIdx >= nCompCount )
return 0;
long nSub = 0;
long nLast = nI ? pKernArray[ nI - 1 ] : 0;
do
{
const CompType nType = GetCompType( nCompIdx );
#ifdef DBG_UTIL
SAL_WARN_IF( nType != DbgCompType( nIdx ), "sw.core", "Gimme the right type!" );
#endif
nCompLen += nIdx;
2001-04-09 09:44:17 +00:00
if( nCompLen > nLen )
nCompLen = nLen;
// are we allowed to compress the character?
if ( pKernArray[ nI ] - nLast < nMinWidth )
{
nIdx++; nI++;
}
else
{
while( nIdx < nCompLen )
{
SAL_WARN_IF( SwScriptInfo::NONE == nType, "sw.core", "None compression?!" );
2001-04-09 09:44:17 +00:00
// nLast is width of current character
nLast -= pKernArray[ nI ];
nLast *= nCompress;
long nMove = 0;
if( SwScriptInfo::KANA != nType )
{
nLast /= 24000;
2001-04-09 09:44:17 +00:00
if( pPoint && SwScriptInfo::SPECIAL_LEFT == nType )
{
if( nI )
nMove = nLast;
else
{
pPoint->X() += nLast;
nLast = 0;
}
}
else if( bCenter && SwScriptInfo::SPECIAL_MIDDLE == nType )
nMove = nLast / 2;
2001-04-09 09:44:17 +00:00
}
else
nLast /= 100000;
nSub -= nLast;
nLast = pKernArray[ nI ];
if( nI && nMove )
2001-04-09 09:44:17 +00:00
pKernArray[ nI - 1 ] += nMove;
pKernArray[ nI++ ] -= nSub;
++nIdx;
}
}
if( nIdx >= nLen )
break;
sal_Int32 nTmpChg = nLen;
if( ++nCompIdx < nCompCount )
2001-04-09 09:44:17 +00:00
{
nTmpChg = GetCompStart( nCompIdx );
if( nTmpChg > nLen )
nTmpChg = nLen;
nCompLen = GetCompLen( nCompIdx );
}
while( nIdx < nTmpChg )
{
nLast = pKernArray[ nI ];
pKernArray[ nI++ ] -= nSub;
++nIdx;
2001-04-09 09:44:17 +00:00
}
} while( nIdx < nLen );
return nSub;
}
// Note on calling KashidaJustify():
// Kashida positions may be marked as invalid. Therefore KashidaJustify may return the clean
// total number of kashida positions, or the number of kashida positions after some positions
// have been dropped, depending on the state of the aKashidaInvalid array.
sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray,
long* pScrArray,
sal_Int32 nStt,
sal_Int32 nLen,
long nSpaceAdd ) const
{
SAL_WARN_IF( !nLen, "sw.core", "Kashida justification without text?!" );
if( !IsKashidaLine(nStt))
return -1;
// evaluate kashida information in collected in SwScriptInfo
size_t nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
break;
++nCntKash;
}
const sal_Int32 nEnd = nStt + nLen;
size_t nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
break;
++nCntKashEnd;
}
size_t nActualKashCount = nCntKashEnd - nCntKash;
for (size_t i = nCntKash; i < nCntKashEnd; ++i)
{
if ( nActualKashCount && !IsKashidaValid ( i ) )
--nActualKashCount;
}
if ( !pKernArray )
return nActualKashCount;
// do nothing if there is no more kashida
if ( nCntKash < CountKashida() )
{
// skip any invalid kashidas
while ( ! IsKashidaValid ( nCntKash ) && nCntKash < nCntKashEnd )
++nCntKash;
sal_Int32 nKashidaPos = GetKashida( nCntKash );
sal_Int32 nIdx = nKashidaPos;
long nKashAdd = nSpaceAdd;
while ( nIdx < nEnd )
{
sal_Int32 nArrayPos = nIdx - nStt;
// next kashida position
++nCntKash;
while ( ! IsKashidaValid ( nCntKash ) && nCntKash < nCntKashEnd )
++nCntKash;
nIdx = nCntKash < CountKashida() && IsKashidaValid ( nCntKash ) ? GetKashida( nCntKash ) : nEnd;
if ( nIdx > nEnd )
nIdx = nEnd;
const sal_Int32 nArrayEnd = nIdx - nStt;
while ( nArrayPos < nArrayEnd )
{
pKernArray[ nArrayPos ] += nKashAdd;
if ( pScrArray )
pScrArray[ nArrayPos ] += nKashAdd;
++nArrayPos;
}
nKashAdd += nSpaceAdd;
}
}
return 0;
}
// Checks if the current text is 'Arabic' text. Note that only the first
// character has to be checked because a ctl portion only contains one
// script, see NewTextPortion
bool SwScriptInfo::IsArabicText( const OUString& rText, sal_Int32 nStt, sal_Int32 nLen )
{
using namespace ::com::sun::star::i18n;
static const ScriptTypeList typeList[] = {
{ UnicodeScript_kArabic, UnicodeScript_kArabic, (sal_Int16)UnicodeScript_kArabic }, // 11,
{ UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, (sal_Int16)UnicodeScript_kScriptCount } // 88
};
// go forward if current position does not hold a regular character:
const CharClass& rCC = GetAppCharClass();
sal_Int32 nIdx = nStt;
const sal_Int32 nEnd = nStt + nLen;
while ( nIdx < nEnd && !rCC.isLetterNumeric( rText, nIdx ) )
{
++nIdx;
}
if( nIdx == nEnd )
{
// no regular character found in this portion. Go backward:
--nIdx;
while ( nIdx >= 0 && !rCC.isLetterNumeric( rText, nIdx ) )
{
--nIdx;
}
}
if( nIdx >= 0 )
{
const sal_Unicode cCh = rText[nIdx];
const sal_Int16 type = unicode::getUnicodeScriptType( cCh, typeList, (sal_Int16)UnicodeScript_kScriptCount );
return type == (sal_Int16)UnicodeScript_kArabic;
}
return false;
}
bool SwScriptInfo::IsKashidaValid(sal_Int32 nKashPos) const
{
for (sal_Int32 i : aKashidaInvalid)
{
if ( i == nKashPos )
return false;
}
return true;
}
void SwScriptInfo::ClearKashidaInvalid(sal_Int32 nKashPos)
{
2010-10-05 20:01:23 +02:00
for ( size_t i = 0; i < aKashidaInvalid.size(); ++i )
{
if ( aKashidaInvalid [ i ] == nKashPos )
{
aKashidaInvalid.erase ( aKashidaInvalid.begin() + i );
return;
}
}
}
// bMark == true:
// marks the first valid kashida in the given text range as invalid
// bMark == false:
// clears all kashida invalid flags in the given text range
bool SwScriptInfo::MarkOrClearKashidaInvalid(sal_Int32 nStt, sal_Int32 nLen,
bool bMark, sal_Int32 nMarkCount)
{
size_t nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
break;
nCntKash++;
}
const sal_Int32 nEnd = nStt + nLen;
while ( nCntKash < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKash ) )
break;
if(bMark)
{
if ( IsKashidaValid ( nCntKash ) )
{
MarkKashidaInvalid ( nCntKash );
--nMarkCount;
if (!nMarkCount)
return true;
}
}
else
{
ClearKashidaInvalid ( nCntKash );
}
nCntKash++;
}
return false;
}
void SwScriptInfo::MarkKashidaInvalid(sal_Int32 nKashPos)
{
aKashidaInvalid.push_back(nKashPos);
}
// retrieve the kashida positions in the given text range
void SwScriptInfo::GetKashidaPositions(sal_Int32 nStt, sal_Int32 nLen,
sal_Int32* pKashidaPosition)
{
size_t nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
break;
nCntKash++;
}
const sal_Int32 nEnd = nStt + nLen;
size_t nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
break;
pKashidaPosition [ nCntKashEnd - nCntKash ] = GetKashida ( nCntKashEnd );
nCntKashEnd++;
}
}
void SwScriptInfo::SetNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen)
{
2010-10-05 20:01:23 +02:00
aNoKashidaLine.push_back( nStt );
aNoKashidaLineEnd.push_back( nStt+nLen );
}
// determines if the line uses kashida justification
bool SwScriptInfo::IsKashidaLine(sal_Int32 nCharIdx) const
{
for (size_t i = 0; i < aNoKashidaLine.size(); ++i)
{
if (nCharIdx >= aNoKashidaLine[ i ] && nCharIdx < aNoKashidaLineEnd[ i ])
return false;
}
return true;
}
void SwScriptInfo::ClearNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen)
{
size_t i = 0;
while( i < aNoKashidaLine.size())
{
if( nStt + nLen >= aNoKashidaLine[ i ] && nStt < aNoKashidaLineEnd [ i ] )
{
aNoKashidaLine.erase(aNoKashidaLine.begin() + i);
aNoKashidaLineEnd.erase(aNoKashidaLineEnd.begin() + i);
}
else
++i;
}
}
// mark the given character indices as invalid kashida positions
bool SwScriptInfo::MarkKashidasInvalid(sal_Int32 nCnt, const sal_Int32* pKashidaPositions)
{
SAL_WARN_IF( !pKashidaPositions || nCnt == 0, "sw.core", "Where are kashidas?" );
size_t nCntKash = 0;
sal_Int32 nKashidaPosIdx = 0;
while (nCntKash < CountKashida() && nKashidaPosIdx < nCnt)
{
if ( pKashidaPositions [nKashidaPosIdx] > GetKashida( nCntKash ) )
{
++nCntKash;
continue;
}
if ( pKashidaPositions [nKashidaPosIdx] != GetKashida( nCntKash ) || !IsKashidaValid ( nCntKash ) )
return false; // something is wrong
MarkKashidaInvalid ( nCntKash );
nKashidaPosIdx++;
}
return true;
}
sal_Int32 SwScriptInfo::ThaiJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nStt,
sal_Int32 nLen, sal_Int32 nNumberOfBlanks,
long nSpaceAdd )
{
SAL_WARN_IF( nStt + nLen > rText.getLength(), "sw.core", "String in ThaiJustify too small" );
SwTwips nNumOfTwipsToDistribute = nSpaceAdd * nNumberOfBlanks /
SPACING_PRECISION_FACTOR;
long nSpaceSum = 0;
sal_Int32 nCnt = 0;
for (sal_Int32 nI = 0; nI < nLen; ++nI)
{
const sal_Unicode cCh = rText[nStt + nI];
// check if character is not above or below base
if ( ( 0xE34 > cCh || cCh > 0xE3A ) &&
( 0xE47 > cCh || cCh > 0xE4E ) && cCh != 0xE31 )
{
if ( nNumberOfBlanks > 0 )
{
nSpaceAdd = nNumOfTwipsToDistribute / nNumberOfBlanks;
--nNumberOfBlanks;
nNumOfTwipsToDistribute -= nSpaceAdd;
}
nSpaceSum += nSpaceAdd;
++nCnt;
}
if ( pKernArray ) pKernArray[ nI ] += nSpaceSum;
if ( pScrArray ) pScrArray[ nI ] += nSpaceSum;
}
return nCnt;
}
SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTextNode& rTNd,
bool bAllowInvalid )
{
SwIterator<SwTextFrame,SwTextNode> aIter( rTNd );
SwScriptInfo* pScriptInfo = nullptr;
for( SwTextFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
pScriptInfo = const_cast<SwScriptInfo*>(pLast->GetScriptInfo());
if ( pScriptInfo )
{
if ( bAllowInvalid || COMPLETE_STRING == pScriptInfo->GetInvalidityA() )
break;
pScriptInfo = nullptr;
}
}
return pScriptInfo;
}
2000-09-18 23:08:29 +00:00
SwParaPortion::SwParaPortion()
{
FormatReset();
m_bFlys = m_bFootnoteNum = m_bMargin = false;
2000-09-18 23:08:29 +00:00
SetWhichPor( POR_PARA );
}
SwParaPortion::~SwParaPortion()
{
}
2000-09-18 23:08:29 +00:00
sal_Int32 SwParaPortion::GetParLen() const
2000-09-18 23:08:29 +00:00
{
sal_Int32 nLen = 0;
2000-09-18 23:08:29 +00:00
const SwLineLayout *pLay = this;
while( pLay )
{
nLen += pLay->GetLen();
2000-09-18 23:08:29 +00:00
pLay = pLay->GetNext();
}
return nLen;
}
const SwDropPortion *SwParaPortion::FindDropPortion() const
{
const SwLineLayout *pLay = this;
while( pLay && pLay->IsDummy() )
pLay = pLay->GetNext();
while( pLay )
{
const SwLinePortion *pPos = pLay->GetPortion();
while ( pPos && !pPos->GetLen() )
pPos = pPos->GetPortion();
if( pPos && pPos->IsDropPortion() )
return static_cast<const SwDropPortion *>(pPos);
pLay = pLay->GetLen() ? nullptr : pLay->GetNext();
2000-09-18 23:08:29 +00:00
}
return nullptr;
2000-09-18 23:08:29 +00:00
}
void SwLineLayout::Init( SwLinePortion* pNextPortion )
{
Height( 0 );
Width( 0 );
SetLen( 0 );
SetAscent( 0 );
SetRealHeight( 0 );
2000-09-18 23:08:29 +00:00
SetPortion( pNextPortion );
}
// looks for hanging punctuation portions in the paragraph
// and return the maximum right offset of them.
// If no such portion is found, the Margin/Hanging-flags will be updated.
SwTwips SwLineLayout::GetHangingMargin_() const
2000-11-21 10:29:48 +00:00
{
SwLinePortion* pPor = GetPortion();
bool bFound = false;
2000-11-21 10:29:48 +00:00
SwTwips nDiff = 0;
while( pPor)
{
if( pPor->IsHangingPortion() )
{
nDiff = static_cast<SwHangingPortion*>(pPor)->GetInnerWidth() - pPor->Width();
2000-11-21 10:29:48 +00:00
if( nDiff )
bFound = true;
2000-11-21 10:29:48 +00:00
}
// the last post its portion
else if ( pPor->IsPostItsPortion() && ! pPor->GetPortion() )
nDiff = nAscent;
2000-11-21 10:29:48 +00:00
pPor = pPor->GetPortion();
}
if( !bFound ) // update the hanging-flag
const_cast<SwLineLayout*>(this)->SetHanging( false );
2000-11-21 10:29:48 +00:00
return nDiff;
}
SwTwips SwTextFrame::HangingMargin() const
2000-11-21 10:29:48 +00:00
{
SAL_WARN_IF( !HasPara(), "sw.core", "Don't call me without a paraportion" );
2000-11-21 10:29:48 +00:00
if( !GetPara()->IsMargin() )
return 0;
const SwLineLayout* pLine = GetPara();
SwTwips nRet = 0;
do
{
SwTwips nDiff = pLine->GetHangingMargin();
if( nDiff > nRet )
nRet = nDiff;
pLine = pLine->GetNext();
} while ( pLine );
if( !nRet ) // update the margin-flag
const_cast<SwParaPortion*>(GetPara())->SetMargin( false );
2000-11-21 10:29:48 +00:00
return nRet;
}
void SwScriptInfo::selectHiddenTextProperty(const SwTextNode& rNode, MultiSelection &rHiddenMulti)
{
assert((rNode.GetText().isEmpty() && rHiddenMulti.GetTotalRange().Len() == 1)
|| (rNode.GetText().getLength() == rHiddenMulti.GetTotalRange().Len()));
const SfxPoolItem* pItem = nullptr;
if( SfxItemState::SET == rNode.GetSwAttrSet().GetItemState( RES_CHRATR_HIDDEN, true, &pItem ) &&
static_cast<const SvxCharHiddenItem*>(pItem)->GetValue() )
{
rHiddenMulti.SelectAll();
}
const SwpHints* pHints = rNode.GetpSwpHints();
if( pHints )
{
for( size_t nTmp = 0; nTmp < pHints->Count(); ++nTmp )
{
const SwTextAttr* pTextAttr = pHints->Get( nTmp );
const SvxCharHiddenItem* pHiddenItem =
static_cast<const SvxCharHiddenItem*>( CharFormat::GetItem( *pTextAttr, RES_CHRATR_HIDDEN ) );
if( pHiddenItem )
{
const sal_Int32 nSt = pTextAttr->GetStart();
const sal_Int32 nEnd = *pTextAttr->End();
if( nEnd > nSt )
{
Range aTmp( nSt, nEnd - 1 );
rHiddenMulti.Select( aTmp, pHiddenItem->GetValue() );
}
}
}
}
}
void SwScriptInfo::selectRedLineDeleted(const SwTextNode& rNode, MultiSelection &rHiddenMulti, bool bSelect)
{
assert((rNode.GetText().isEmpty() && rHiddenMulti.GetTotalRange().Len() == 1)
|| (rNode.GetText().getLength() == rHiddenMulti.GetTotalRange().Len()));
const IDocumentRedlineAccess& rIDRA = rNode.getIDocumentRedlineAccess();
if ( IDocumentRedlineAccess::IsShowChanges( rIDRA.GetRedlineFlags() ) )
{
Complete the transition of SwRedlineTable::size_type ...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types in the SwRedlineTable interface". This all started as an attempt to reduce the number of places a to-be-committed improved loplugin:loopvartoosmall complains about. Lets see where it ends... SwRedlineTable::size_type is now the size_type of the underlying std::vector, no longer sal_uInt16 from ancient times. I tried hard to find all places that are affected by this change, changing types of affected variables and non-static data members as needed. Some notes: * The original code used USHRT_MAX as a "not found" value. I replaced that with a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for now of value USHRT_MAX. This should eventually be changed to something more sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is best done after we have constexpr support in all toolchains, so that npos can be constexpr). It is important that the value of npos is towards positive infinity, as many places in the code use for (i = f(); // may return npos i < table.size(); ++i) table[i] ... * There are some borders where values of SwRedlineTable::size_type are converted into different types, for various reasons. But all of those other types should be large enough for practical purposes (at least 32 bits wide): MakrEntry::m_nIdx: long int SvxRedlinTable::InsertEntry: sal_uIntPtr nPos SwRangeRedline: size_t SwRedlineItr: sal_Int32 SwVbaRevision::GetPosition: sal_Int32 SwXRedlines: sal_Int32 * .uno:TrackedChangeIndex= transports textual representations of such values. libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as strings, while SwTiledRenderingTest converts them to int. * TODO: The one place I'm unsure about is SfxUInt16Items with IDs FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE in sw/source/uibase/uiview/view2.cxx. For now, I kept those as SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from those items. But I have no idea where instances of those items would actually be created, and what it would mean to change those items' types? Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8 Reviewed-on: https://gerrit.libreoffice.org/34775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
SwRedlineTable::size_type nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX );
for ( ; nAct < rIDRA.GetRedlineTable().size(); nAct++ )
{
const SwRangeRedline* pRed = rIDRA.GetRedlineTable()[ nAct ];
if (pRed->Start()->nNode > rNode.GetIndex())
break;
if (pRed->GetType() != nsRedlineType_t::REDLINE_DELETE)
continue;
sal_Int32 nRedlStart;
sal_Int32 nRedlnEnd;
pRed->CalcStartEnd( rNode.GetIndex(), nRedlStart, nRedlnEnd );
//clip it if the redline extends past the end of the nodes text
nRedlnEnd = std::min<sal_Int32>(nRedlnEnd, rNode.GetText().getLength());
if ( nRedlnEnd > nRedlStart )
{
Range aTmp( nRedlStart, nRedlnEnd - 1 );
rHiddenMulti.Select( aTmp, bSelect );
}
}
}
}
// Returns a MultiSection indicating the hidden ranges.
void SwScriptInfo::CalcHiddenRanges( const SwTextNode& rNode, MultiSelection& rHiddenMulti )
{
selectHiddenTextProperty(rNode, rHiddenMulti);
// If there are any hidden ranges in the current text node, we have
// to unhide the redlining ranges:
selectRedLineDeleted(rNode, rHiddenMulti, false);
// We calculated a lot of stuff. Finally we can update the flags at the text node.
const bool bNewContainsHiddenChars = rHiddenMulti.GetRangeCount() > 0;
bool bNewHiddenCharsHidePara = false;
if ( bNewContainsHiddenChars )
{
const Range& rRange = rHiddenMulti.GetRange( 0 );
const sal_Int32 nHiddenStart = rRange.Min();
const sal_Int32 nHiddenEnd = rRange.Max() + 1;
bNewHiddenCharsHidePara =
(nHiddenStart == 0 && nHiddenEnd >= rNode.GetText().getLength());
}
rNode.SetHiddenCharAttribute( bNewHiddenCharsHidePara, bNewContainsHiddenChars );
}
sal_Int32 SwScriptInfo::CountCJKCharacters( const OUString &rText, sal_Int32 nPos, sal_Int32 nEnd, LanguageType aLang)
{
sal_Int32 nCount = 0;
if (nEnd > nPos)
{
sal_Int32 nDone = 0;
const lang::Locale &rLocale = g_pBreakIt->GetLocale( aLang );
while ( nPos < nEnd )
{
nPos = g_pBreakIt->GetBreakIter()->nextCharacters( rText, nPos,
rLocale,
i18n::CharacterIteratorMode::SKIPCELL, 1, nDone );
nCount++;
}
}
else
nCount = nEnd - nPos ;
return nCount;
}
void SwScriptInfo::CJKJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nStt,
sal_Int32 nLen, LanguageType aLang,
long nSpaceAdd, bool bIsSpaceStop )
{
assert( pKernArray != nullptr && nStt >= 0 );
if (nLen > 0)
{
long nSpaceSum = 0;
const lang::Locale &rLocale = g_pBreakIt->GetLocale( aLang );
sal_Int32 nDone = 0;
sal_Int32 nNext = nStt;
for ( sal_Int32 nI = 0; nI < nLen ; ++nI )
{
if ( nI + nStt == nNext )
{
nNext = g_pBreakIt->GetBreakIter()->nextCharacters( rText, nNext,
rLocale,
i18n::CharacterIteratorMode::SKIPCELL, 1, nDone );
if (nNext < nStt + nLen || !bIsSpaceStop)
nSpaceSum += nSpaceAdd;
}
pKernArray[ nI ] += nSpaceSum;
if ( pScrArray )
pScrArray[ nI ] += nSpaceSum;
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */