textsearch.cxx (e2630f2c) | textsearch.cxx (d5645047) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 227 unchanged lines hidden (view full) --- 236 237 if( endPos < searchStr.getLength() ) 238 newEndPos = FindPosInSeq_Impl( offset, endPos ); 239 else 240 newEndPos = in_str.getLength(); 241 242 sres = (this->*fnForward)( in_str, newStartPos, newEndPos ); 243 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 227 unchanged lines hidden (view full) --- 236 237 if( endPos < searchStr.getLength() ) 238 newEndPos = FindPosInSeq_Impl( offset, endPos ); 239 else 240 newEndPos = in_str.getLength(); 241 242 sres = (this->*fnForward)( in_str, newStartPos, newEndPos ); 243 |
244 sal_Int32 nOffsetLength = offset.getLength(); 245 sal_Int32 nStartOffset = 0; |
|
244 for ( int k = 0; k < sres.startOffset.getLength(); k++ ) 245 { | 246 for ( int k = 0; k < sres.startOffset.getLength(); k++ ) 247 { |
246 if (sres.startOffset[k]) 247 sres.startOffset[k] = offset[sres.startOffset[k]]; | 248 nStartOffset = sres.startOffset[k]; 249 if ( nStartOffset ) 250 { 251 if ( nStartOffset < nOffsetLength ) 252 sres.startOffset[k] = offset[nStartOffset]; 253 else 254 sres.startOffset[k] = offset[offset.getLength()-1] +1; 255 } |
248 // JP 20.6.2001: end is ever exclusive and then don't return 249 // the position of the next character - return the 250 // next position behind the last found character! 251 // "a b c" find "b" must return 2,3 and not 2,4!!! 252 if (sres.endOffset[k]) 253 sres.endOffset[k] = offset[sres.endOffset[k]-1] + 1; 254 } 255 } --- 69 unchanged lines hidden (view full) --- 325 else 326 newStartPos = in_str.getLength(); 327 328 if( endPos ) 329 newEndPos = FindPosInSeq_Impl( offset, endPos ); 330 331 sres = (this->*fnBackward)( in_str, newStartPos, newEndPos ); 332 | 256 // JP 20.6.2001: end is ever exclusive and then don't return 257 // the position of the next character - return the 258 // next position behind the last found character! 259 // "a b c" find "b" must return 2,3 and not 2,4!!! 260 if (sres.endOffset[k]) 261 sres.endOffset[k] = offset[sres.endOffset[k]-1] + 1; 262 } 263 } --- 69 unchanged lines hidden (view full) --- 333 else 334 newStartPos = in_str.getLength(); 335 336 if( endPos ) 337 newEndPos = FindPosInSeq_Impl( offset, endPos ); 338 339 sres = (this->*fnBackward)( in_str, newStartPos, newEndPos ); 340 |
341 sal_Int32 nOffsetLength = offset.getLength(); 342 sal_Int32 nEndOffset = 0; |
|
333 for ( int k = 0; k < sres.startOffset.getLength(); k++ ) 334 { 335 if (sres.startOffset[k]) 336 sres.startOffset[k] = offset[sres.startOffset[k] - 1] + 1; 337 // JP 20.6.2001: end is ever exclusive and then don't return 338 // the position of the next character - return the 339 // next position behind the last found character! 340 // "a b c" find "b" must return 2,3 and not 2,4!!! | 343 for ( int k = 0; k < sres.startOffset.getLength(); k++ ) 344 { 345 if (sres.startOffset[k]) 346 sres.startOffset[k] = offset[sres.startOffset[k] - 1] + 1; 347 // JP 20.6.2001: end is ever exclusive and then don't return 348 // the position of the next character - return the 349 // next position behind the last found character! 350 // "a b c" find "b" must return 2,3 and not 2,4!!! |
341 if (sres.endOffset[k]) 342 sres.endOffset[k] = offset[sres.endOffset[k]]; | 351 nEndOffset = sres.endOffset[k]; 352 if ( nEndOffset ) 353 { 354 if ( nEndOffset < nOffsetLength ) 355 sres.endOffset[k] = offset[nEndOffset]; 356 else 357 sres.endOffset[k] = offset[offset.getLength()-1] +1; 358 } |
343 } 344 } 345 else 346 { 347 sres = (this->*fnBackward)( in_str, startPos, endPos ); 348 } 349 350 if ( xTranslit2.is() && aSrchPara.algorithmType != SearchAlgorithms_REGEXP ) --- 679 unchanged lines hidden --- | 359 } 360 } 361 else 362 { 363 sres = (this->*fnBackward)( in_str, startPos, endPos ); 364 } 365 366 if ( xTranslit2.is() && aSrchPara.algorithmType != SearchAlgorithms_REGEXP ) --- 679 unchanged lines hidden --- |