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
9c6bcec5
Commit
9c6bcec5
authored
Jun 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement GetStoryLength().
parent
7be11594
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
6 deletions
+88
-6
richole.c
dlls/riched20/richole.c
+19
-6
richole.c
dlls/riched20/tests/richole.c
+69
-0
No files found.
dlls/riched20/richole.c
View file @
9c6bcec5
...
...
@@ -312,6 +312,15 @@ static HRESULT create_textfont(ITextRange*, const ITextFontImpl*, ITextFont**);
static
HRESULT
create_textpara
(
ITextRange
*
,
ITextPara
**
);
static
ITextSelectionImpl
*
CreateTextSelection
(
IRichEditOleImpl
*
);
static
HRESULT
textrange_get_storylength
(
ME_TextEditor
*
editor
,
LONG
*
length
)
{
if
(
!
length
)
return
E_INVALIDARG
;
*
length
=
ME_GetTextLength
(
editor
)
+
1
;
return
S_OK
;
}
static
void
textranges_update_ranges
(
IRichEditOleImpl
*
reole
,
LONG
start
,
LONG
end
,
enum
range_update_op
op
)
{
ITextRangeImpl
*
range
;
...
...
@@ -1897,14 +1906,16 @@ static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *pPara)
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ITextRange_fnGetStoryLength
(
ITextRange
*
me
,
LONG
*
pcc
h
)
static
HRESULT
WINAPI
ITextRange_fnGetStoryLength
(
ITextRange
*
me
,
LONG
*
lengt
h
)
{
ITextRangeImpl
*
This
=
impl_from_ITextRange
(
me
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
length
);
if
(
!
This
->
child
.
reole
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented %p
\n
"
,
This
);
return
E_NOTIMPL
;
return
textrange_get_storylength
(
This
->
child
.
reole
->
editor
,
length
);
}
static
HRESULT
WINAPI
ITextRange_fnGetStoryType
(
ITextRange
*
me
,
LONG
*
value
)
...
...
@@ -4364,14 +4375,16 @@ static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pP
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ITextSelection_fnGetStoryLength
(
ITextSelection
*
me
,
LONG
*
pcc
h
)
static
HRESULT
WINAPI
ITextSelection_fnGetStoryLength
(
ITextSelection
*
me
,
LONG
*
lengt
h
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
length
);
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
return
textrange_get_storylength
(
This
->
reOle
->
editor
,
length
);
}
static
HRESULT
WINAPI
ITextSelection_fnGetStoryType
(
ITextSelection
*
me
,
LONG
*
value
)
...
...
dlls/riched20/tests/richole.c
View file @
9c6bcec5
...
...
@@ -3109,6 +3109,74 @@ static void test_InsertObject(void)
release_interfaces
(
&
hwnd
,
&
reole
,
&
doc
,
NULL
);
}
static
void
test_GetStoryLength
(
void
)
{
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
doc
=
NULL
;
ITextSelection
*
selection
;
ITextRange
*
range
;
LONG
value
;
HRESULT
hr
;
HWND
hwnd
;
create_interfaces
(
&
hwnd
,
&
reOle
,
&
doc
,
&
selection
);
SendMessageA
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
SendMessageA
(
hwnd
,
EM_SETSEL
,
1
,
2
);
hr
=
ITextDocument_Range
(
doc
,
0
,
4
,
&
range
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITextRange_GetStoryLength
(
range
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
value
=
0
;
hr
=
ITextRange_GetStoryLength
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
13
,
"got %d
\n
"
,
value
);
hr
=
ITextSelection_GetStoryLength
(
selection
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
value
=
0
;
hr
=
ITextSelection_GetStoryLength
(
selection
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
13
,
"got %d
\n
"
,
value
);
SendMessageA
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
""
);
value
=
0
;
hr
=
ITextRange_GetStoryLength
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
1
,
"got %d
\n
"
,
value
);
value
=
0
;
hr
=
ITextSelection_GetStoryLength
(
selection
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
1
,
"got %d
\n
"
,
value
);
release_interfaces
(
&
hwnd
,
&
reOle
,
&
doc
,
NULL
);
hr
=
ITextRange_GetStoryLength
(
range
,
NULL
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
value
=
100
;
hr
=
ITextRange_GetStoryLength
(
range
,
&
value
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
100
,
"got %d
\n
"
,
value
);
hr
=
ITextSelection_GetStoryLength
(
selection
,
NULL
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
value
=
100
;
hr
=
ITextSelection_GetStoryLength
(
selection
,
&
value
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
100
,
"got %d
\n
"
,
value
);
ITextSelection_Release
(
selection
);
ITextRange_Release
(
range
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -3142,4 +3210,5 @@ START_TEST(richole)
test_GetStoryType
();
test_SetFont
();
test_InsertObject
();
test_GetStoryLength
();
}
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