diff --git a/ChangeLog b/ChangeLog index 35e3f60..73dc14d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ + + +=Version 1.0.0= + + + +=Version 0.9.12= + 2010-08-16 David Freese 47e1b4a: Radiogram CK @@ -38,4 +46,3 @@ =Version 0.9.05= - 2f8997b: Radiogram update diff --git a/configure.ac b/configure.ac index 63d9104..71e5cfe 100644 --- a/configure.ac +++ b/configure.ac @@ -10,9 +10,9 @@ AC_PREREQ([2.63]) dnl major and minor must be integers; patch may dnl contain other characters or be empty -m4_define(FLMSG_MAJOR, [0]) -m4_define(FLMSG_MINOR, [9]) -m4_define(FLMSG_PATCH, [.12]) +m4_define(FLMSG_MAJOR, [1]) +m4_define(FLMSG_MINOR, [0]) +m4_define(FLMSG_PATCH, [.0]) AC_INIT([FLMSG], FLMSG_MAJOR.FLMSG_MINOR[]FLMSG_PATCH, [w1hkj AT w1hkj DOT com]) diff --git a/scripts/mkappbundle.sh b/scripts/mkappbundle.sh index 363f65f..9d7cd61 100755 --- a/scripts/mkappbundle.sh +++ b/scripts/mkappbundle.sh @@ -107,8 +107,8 @@ name=$(echo "$PACKAGE_TARNAME" | upcase1) signature="$(echo $PACKAGE_TARNAME | sed 's/[aeiouAEIOU]//g; s/\(^....\).*/\1/')" binary="$PACKAGE_TARNAME" icon="$flmsg_icon" -version="${flmsg_VERSION_MAJOR}.${flmsg_VERSION_MINOR}" -appversion="$flmsg_VERSION" +version="${FLMSG_VERSION_MAJOR}.${FLMSG_VERSION_MINOR}" +appversion="$FLMSG_VERSION" bundle diff --git a/src/flmsg.cxx b/src/flmsg.cxx index 7cb1915..f6d20b2 100644 --- a/src/flmsg.cxx +++ b/src/flmsg.cxx @@ -409,6 +409,8 @@ int main(int argc, char *argv[]) } mainwindow = ics_dialog(); + mainwindow->callback(exit_main); + configwindow = config_dialog(); char dirbuf[FL_PATH_MAX + 1]; diff --git a/src/ics213.cxx b/src/ics213.cxx index 3593bdc..c3c6919 100644 --- a/src/ics213.cxx +++ b/src/ics213.cxx @@ -502,6 +502,7 @@ void cb_ics_write() void cb_ics_html() { string icsname = ICS_dir; + string html_text = ""; icsname.append("ics213_doc.html"); update_fields(); @@ -532,10 +533,11 @@ void cb_ics_html() for (int i = 0; i < numfields - 2; i++) { pos = form.find(fields[i].f_type); - if (pos != string::npos) - form.replace( pos, - strlen(fields[i].f_type), - fields[i].f_data ); + if (pos != string::npos) { + html_text = fields[i].f_data; + to_html(html_text); + form.replace( pos, strlen(fields[i].f_type), html_text); + } } pos = form.find(fields[numfields-2].f_type); if (pos) diff --git a/src/parse_xml.cxx b/src/parse_xml.cxx index ac5a7ea..bdaec18 100644 --- a/src/parse_xml.cxx +++ b/src/parse_xml.cxx @@ -68,21 +68,51 @@ void trim (string &s) } } -struct HTMLSPEC { const char *c; const char *str; }; -HTMLSPEC htmlspec[] = { +struct xmlspec { const char *c; const char *str; }; + +xmlspec xmlspecial[] = { {"&", "&" }, // must be first substitution {"\'", "'"}, {"\"", """}, { 0, 0 }}; +void to_xml(string &s) +{ + size_t pos; + for (int i = 0; i < 3; i++) { + pos = 0; + while ((pos = s.find(xmlspecial[i].c, pos)) != string::npos) { + s.replace(pos, 1, xmlspecial[i].str); + pos += strlen(xmlspecial[i].str); + } + } +} + +void fm_xml(string &s) +{ + size_t pos = 0; + for (int i = 0; i < 3; i++) { + pos = 0; + while ((pos = s.find(xmlspecial[i].str, pos)) != string::npos) { + s.replace(pos, strlen(xmlspecial[i].str), xmlspecial[i].c); + pos += strlen(xmlspecial[i].c); + } + } +} + +xmlspec htmlspecial[] = { +{"&", "&" }, // must be first substitution +{"\"", """}, +{ 0, 0 }}; + void to_html(string &s) { size_t pos; - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 2; i++) { pos = 0; - while ((pos = s.find(htmlspec[i].c, pos)) != string::npos) { - s.replace(pos, 1, htmlspec[i].str); - pos += strlen(htmlspec[i].str); + while ((pos = s.find(htmlspecial[i].c, pos)) != string::npos) { + s.replace(pos, 1, htmlspecial[i].str); + pos += strlen(htmlspecial[i].str); } } } @@ -90,11 +120,11 @@ void to_html(string &s) void fm_html(string &s) { size_t pos = 0; - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 2; i++) { pos = 0; - while ((pos = s.find(htmlspec[i].str, pos)) != string::npos) { - s.replace(pos, strlen(htmlspec[i].str), htmlspec[i].c); - pos += strlen(htmlspec[i].c); + while ((pos = s.find(htmlspecial[i].str, pos)) != string::npos) { + s.replace(pos, strlen(htmlspecial[i].str), htmlspecial[i].c); + pos += strlen(htmlspecial[i].c); } } } @@ -344,11 +374,11 @@ void parse_ics_para(size_t &p0, string xml) string contents = get_element(p0, xml).c_str(); switch (ics_pmode) { case MSG: - fm_html(contents); + fm_xml(contents); ics_xml_msg.append(contents).append("\n"); break; case REPLY: - fm_html(contents); + fm_xml(contents); xml_reply.append(contents).append("\n"); break; default : ; @@ -637,7 +667,7 @@ void qform_ics_export(string fname) lines.append(""); while ((pos = lines.find("\n")) != string::npos) lines.replace(pos, 1, ""); - to_html(lines); + to_xml(lines); qexport.replace( qexport.find("?MG?"), 4, lines); lines = ""; @@ -645,7 +675,7 @@ void qform_ics_export(string fname) lines.append(""); while ((pos = lines.find("\n")) != string::npos) lines.replace(pos, 1, ""); - to_html(lines); + to_xml(lines); qexport.replace( qexport.find("?RP?"), 4, lines); xmlfile = fopen(fname.c_str(), "w"); @@ -894,15 +924,15 @@ void parse_rg_line(size_t &p0, string xml) string contents = get_element(p0, xml).c_str(); switch (rg_pmode) { case RECEIVEDAT: - fm_html(contents); + fm_xml(contents); rg_xml_rx.append(contents).append("\n"); break; case ADDRESS: - fm_html(contents); + fm_xml(contents); rg_xml_to.append(contents).append("\n"); break; case BODY: - fm_html(contents); + fm_xml(contents); rg_xml_msg.append(contents).append("\n"); break; case FILED: @@ -940,15 +970,15 @@ void parse_rg_para(size_t &p0, string xml) string contents = get_element(p0, xml); switch (rg_pmode) { case RECEIVEDAT: - fm_html(contents); + fm_xml(contents); rg_xml_rx.append(contents).append("\n"); break; case ADDRESS: - fm_html(contents); + fm_xml(contents); rg_xml_to.append(contents).append("\n"); break; case BODY: - fm_html(contents); + fm_xml(contents); rg_xml_msg.append(contents).append("\n"); break; case FILED: @@ -1208,7 +1238,7 @@ void qform_rg_export(string fname) else { lines = rg_fields[7].f_data; xml_lines(lines, "line"); - to_html(lines); + to_xml(lines); } qexport.replace( qexport.find("?AD?"), 4, lines); qexport.replace( qexport.find("?PH?"), 4, rg_fields[8].f_data); @@ -1218,7 +1248,7 @@ void qform_rg_export(string fname) else { lines = rg_fields[10].f_data; xml_lines(lines, "para"); - to_html(lines); + to_xml(lines); } qexport.replace( qexport.find("?BD?"), 4, lines); @@ -1228,7 +1258,7 @@ void qform_rg_export(string fname) lines.append("").append(progStatus.my_addr).append("\n"); lines.append("").append(progStatus.my_city).append("\n"); lines.append("").append(progStatus.my_tel).append(""); - to_html(lines); + to_xml(lines); qexport.replace( qexport.find("?RA?"), 4, lines); qexport.replace( qexport.find("?NM?"), 4, rg_fields[11].f_data); diff --git a/src/radiogram.cxx b/src/radiogram.cxx index 0a975b0..425d574 100644 --- a/src/radiogram.cxx +++ b/src/radiogram.cxx @@ -572,6 +572,8 @@ void cb_rg_check() void cb_rg_html() { string rgname; + string MSG; + string html_text; int nbr; rgname = ICS_dir; rgname.append("radiogram.html"); @@ -582,7 +584,7 @@ void cb_rg_html() size_t pos; for (int i = 0; i < num_rg_fields; i++) { if (rg_fields[i].w_type == 'e' || rg_fields[i].w_type == 't') { - string MSG = rg_fields[i].f_data; + MSG = rg_fields[i].f_data; size_t pos2 = MSG.find('\n'); while (pos2 != string::npos) { MSG.replace(pos2, 1, "
"); @@ -597,9 +599,11 @@ void cb_rg_html() if ((pos = form.find(rg_fields[i].f_type)) != string::npos) form.replace( pos, strlen(rg_fields[i].f_type), s_prec[nbr] ); } else { - if ((pos = form.find(rg_fields[i].f_type)) != string::npos) - form.replace( pos, strlen(rg_fields[i].f_type), - rg_fields[i].f_data ); + if ((pos = form.find(rg_fields[i].f_type)) != string::npos) { + html_text = rg_fields[i].f_data; + to_html(html_text); + form.replace( pos, strlen(rg_fields[i].f_type), html_text ); + } } } @@ -622,6 +626,8 @@ void cb_rg_html() void cb_rg_html_fcopy() { string rgname; + string MSG = ""; + string html_text; int nbr; rgname = ICS_dir; rgname.append("rg_file_copy.html"); @@ -632,7 +638,7 @@ void cb_rg_html_fcopy() size_t pos; for (int i = 0; i < num_rg_fields; i++) { if (rg_fields[i].w_type == 'e' || rg_fields[i].w_type == 't') { - string MSG = rg_fields[i].f_data; + MSG = rg_fields[i].f_data; size_t pos2 = MSG.find('\n'); while (pos2 != string::npos) { MSG.replace(pos2, 1, "
"); @@ -647,9 +653,11 @@ void cb_rg_html_fcopy() if ((pos = form.find(rg_fields[i].f_type)) != string::npos) form.replace( pos, strlen(rg_fields[i].f_type), s_prec[nbr] ); } else { - if ((pos = form.find(rg_fields[i].f_type)) != string::npos) - form.replace( pos, strlen(rg_fields[i].f_type), - rg_fields[i].f_data ); + if ((pos = form.find(rg_fields[i].f_type)) != string::npos) { + html_text = rg_fields[i].f_data; + to_html(html_text); + form.replace( pos, strlen(rg_fields[i].f_type), html_text ); + } } }