#858: Fluid: removed duplicate and false code

This commit is contained in:
Matthias Melcher 2023-12-04 16:28:07 +01:00
parent 1476d215f3
commit 75c97edb1e
2 changed files with 0 additions and 28 deletions

View File

@ -1585,7 +1585,6 @@ Fl_Type *Fl_Comment_Type::make(Strategy strategy) {
o->name("my comment");
o->add(p, strategy);
o->factory = this;
o->title_buf[0] = 0;
return o;
}
@ -1755,34 +1754,9 @@ void Fl_Comment_Type::open() {
break;
}
BREAK2:
title_buf[0] = 0;
comment_panel->hide();
}
/**
Create a title for the Widget Browser by extracting the first 50 characters of the comment.
*/
const char *Fl_Comment_Type::title() {
const char* n = name();
if (!n || !*n) return type_name();
if (title_buf[0]==0) {
const char *s = n;
char *d = title_buf;
int i = 50;
while (--i > 0) {
char n = *s++;
if (n==0) break;
if (n=='\r') { *d++ = '\\'; *d++ = 'r'; i--; }
else if (n=='\n') { *d++ = '\\'; *d++ = 'n'; i--; }
else if ((n >= 0) && (n < 32)) { *d++ = '^'; *d++ = 'A'+n; i--; }
else *d++ = n;
}
if (i<=0) { *d++ = '.'; *d++ = '.'; *d++ = '.'; }
*d++ = 0;
}
return title_buf;
}
/**
Write the comment to the files.
*/

View File

@ -198,7 +198,6 @@ class Fl_Comment_Type : public Fl_Type
{
typedef Fl_Type super;
char in_c_, in_h_, style_;
char title_buf[64];
public:
Fl_Comment_Type();
@ -207,7 +206,6 @@ public:
void write_code2(Fd_Code_Writer& f) FL_OVERRIDE { }
void open() FL_OVERRIDE;
const char *type_name() FL_OVERRIDE {return "comment";}
const char *title() FL_OVERRIDE; // string for browser
void write_properties(Fd_Project_Writer &f) FL_OVERRIDE;
void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE;
int is_public() const FL_OVERRIDE { return 1; }