diff options
author | Kurt Zenker <kz@openoffice.org> | 2003-09-11 08:39:59 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2003-09-11 08:39:59 +0000 |
commit | 6024bebd819eed948f25744b48ef6c0b7892cc95 (patch) | |
tree | 8eceb0586877c2d56dda2ba64215f80f29aa781c /sw/source/core | |
parent | b82fa90f8763300088baee1f753e4fdd500ff904 (diff) |
INTEGRATION: CWS OS18 (1.19.188); FILE MERGED
2003/08/28 13:35:01 os 1.19.188.1: #i18279# skip accepting of '<>,' inside of a numbering and nonclosed parentheses
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index f32f46516267..d8603298d758 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: autofmt.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: vg $ $Date: 2003-04-17 13:59:44 $ + * last change: $Author: kz $ $Date: 2003-09-11 09:39:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -911,12 +911,16 @@ USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos, USHORT nStart = 0; BYTE nDigitLvl = 0, nDigitCnt = 0; + //count number of parenthesis to assure a sensible order is found + USHORT nOpeningParentheses = 0; + USHORT nClosingParentheses = 0; CharClass& rCC = GetCharClass( rNd.GetSwAttrSet().GetLanguage().GetLanguage() ); while( nPos < rTxt.Len() && nDigitLvl < MAXLEVEL - 1) { - if( '0' <= rTxt.GetChar( nPos ) && '9' >= rTxt.GetChar( nPos )) + const sal_Unicode cCurrentChar = rTxt.GetChar( nPos ); + if( '0' <= cCurrentChar && '9' >= cCurrentChar) { if( eScan & DELIM ) { @@ -1104,9 +1108,13 @@ CHECK_ROMAN_5: eScan |= eTmpScan; // Digit rein ++nDigitCnt; } - else if( 256 > rTxt.GetChar( nPos ) && - strchr( /*".,)([]{}"*/ ".,)(<>", rTxt.GetChar( nPos ) ) ) + else if( 256 > cCurrentChar && + strchr( ".)(", cCurrentChar ) ) { + if(cCurrentChar == '(') + nOpeningParentheses++; + else if(cCurrentChar == ')') + nClosingParentheses++; // nur wenn noch keine Zahlen gelesen wurden! if( pPreFix && !( eScan & ( NO_DELIM | CHG )) ) *pPreFix += rTxt.GetChar( nPos ); @@ -1130,7 +1138,8 @@ CHECK_ROMAN_5: ++nPos; } if( !( CHG & eScan ) || rPos == nPos || - nPos == rTxt.Len() || !IsSpace( rTxt.GetChar( nPos ) )) + nPos == rTxt.Len() || !IsSpace( rTxt.GetChar( nPos ) ) || + (nOpeningParentheses > nClosingParentheses)) return USHRT_MAX; if( (NO_DELIM & eScan) && pPreFix ) // den letzen nicht vergessen |