FLTK logo

[master] 9837775 - GitHub #329: fixed missing code

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 9837775 - GitHub #329: fixed missing code "Matthias Melcher" Dec 16, 2021  
 
commit 983777535eb72de453cd84f73d791108d5453b81
Author:     Matthias Melcher <git@matthiasm.com>
AuthorDate: Thu Dec 16 19:30:59 2021 +0100
Commit:     Matthias Melcher <github@matthiasm.com>
CommitDate: Thu Dec 16 19:51:37 2021 +0100

    GitHub #329: fixed missing code
    
    Commented out code was obsolete.
    line_len was a true bug which can shred the end of lines.
    
    Removed Warning

 fluid/code.cxx    |  6 +++---
 fluid/factory.cxx | 17 -----------------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git fluid/code.cxx fluid/code.cxx
index ec61902..a289610 100644
--- fluid/code.cxx
+++ fluid/code.cxx
@@ -419,15 +419,15 @@ void write_c_indented(const char *textlines, int inIndent, char inTrailwWith) {
       if (newline)
         line_len = (int)(newline-textlines);
       else
-        line_len = strlen(textlines);
+        line_len = (int)strlen(textlines);
       if (textlines[0]=='\n') {
         // avoid trailing spaces
       } else if (textlines[0]=='#') {
         // don't indent preprocessor statments starting with '#'
-        write_c("%.*s", (int)(newline-textlines), textlines);
+        write_c("%.*s", line_len, textlines);
       } else {
         // indent all other text lines
-        write_c("%s%.*s", indent(), (int)(newline-textlines), textlines);
+        write_c("%s%.*s", indent(), line_len, textlines);
       }
       if (newline) {
         write_c("\n");
diff --git fluid/factory.cxx fluid/factory.cxx
index dfc75d9..d3888c6 100644
--- fluid/factory.cxx
+++ fluid/factory.cxx
@@ -1053,7 +1053,6 @@ static Fl_Type *known_types[] = {
 Fl_Type *add_new_widget_from_user(Fl_Type *inPrototype, Strategy strategy) {
   undo_checkpoint();
   undo_suspend();
-  Fl_Type *ins = Fl_Type::current;
   Fl_Type *t = ((Fl_Type*)inPrototype)->make(strategy);
   if (t) {
     if (t->is_widget() && !t->is_window()) {
@@ -1087,22 +1086,6 @@ Fl_Type *add_new_widget_from_user(Fl_Type *inPrototype, Strategy strategy) {
         }
       }
     }
-#if 0
-    // Fluid inserts widgets always as the last child of a matching group.
-    // This is great when reading a file, but if users do thins interactively,
-    // they expect the new widget close to where they worked previously.
-    if (ins) {
-      // if the new and current widget are siblings, just move it here.
-      if (ins->level==t->level) {
-      Fl_Type *c;
-      for (c=t; c && c!=ins && c->level>=t->level; c=c->prev) { }
-        if (c==ins) {
-          t->move_before(ins); // together the same as 'move_after'
-          ins->move_before(t);
-        }
-      }
-    }
-#endif
     // make the new widget visible
     select_only(t);
     set_modflag(1);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.