~ubuntu-branches/ubuntu/precise/xerces-c/precise-security

« back to all changes in this revision

Viewing changes to src/xercesc/util/regx/RangeToken.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-02-06 16:46:23 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100206164623-xbntkcs6ks20nboa
Tags: 3.1.0-1
* New upstream release
* Updated standards version to 3.8.4.  No changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
6
 * (the "License"); you may not use this file except in compliance with
7
7
 * the License.  You may obtain a copy of the License at
8
 
 * 
 
8
 *
9
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 * 
 
10
 *
11
11
 * Unless required by applicable law or agreed to in writing, software
12
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
16
 */
17
17
 
18
18
/*
19
 
 * $Id: RangeToken.cpp 881702 2009-11-18 09:08:16Z borisk $
 
19
 * $Id: RangeToken.cpp 901107 2010-01-20 08:45:02Z borisk $
20
20
 */
21
21
 
22
22
// ---------------------------------------------------------------------------
55
55
//  RangeToken: Constructors and Destructors
56
56
// ---------------------------------------------------------------------------
57
57
RangeToken::RangeToken(const Token::tokType tkType,
58
 
                       MemoryManager* const manager) 
 
58
                       MemoryManager* const manager)
59
59
    : Token(tkType, manager)
60
60
    , fSorted(false)
61
61
    , fCompacted(false)
158
158
 
159
159
        bool isNRange = (getTokenType() == T_NRANGE) ? true : false;
160
160
        RangeToken* lwrToken = tokFactory->createRange(isNRange);
161
 
        unsigned int exceptIndex = 0;
162
161
 
163
162
#if XERCES_USE_TRANSCODER_ICU && ((U_ICU_VERSION_MAJOR_NUM > 2) || (U_ICU_VERSION_MAJOR_NUM == 2 && U_ICU_VERSION_MINOR_NUM >=4))
164
163
        UChar* rangeStr=(UChar*)fMemoryManager->allocate(40*fElemCount*sizeof(UChar));
165
164
        ArrayJanitor<UChar> janRange(rangeStr, fMemoryManager);
166
165
        int c=0;
167
 
        rangeStr[c++] = chOpenSquare;        
 
166
        rangeStr[c++] = chOpenSquare;
168
167
        for (unsigned int i = 0;  i < fElemCount - 1;  i += 2) {
169
168
            XMLCh buffer[10];
170
169
            XMLSize_t len, j;
218
217
            uset_close(range);
219
218
        }
220
219
#else
 
220
        unsigned int exceptIndex = 0;
 
221
 
221
222
        for (unsigned int i = 0;  i < fElemCount - 1;  i += 2) {
222
223
            for (XMLInt32 ch = fRanges[i];  ch <= fRanges[i + 1];  ++ch) {
223
224
#if XERCES_USE_TRANSCODER_ICU