From 982b21bd58836fcdf147854fec060d16bf38f6f8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 27 Aug 2018 09:26:49 +0000 Subject: Fixed indenting and some wording in previous changes to Fluid git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13028 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/Fl_Function_Type.cxx | 4 ++-- fluid/code.cxx | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 7b3685b68..acb25682f 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -824,7 +824,7 @@ void Fl_Data_Type::open() { else if (w == data_panel_ok) break; else if (w == data_filebrowser) { goto_source_dir(); - const char *fn = fl_file_chooser("Load Data Verbose", 0L, data_filename->value(), 1); + const char *fn = fl_file_chooser("Load Inline Data", 0L, data_filename->value(), 1); leave_source_dir(); if (fn) { if (strcmp(fn, data_filename->value())) @@ -925,7 +925,7 @@ void Fl_Data_Type::write_code1() { fclose(f); } } else { - fn = fn ? filename_ : ""; + fn = filename_ ? filename_ : ""; } if (is_in_class()) { write_public(public_); diff --git a/fluid/code.cxx b/fluid/code.cxx index 9d33f50d8..62114c238 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -156,17 +156,20 @@ void write_cstring(const char *s, int length) { varused = 1; return; } - if (write_sourceview && ((s==NULL) || (length>1024))) { - if (length>=0) - fprintf(code_file, "\" ... %d bytes of text... \"", length); - else - fprintf(code_file, "\" ... text... \""); - return; - } - if (length==-1) { - fprintf(code_file, "\" ... undefined size text... \""); - return; - } + // if we are rendering to the source code preview window, and the text is + // longer that four lines, we only render a placeholder. + if (write_sourceview && ((s==NULL) || (length>300))) { + if (length>=0) + fprintf(code_file, "\" ... %d bytes of text... \"", length); + else + fprintf(code_file, "\" ... text... \""); + return; + } + if (length==-1 || s==0L) { + fprintf(code_file, "\n#error string not found\n"); + fprintf(code_file, "\" ... undefined size text... \""); + return; + } const char *p = s; const char *e = s+length; @@ -247,6 +250,7 @@ void write_cdata(const char *s, int length) { return; } if (length==-1) { + fprintf(code_file, "\n#error data not found\n"); fprintf(code_file, "{ /* ... undefined size binary data... */ }"); return; } -- cgit v1.2.3