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
6d694d8e
Commit
6d694d8e
authored
Jan 29, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Jan 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and fix listview ellipsification of large text labels.
parent
6e5f6d0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
listview.c
dlls/comctl32/listview.c
+9
-14
No files found.
dlls/comctl32/listview.c
View file @
6d694d8e
...
...
@@ -3187,22 +3187,17 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem,
rcWidth
=
max
(
0
,
rcItem
.
right
-
rcItem
.
left
);
if
(
nLabelWidth
>
rcWidth
)
{
INT
i
,
len
,
eos
,
nCharsFit
;
/* give or take a couple, how many average sized chars would fit? */
nCharsFit
=
tm
.
tmAveCharWidth
>
0
?
(
rcWidth
/
tm
.
tmAveCharWidth
)
+
2
:
0
;
/* place the ellipse accordingly, without overrunning the buffer */
len
=
strlenW
(
szDispText
);
eos
=
min
((
nCharsFit
>
1
&&
nCharsFit
<
len
)
?
nCharsFit
+
3
:
len
+
2
,
sizeof
(
szDispText
)
/
sizeof
(
WCHAR
)
-
1
);
nLabelWidth
=
ListView_GetStringWidthW
(
hwnd
,
szDispText
);
while
((
nLabelWidth
>
rcWidth
)
&&
(
eos
>
3
))
INT
nCharsFit
=
tm
.
tmAveCharWidth
>
0
?
rcWidth
/
tm
.
tmAveCharWidth
+
2
:
0
;
INT
eos
=
min
(
strlenW
(
lvItem
.
pszText
),
nCharsFit
);
if
(
eos
>
0
)
lvItem
.
pszText
[
eos
-
1
]
=
'.'
;
if
(
eos
>
1
)
lvItem
.
pszText
[
eos
-
2
]
=
'.'
;
if
(
eos
<
3
)
lvItem
.
pszText
[
eos
]
=
'\0'
;
for
(
;
eos
>
2
;
eos
--
)
{
for
(
i
=
1
;
i
<
4
;
i
++
)
szDispText
[
eos
-
i
]
=
'.'
;
/* shift the ellipse one char to the left for each iteration */
szDispText
[
eos
--
]
=
'\0'
;
nLabelWidth
=
ListView_GetStringWidthW
(
hwnd
,
szDispText
);
lvItem
.
pszText
[
eos
-
3
]
=
'.'
;
lvItem
.
pszText
[
eos
]
=
'\0'
;
if
(
ListView_GetStringWidthW
(
hwnd
,
lvItem
.
pszText
)
<=
rcWidth
)
break
;
}
}
...
...
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