summaryrefslogtreecommitdiff
path: root/fluid/io/String_Writer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/io/String_Writer.cxx')
-rw-r--r--fluid/io/String_Writer.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/fluid/io/String_Writer.cxx b/fluid/io/String_Writer.cxx
index 3066aa97b..97245697b 100644
--- a/fluid/io/String_Writer.cxx
+++ b/fluid/io/String_Writer.cxx
@@ -60,26 +60,29 @@ static int write_escaped_strings(FILE *out, const char *text) {
\param[in] filename file path and name to a file that will hold the strings
\return 1 if the file could not be opened for writing, or the result of `fclose`.
*/
-int fld::io::write_strings(Project &proj, const std::string &filename) {
+int fld::io::write_strings(Project &proj, const char *filename) {
Node *p;
Widget_Node *w;
int i;
- FILE *fp = fl_fopen(filename.c_str(), "wb");
+ FILE *fp = fl_fopen(filename, "wb");
if (!fp) return 1;
switch (proj.i18n.type) {
case FLD_I18N_TYPE_NONE : /* None, just put static text out */
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
- for (auto w: proj.tree.all_widgets()) {
- if (w->label()) {
- write_escaped_strings(fp, w->label());
- putc('\n', fp);
- }
- if (!(!w->tooltip() || !w->tooltip()[0])) {
- write_escaped_strings(fp, w->tooltip());
- putc('\n', fp);
+ for (p = proj.tree.first; p; p = p->next) {
+ if (p->is_widget()) {
+ w = (Widget_Node *)p;
+ if (w->label()) {
+ write_escaped_strings(fp, w->label());
+ putc('\n', fp);
+ }
+ if (!(!w->tooltip() || !w->tooltip()[0])) {
+ write_escaped_strings(fp, w->tooltip());
+ putc('\n', fp);
+ }
}
}
break;