-
Notifications
You must be signed in to change notification settings - Fork 1
/
MULTFIND.CPP
52 lines (40 loc) · 1.17 KB
/
MULTFIND.CPP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "bowl.h"
#include "kerrcoll.h"
#include "cntrladm.h"
#include "editctrl.h"
#include "multfind.h"
BOOL MultipleFilesFind::operateFile( char *filename, View *view, BOOL isVisible )
{
// Add whole document flag
strcat( options, "d" );
BOOL found = view->findString( searchString, options, FALSE );
options[strlen(options)-1] = 0;
if( found )
{
while( found )
{
char line[161];
char *msg = new char[strlen( filename ) + 160 + 30];
int len = 160;
view->getCurrentLine( line, len );
sprintf( msg, "%s (%d, %d) : %s", filename, view->getLine(),
view->getColumn(), line );
KErrorCollector::getInstance()->message( msg );
delete msg;
found = view->findString( searchString, options, FALSE );
}
}
/* else
KErrorCollector::getInstance()->message( filename );*/
return TRUE;
}
MultipleFilesFind::MultipleFilesFind( char *searchString, char *options ) :
searchString(searchString)
{
this->options = new char[strlen(options)+2];
strcpy( this->options, options );
// Remove whole document flag
char *d = strchr( this->options, 'd' );
if( d )
*d = '_';
}