Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c4c35d33
Commit
c4c35d33
authored
Aug 11, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
infosoft: Use the pfnFillTextBuffer function to refresh the buffer.
parent
510fc118
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
22 deletions
+54
-22
wordbreaker.c
dlls/infosoft/wordbreaker.c
+54
-22
No files found.
dlls/infosoft/wordbreaker.c
View file @
c4c35d33
...
...
@@ -87,35 +87,67 @@ static HRESULT WINAPI wb_Init( IWordBreaker *iface,
return
S_OK
;
}
static
HRESULT
WINAPI
wb_BreakText
(
IWordBreaker
*
iface
,
TEXT_SOURCE
*
pTextSource
,
IWordSink
*
pWordSink
,
IPhraseSink
*
pPhraseSink
)
static
HRESULT
call_sink
(
IWordSink
*
pWordSink
,
TEXT_SOURCE
*
ts
,
UINT
len
)
{
LPCWSTR
p
,
q
;
DWORD
len
;
HRESULT
r
;
FIXME
(
"%p %p %p
\n
"
,
pTextSource
,
pWordSink
,
pPhraseSink
);
if
(
!
len
)
return
S_OK
;
p
=
pTextSource
->
awcBuffer
;
TRACE
(
"%d %s
\n
"
,
len
,
debugstr_w
(
&
ts
->
awcBuffer
[
ts
->
iCur
]))
;
while
(
*
p
)
{
/* skip spaces and punctuation */
while
(
ispunctW
(
*
p
)
||
isspaceW
(
*
p
))
p
++
;
r
=
IWordSink_PutWord
(
pWordSink
,
len
,
&
ts
->
awcBuffer
[
ts
->
iCur
],
len
,
ts
->
iCur
);
ts
->
iCur
+=
len
;
return
r
;
}
/* find the end of the word */
q
=
p
;
while
(
*
q
&&
!
ispunctW
(
*
q
)
&&
!
isspaceW
(
*
q
))
q
++
;
static
HRESULT
WINAPI
wb_BreakText
(
IWordBreaker
*
iface
,
TEXT_SOURCE
*
ts
,
IWordSink
*
pWordSink
,
IPhraseSink
*
pPhraseSink
)
{
UINT
len
,
state
=
0
;
WCHAR
ch
;
len
=
q
-
p
;
if
(
!
len
)
break
;
TRACE
(
"%p %p %p
\n
"
,
ts
,
pWordSink
,
pPhraseSink
);
IWordSink_PutWord
(
pWordSink
,
len
,
p
,
len
,
p
-
pTextSource
->
awcBuffer
);
if
(
pPhraseSink
)
FIXME
(
"IPhraseSink won't be called
\n
"
);
do
{
len
=
0
;
while
((
ts
->
iCur
+
len
)
<
ts
->
iEnd
)
{
ch
=
ts
->
awcBuffer
[
ts
->
iCur
+
len
];
switch
(
state
)
{
case
0
:
/* skip spaces and punctuation */
if
(
!
ch
||
ispunctW
(
ch
)
||
isspaceW
(
ch
))
ts
->
iCur
++
;
else
state
=
1
;
break
;
case
1
:
/* find the end of the word */
if
(
ch
&&
!
ispunctW
(
ch
)
&&
!
isspaceW
(
ch
))
len
++
;
else
{
call_sink
(
pWordSink
,
ts
,
len
);
len
=
0
;
state
=
0
;
}
break
;
}
}
call_sink
(
pWordSink
,
ts
,
len
);
}
while
(
S_OK
==
ts
->
pfnFillTextBuffer
(
ts
));
p
=
q
;
}
return
S_OK
;
}
...
...
@@ -152,7 +184,7 @@ HRESULT WINAPI wb_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID *ppvObjec
wordbreaker_impl
*
This
;
IWordBreaker
*
wb
;
FIXM
E
(
"%p %s %p
\n
"
,
pUnkOuter
,
debugstr_guid
(
riid
),
ppvObject
);
TRAC
E
(
"%p %s %p
\n
"
,
pUnkOuter
,
debugstr_guid
(
riid
),
ppvObject
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment