| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3290
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | Fl_Help_Dialog does not number ordered lists |
Version: | 1.3.3 |
Created By: | vigmond |
Assigned To: | AlbrechtS |
Fix Version: | 1.4.0 |
Fix Commit: | f904f4c4eca104cfb57ae6b904515ecf91dc4db2 |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | vigmond 02:38 Mar 07, 2016 |
| Ordered lists are rendered as unordered | |
|
#2 | vigmond 06:53 Mar 07, 2016 |
| I have a small quick diff which will now number ordered lists. This is for fltk 1.3.3. it could be improved upon to handle the different types of numbering, but it does handle nesting.
60a61 > #include <stack> 448a450,451 > std::stack<int> OL_num ; // if nonnegative, in OL mode and this is the item number > OL_num.push(-1); 702a706,714 > > if (strcasecmp(buf, "OL") == 0) > OL_num.push(1); > else if ( strcasecmp(buf, "/UL") == 0 ) > OL_num.push(-1); > else if ( strcasecmp(buf, "/OL") == 0 || > strcasecmp(buf, "/UL") == 0 ) > OL_num.pop(); > 707c719,720 < wchar_t b[] = {0x2022, 0x0}; --- > if( OL_num.top()<0 ) { > wchar_t b[] = {0x2022, 0x0}; // this is a bullet symbol 710a724,729 > } else { > sprintf( buf, "%d. ", OL_num.top() ); > int nnum = OL_num.top()+1; > OL_num.pop(); > OL_num.push(nnum); > } | |
|
#3 | AlbrechtS 09:49 Mar 07, 2016 |
| Thanks for the report and the patch.
We like patches, but please use diff -u to generate a patch for future contributions. This makes sure that the patch is easier to apply if the underlying code changes (more context). And while we're at it: please upload the patch as a file with the "Post File" link.
I'll take a look at your patch...
Okay, sorry, but that doesn't work, because..
(1) I can't apply your patch, please use diff -u
(2) We don't use STL in FLTK, hence we can't apply that patch. Although std::stack might be a good and simple way to implement what you propose, we can't do it this way.
I'd appreciate if you could rewrite your patch and post it as a file with diff -u as written above. TIA.
PS: if you're using git, then `git diff` is another way, or if you download our subversion source, then `svn diff` will issue a patch format we can use. Using subversion has the additional advantage that your patch will be based on current code, so that it would apply cleanly to our code base. Thanks. | |
|
#4 | vigmond 10:10 Mar 07, 2016 |
| Do you have a stack implemented?
As a side note, why do you not use STL? 15 years ago, I understood the concern. | |
|
#5 | AlbrechtS 11:08 Mar 07, 2016 |
| No, we don't have a stack implemented.
We're still not using STL because we try to support ancient and exotic or otherwise incomplete build systems for embedded systems. This is not going to be changed in the FLTK 1.3.x series, but maybe we'll think about it in the next minor release (1.4.0). I can't tell what the decision will be though...
FWIW, eventually I could apply your patch with patch -n - although it did not like empty lines first, I had to change one line. I don't know if this is normal behavior of patch.
I converted your patch to a valid patch file (git diff) after fixing some issues:
- indenting and formatting - fixed one line ("UL" instead of "/UL")
See attached file stack_v2.diff.
I did not test it though.
Note that there should be some sanity checks, particularly for stack underflow. If a file contained "</UL>" or "</OL>" blocks w/o previous "<UL>" or "<OL>" blocks your version would pop() too many items.
Thanks for your support! It's appreciated. | |
|
#6 | vigmond 13:08 Mar 07, 2016 |
| It's a shame there is no stack object. It is not a huge amount of work to add one but I do not have the time. Maybe you have another structure coded that could help.
I saw my bug with '/UL' right after I submitted the post of course. | |
|
#7 | vigmond 04:11 Jan 25, 2017 |
| I made a patch for 1.3.4--1. I finally implemented my own stack version without going overboard. It does basic error checking but was not sure how your code wanted to deal with errors, whether silent or not. | |
|
#8 | AlbrechtS 03:45 Mar 11, 2021 |
| Please use GitHub Issue #153 "Fl_Help_View <OL> don't number items" for all further discussions and (patch) proposals.
https://github.com/fltk/fltk/issues/153 | |
|
#9 | AlbrechtS 07:55 Nov 06, 2022 |
| This bug has been fixed in FLTK 1.4.0 (git) in commit f904f4c4eca104cfb57ae6b904515ecf91dc4db2.
For more information please see GitHub issue #153 (link above). | |
[ Return to Bugs & Features ]
|
| |