Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
aaa33623
Commit
aaa33623
authored
Apr 21, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file pointer not reused
parent
c06abeb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
44 deletions
+75
-44
src/exe/co_convert/src/cnv_xtthelptohtml.cpp
src/exe/co_convert/src/cnv_xtthelptohtml.cpp
+71
-42
src/exe/co_convert/src/cnv_xtthelptohtml.h
src/exe/co_convert/src/cnv_xtthelptohtml.h
+4
-2
No files found.
src/exe/co_convert/src/cnv_xtthelptohtml.cpp
View file @
aaa33623
...
...
@@ -69,19 +69,19 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
if
(
(
text2
&&
strcmp
(
text2
,
""
)
!=
0
)
||
(
text3
&&
strcmp
(
text3
,
""
)
!=
0
)
)
{
if
(
!
in_table
)
{
fp
<<
"<TABLE>"
<<
endl
;
if
(
!
in_table
&&
cf
)
{
cf
->
f
<<
"<TABLE>"
<<
endl
;
in_table
=
1
;
}
}
else
{
if
(
in_table
)
{
if
(
in_table
&&
cf
)
{
// Close table (keep if empty line)
if
(
!
(
text1
&&
strcmp
(
text1
,
""
)
==
0
&&
(
item_type
==
navh_eItemType_Help
||
item_type
==
navh_eItemType_HelpCode
||
item_type
==
navh_eItemType_HelpBold
)))
{
fp
<<
"</TABLE>"
<<
endl
;
cf
->
f
<<
"</TABLE>"
<<
endl
;
in_table
=
0
;
}
}
...
...
@@ -92,8 +92,9 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
pwr_tFileName
fname
;
subject_to_fname
(
fname
,
text1
,
1
);
fp
.
open
(
fname
);
fp
<<
cf
=
new
CnvFile
();
cf
->
f
.
open
(
fname
);
cf
->
f
<<
"<!DOCTYPE HTML PUBLIC
\"
-//W3C//DTD HTML 4.0 Transitional//EN
\"\"
http://www.w3.org/TR/REC-html40/loose.dtd>"
<<
endl
<<
"<!--NewPage-->"
<<
endl
<<
"<HTML>"
<<
endl
<<
...
...
@@ -110,12 +111,19 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
}
case
navh_eItemType_EndTopic
:
{
fp
.
close
();
if
(
!
cf
)
break
;
cf
->
f
.
close
();
delete
cf
;
cf
=
0
;
return
NULL
;
}
case
navh_eItemType_Help
:
case
navh_eItemType_HelpCode
:
{
if
(
!
cf
)
break
;
if
(
strcmp
(
link
,
""
)
!=
0
)
{
pwr_tFileName
fname
;
...
...
@@ -138,41 +146,46 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
strcat
(
fname
,
link_bookmark
);
}
}
fp
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
cf
->
f
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
}
else
if
(
bookmark
)
{
fp
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
cf
->
f
<<
"</TABLE>"
<<
endl
;
in_table
=
0
;
cf
->
f
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
}
if
(
!
in_table
)
{
fp
<<
text1
;
cf
->
f
<<
text1
;
if
(
strcmp
(
link
,
""
)
!=
0
||
bookmark
)
fp
<<
"<BR></A>"
<<
endl
;
cf
->
f
<<
"<BR></A>"
<<
endl
;
else
fp
<<
"<BR>"
<<
endl
;
cf
->
f
<<
"<BR>"
<<
endl
;
}
else
{
fp
<<
"<TR><TD>"
<<
text1
;
cf
->
f
<<
"<TR><TD>"
<<
text1
;
if
(
strcmp
(
text2
,
""
)
!=
0
||
strcmp
(
text3
,
""
)
!=
0
)
{
for
(
i
=
0
;
i
<
(
int
)(
CNV_TAB
-
strlen
(
text1
));
i
++
)
fp
<<
" "
;
fp
<<
" </TD><TD>"
<<
text2
;
cf
->
f
<<
" "
;
cf
->
f
<<
" </TD><TD>"
<<
text2
;
if
(
strcmp
(
text3
,
""
)
!=
0
)
{
for
(
i
=
0
;
i
<
(
int
)(
CNV_TAB
-
strlen
(
text2
));
i
++
)
fp
<<
" "
;
fp
<<
" </TD><TD>"
<<
text3
;
cf
->
f
<<
" "
;
cf
->
f
<<
" </TD><TD>"
<<
text3
;
}
}
fp
<<
"</TD></TR>"
;
cf
->
f
<<
"</TD></TR>"
;
if
(
strcmp
(
link
,
""
)
!=
0
||
bookmark
)
fp
<<
"</A>"
<<
endl
;
cf
->
f
<<
"</A>"
<<
endl
;
else
fp
<<
endl
;
cf
->
f
<<
endl
;
}
return
NULL
;
}
case
navh_eItemType_HelpBold
:
{
if
(
!
cf
)
break
;
pwr_tFileName
fname
;
if
(
strcmp
(
link
,
""
)
!=
0
)
{
if
(
strncmp
(
link
,
"$web:"
,
5
)
==
0
)
{
...
...
@@ -193,75 +206,91 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
}
}
if
(
!
in_table
)
fp
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
cf
->
f
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
}
else
if
(
bookmark
)
{
if
(
!
in_table
)
fp
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
cf
->
f
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
}
if
(
!
in_table
)
{
fp
<<
"<B>"
<<
text1
<<
"</B>"
;
cf
->
f
<<
"<B>"
<<
text1
<<
"</B>"
;
if
(
strcmp
(
link
,
""
)
!=
0
||
bookmark
)
fp
<<
"<BR></A>"
<<
endl
;
cf
->
f
<<
"<BR></A>"
<<
endl
;
else
fp
<<
"<BR>"
<<
endl
;
cf
->
f
<<
"<BR>"
<<
endl
;
}
else
{
fp
<<
"<TR><TD><B>"
;
cf
->
f
<<
"<TR><TD><B>"
;
if
(
strcmp
(
link
,
""
)
!=
0
)
fp
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
cf
->
f
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
>"
;
else
if
(
bookmark
!=
0
)
fp
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
fp
<<
text1
;
cf
->
f
<<
"<A NAME=
\"
"
<<
bookmark
<<
"
\"
>"
;
cf
->
f
<<
text1
;
if
(
strcmp
(
link
,
""
)
!=
0
||
bookmark
)
fp
<<
"</A>"
;
cf
->
f
<<
"</A>"
;
if
(
strcmp
(
text2
,
""
)
!=
0
||
strcmp
(
text3
,
""
)
!=
0
)
{
for
(
i
=
0
;
i
<
(
int
)(
CNV_TAB
-
strlen
(
text1
));
i
++
)
fp
<<
" "
;
fp
<<
" </B></TD><TD><B>"
<<
text2
;
cf
->
f
<<
" "
;
cf
->
f
<<
" </B></TD><TD><B>"
<<
text2
;
if
(
strcmp
(
text3
,
""
)
!=
0
)
{
for
(
i
=
0
;
i
<
(
int
)(
CNV_TAB
-
strlen
(
text2
));
i
++
)
fp
<<
" "
;
fp
<<
" </B></TD><TD><B>"
<<
text3
;
cf
->
f
<<
" "
;
cf
->
f
<<
" </B></TD><TD><B>"
<<
text3
;
}
}
fp
<<
"</B></TD></TR>"
;
cf
->
f
<<
"</B></TD></TR>"
;
if
(
strcmp
(
link
,
""
)
!=
0
||
bookmark
)
fp
<<
"</A>"
<<
endl
;
cf
->
f
<<
"</A>"
<<
endl
;
else
fp
<<
endl
;
cf
->
f
<<
endl
;
}
return
NULL
;
}
case
navh_eItemType_HelpHeader
:
{
fp
<<
"<H1>"
<<
text1
<<
"</H1><BR>"
<<
endl
;
if
(
!
cf
)
break
;
cf
->
f
<<
"<H1>"
<<
text1
<<
"</H1><BR>"
<<
endl
;
return
NULL
;
}
case
navh_eItemType_Header
:
{
fp
<<
"<H3>"
<<
text1
<<
"</H3><BR>"
<<
endl
;
if
(
!
cf
)
break
;
cf
->
f
<<
"<H3>"
<<
text1
<<
"</H3><BR>"
<<
endl
;
return
NULL
;
}
case
navh_eItemType_HeaderLarge
:
{
fp
<<
"<H2>"
<<
text1
<<
"</H2><BR>"
<<
endl
;
if
(
!
cf
)
break
;
cf
->
f
<<
"<H2>"
<<
text1
<<
"</H2><BR>"
<<
endl
;
return
NULL
;
}
case
navh_eItemType_HorizontalLine
:
{
fp
<<
"<HR>"
<<
endl
;
if
(
!
cf
)
break
;
cf
->
f
<<
"<HR>"
<<
endl
;
return
NULL
;
}
case
navh_eItemType_Image
:
{
fp
<<
"<IMG SRC=
\"
"
<<
text1
<<
"
\"
><BR>"
<<
endl
;
if
(
!
cf
)
break
;
cf
->
f
<<
"<IMG SRC=
\"
"
<<
text1
<<
"
\"
><BR>"
<<
endl
;
return
NULL
;
}
default:
return
0
;
}
return
0
;
}
...
...
src/exe/co_convert/src/cnv_xtthelptohtml.h
View file @
aaa33623
...
...
@@ -14,6 +14,7 @@ extern "C" {
#endif
#include "pwr.h"
#include "cnv_file.h"
#include "cnv_xtthelpto.h"
using
namespace
std
;
...
...
@@ -23,7 +24,7 @@ class CnvCtx;
class
CnvXtthelpToHtml
:
public
CnvXtthelpTo
{
public:
CnvXtthelpToHtml
(
CnvCtx
*
cnv_ctx
)
:
ctx
(
cnv_ctx
)
{}
ctx
(
cnv_ctx
)
,
cf
(
0
)
{}
virtual
~
CnvXtthelpToHtml
()
{}
Cnv_eXtthelpToType
type
()
{
return
Cnv_eXtthelpToType_Html
;}
...
...
@@ -35,7 +36,8 @@ class CnvXtthelpToHtml : public CnvXtthelpTo {
void
subject_to_fname
(
char
*
fname
,
char
*
subject
,
int
path
);
CnvCtx
*
ctx
;
ofstream
fp
;
CnvFile
*
cf
;
// ofstream fp;
};
#if defined __cplusplus
...
...
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