Bug 106687 - (Typography Extension v1.1) Pressing "Oldstyle figures" button in Typography Toolbar gives "Basic Syntax error. Expected: )."
Summary: (Typography Extension v1.1) Pressing "Oldstyle figures" button in Typography ...
Status: RESOLVED DUPLICATE of bug 106529
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-22 00:40 UTC by Jim DeLaHunt
Modified: 2017-03-22 18:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim DeLaHunt 2017-03-22 00:40:27 UTC
Description:
When I press the "Oldstyle figures" button on the Typography toolbar, LO displays an error alert, "BASIC syntax error".

In the "My Macros & Dialogs.typo" dialogue, the BASIC subroutine "My Macros & Dialogs.typo"… "typo"… "_General" macro is displayed. The orange breakpoint arrow points to a line in "sub prg(pars)":

n = Mid(n, 1, pos - 1) & s & cstr(refine(id, i) & Mid(n, pos + len(s) + len(current))

Note that this line ends in two right parenthesis characters. As I count the parentheses, I think a third right parenthesis is needed at the end of this line to balance the expresssion.  This third parenthesis closes the cstr() expression.



Steps to Reproduce:
1. Install the Typography Toolbar extension https://extensions.libreoffice.org/extensions/typography-toolbar into LibreOffice 5.3.1.2, Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2,
on Mac OS X 10.11.6.
2. Start LibreOffice
3. Open a new Writer document
4. Type the phrase "test", and select it
5. Select menu item "View"… "Toolbars"… "Typography". The Typography toolbar appears. Move it into a place in the window where it is usable.
6. Click the "Oldstyle figures" button (which has "123" in it).


Actual Results:  
LO opens the "My Macros & Dialogs.typo" dialogue, and in front of that displays an error alert:
 
"LibreOffice 5.3.…
BASIC syntax error.
Expected: ).
[OK]"

When I click on the OK button, the same error alert appears again. When I click OK on the second alert, it goes away.

There is no change to the formatting of the text.

Expected Results:
LO should have applied the "old style figures" feature to the text. This would not, in this example, make a visible change. 
There should be no error alert.
The "My Macros & Dialogs.typo" dialogue should not appear.



Reproducible: Always

User Profile Reset: No

Additional Info:
When I try to edit this macro to add the parenthesis, I am unable to change it. This may be a separate problem.

I get a similar BASIC error when I press other buttons in the toolbar, or even the Help link.

I reproduced this with "Typography toolbar - 1.1". The extension file is named "typo-0-5.oxt". The Extensions page https://extensions.libreoffice.org/extensions/typography-toolbar says it was released Mar 19, 2013, and tested with: LibreOffice 3.5, LibreOffice 4.0.  

I speculate that the BASIC line really is missing a closing parenthesis, that it has been wrong all along, and that something changed between LO 4.0 and 5.3 in how LO's BASIC interpreter handles this kind of error. Maybe before it silently assumed an extra closing parenthesis, but now it raises an error alert.

Workaround: use the OpenType feature tag syntax (https://ask.libreoffice.org/en/question/82052/opentype-features-now-enabled-documentation/?answer=90815#post-id-90815) in the font name to invoke features. 



User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Mike Kaganski 2017-03-22 04:02:50 UTC

*** This bug has been marked as a duplicate of bug 106529 ***
Comment 2 Jim DeLaHunt 2017-03-22 07:20:25 UTC
Might I suggest that this bug is not a duplicate of bug 106529? It seems that there is a genuine syntax error in one line of the Typography toolbar's macro. This bug should be the place to track that problem, and it should stay open until the macro is corrected.

The symptoms of the syntax error are affected by the behaviour of bug 106529, so there should definitely be a cross-reference. But even if the BASIC parser is rolled back so that it stops complaining about this particular kind of incorrect syntax, the macro will still contain a syntax error.  And this bug does not depend on or block 106529; either one can be fixed without the other.

I propose that this bug be marked REOPENED or VERIFIED, and bug 106529 be added to its See Also list.

I'm a new participant, so I don't want to do the wrong thing. Thus I suggest making this change, but I'll wait for some confirmation that it is a good idea before actually making it.
Comment 3 Mike Kaganski 2017-03-22 07:37:01 UTC
The bug in the extension should be fixed by the extension author. TDF doesn't develop it, so its Bugzilla is not a place to track an external project's bug state. So, I disagree that each affected extension should have its dedicated issue # here. Rather, I suppose that authors should be informed and asked about the fix (e.g., by mail), and if they use some bug tracking system, that system should be used instead.
Comment 4 Mike Kaganski 2017-03-22 07:51:54 UTC
Wrt required correction: I am sure that you need to put closing parenthesis not at the end of the expression, but rather like this:

n = Mid(n, 1, pos - 1) & s & cstr(refine(id, i)) & Mid(n, pos + len(s) + len(current))

e.g. after cstr(refine(id, i) and before &.
Comment 5 Jim DeLaHunt 2017-03-22 18:18:58 UTC
> I am sure that you need to put closing parenthesis not at the end of the 
> expression, but rather ... after cstr(refine(id, i) and before &.

Thank you for this suggestion. 

> TDF doesn't develop [the Typography toolbar extension], so its Bugzilla
> is not a place to track an external project's bug state.

Fair enough. I had recently read something which suggested tracking Extension bugs in this Bugzilla. But now I read https://wiki.documentfoundation.org/QA/BugReport/Extensions , which says clearly that this Bugzilla does not track Extensions from outside Document Foundation.

For the Typography extension, I can see an email address, but no link to a bug tracker. It's a pity that the Extensions register doesn't collect contact information for extension developers and for their bug tracking services, and pass it on to Extension users.  But that's another issue.

Given this, I withdraw my suggestion, and thank you for your help.