Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
706145c5
Commit
706145c5
authored
Apr 10, 2016
by
Jean-Christophe Cardot
Committed by
Alexandre Julliard
Apr 12, 2016
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhlp32: Fix table formatting.
Signed-off-by:
Jean-Christophe Cardot
<
wine@cardot.net
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a01c0030
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
23 deletions
+31
-23
hlpfile.c
programs/winhlp32/hlpfile.c
+31
-23
No files found.
programs/winhlp32/hlpfile.c
View file @
706145c5
...
...
@@ -1216,9 +1216,8 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
char
*
text
,
*
text_base
,
*
text_end
;
LONG
size
,
blocksize
,
datalen
;
unsigned
short
bits
;
unsigned
nc
,
ncol
=
1
;
short
table_width
;
BOOL
in_table
=
FALSE
;
unsigned
ncol
=
1
;
short
nc
,
lastcol
,
table_width
;
char
tmp
[
256
];
BOOL
ret
=
FALSE
;
...
...
@@ -1262,9 +1261,8 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
if
(
buf
[
0x14
]
==
HLP_TABLE
)
{
char
type
;
unsigned
char
type
;
in_table
=
TRUE
;
ncol
=
*
format
++
;
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
trowd"
))
goto
done
;
...
...
@@ -1273,6 +1271,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
{
table_width
=
GET_SHORT
(
format
,
0
);
format
+=
2
;
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
trqc"
))
goto
done
;
}
else
table_width
=
32767
;
...
...
@@ -1282,10 +1281,10 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
{
int
pos
;
sprintf
(
tmp
,
"
\\
trgaph%d
\\
trleft%d"
,
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
GET_SHORT
(
format
,
6
),
table_width
,
32767
)
),
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
GET_SHORT
(
format
,
0
),
table_width
,
32767
))
);
MulDiv
(
HLPFILE_HalfPointsScale
(
page
,
GET_SHORT
(
format
,
6
)),
table_width
,
32767
),
MulDiv
(
HLPFILE_HalfPointsScale
(
page
,
GET_SHORT
(
format
,
2
)
-
GET_SHORT
(
format
,
6
)),
table_width
,
32767
)
-
1
);
if
(
!
HLPFILE_RtfAddControl
(
rd
,
tmp
))
goto
done
;
pos
=
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
GET_SHORT
(
format
,
6
)
/
2
,
table_width
,
32767
))
;
pos
=
GET_SHORT
(
format
,
6
)
/
2
;
for
(
nc
=
0
;
nc
<
ncol
;
nc
++
)
{
WINE_TRACE
(
"column(%d/%d) gap=%d width=%d
\n
"
,
...
...
@@ -1293,7 +1292,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
GET_SHORT
(
format
,
nc
*
4
+
2
));
pos
+=
GET_SHORT
(
format
,
nc
*
4
)
+
GET_SHORT
(
format
,
nc
*
4
+
2
);
sprintf
(
tmp
,
"
\\
cellx%d"
,
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
pos
,
table_width
,
32767
)
));
MulDiv
(
HLPFILE_HalfPointsScale
(
page
,
pos
),
table_width
,
32767
));
if
(
!
HLPFILE_RtfAddControl
(
rd
,
tmp
))
goto
done
;
}
}
...
...
@@ -1302,22 +1301,27 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
WINE_TRACE
(
"column(0/%d) gap=%d width=%d
\n
"
,
ncol
,
GET_SHORT
(
format
,
0
),
GET_SHORT
(
format
,
2
));
sprintf
(
tmp
,
"
\\
trleft%d
\\
cellx%d "
,
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
GET_SHORT
(
format
,
0
),
table_width
,
32767
)),
HLPFILE_HalfPointsScale
(
page
,
MulDiv
(
GET_SHORT
(
format
,
0
)
+
GET_SHORT
(
format
,
2
),
table_width
,
32767
)));
MulDiv
(
HLPFILE_HalfPointsScale
(
page
,
GET_SHORT
(
format
,
2
)),
table_width
,
32767
)
-
1
,
MulDiv
(
HLPFILE_HalfPointsScale
(
page
,
GET_SHORT
(
format
,
0
)),
table_width
,
32767
));
if
(
!
HLPFILE_RtfAddControl
(
rd
,
tmp
))
goto
done
;
}
format
+=
ncol
*
4
;
}
lastcol
=
-
1
;
for
(
nc
=
0
;
nc
<
ncol
;
/**/
)
{
WINE_TRACE
(
"looking for format at offset %lu in column %d
\n
"
,
(
SIZE_T
)(
format
-
(
buf
+
0x15
)),
nc
);
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
pard"
))
goto
done
;
if
(
in_table
)
if
(
buf
[
0x14
]
==
HLP_TABLE
)
{
nc
=
GET_SHORT
(
format
,
0
);
if
(
nc
==
-
1
)
break
;
nc
=
lastcol
=
GET_SHORT
(
format
,
0
);
if
(
nc
==
-
1
)
/* last column */
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
row"
))
goto
done
;
rd
->
char_pos
+=
2
;
break
;
}
format
+=
5
;
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
intbl"
))
goto
done
;
}
...
...
@@ -1436,7 +1440,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
/* else: null text, keep on storing attributes */
text
+=
textsize
+
1
;
WINE_TRACE
(
"format=%02x
\n
"
,
*
format
);
WINE_TRACE
(
"format=
0x
%02x
\n
"
,
*
format
);
if
(
*
format
==
0xff
)
{
format
++
;
...
...
@@ -1490,15 +1494,24 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
break
;
case
0x82
:
if
(
in_table
)
if
(
buf
[
0x14
]
==
HLP_TABLE
)
{
if
(
format
[
1
]
!=
0xFF
)
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
par
\\
intbl"
))
goto
done
;
}
else
if
(
GET_SHORT
(
format
,
2
)
==
-
1
)
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
cell
\\
intbl
\\
row"
))
goto
done
;
rd
->
char_pos
+=
2
;
}
else
if
(
GET_SHORT
(
format
,
2
)
==
lastcol
)
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
par
\\
pard"
))
goto
done
;
}
else
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
cell
\\
pard
\\
intbl
"
))
goto
done
;
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
cell
\\
pard"
))
goto
done
;
}
}
else
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
par"
))
goto
done
;
...
...
@@ -1664,11 +1677,6 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
}
}
}
if
(
in_table
)
{
if
(
!
HLPFILE_RtfAddControl
(
rd
,
"
\\
row
\\
par
\\
pard
\\
plain"
))
goto
done
;
rd
->
char_pos
+=
2
;
}
ret
=
TRUE
;
done:
...
...
Vitaly Lipatov
@lav
mentioned in commit
6440e558
·
Sep 03, 2020
mentioned in commit
6440e558
mentioned in commit 6440e558154be6cbc74d15016fa415990a491228
Toggle commit list
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